Focal Point
(SOLVED) Filling the gaps - MacGyver or JOIN or MATCH or MODIFY

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/4187078096

October 24, 2018, 11:37 AM
vaayu
(SOLVED) Filling the gaps - MacGyver or JOIN or MATCH or MODIFY
Hello Gurus,
I'm wondering if anyone could throw me some pointers on how to best prep my data for a report that shows monthly totals by dimension. Occasionally some months don't have an entry for that dimension which I still need to show it as 0. I have two unique datasets as hold files, just need to merge or combine the two columns to repeat by dimension for every month as shown in the image here.
Screenshot


 
TABLE FILE BKLGDATA
BY MTH_GL
END

TABLE FILE BKLGDATA
BY BG
END
 


Please let me know of any ideas.
Thanks!
-P

This message has been edited. Last edited by: vaayu,
October 24, 2018, 01:27 PM
MartinY
There are several ways to accomplish that.

One is to create "buckets" that will then be filed by the data. And to perform this there is also few ways.

You can create a file that will contain all available dimension with dummy measure bucket that will then be merged with real data.
DEFINE FILE GGSALES
YR /YY = DATE;
MM /Mt = DATE;
END
TABLE FILE GGSALES
SUM COMPUTE DOL /D8 = 0;
    COMPUTE BDG /D8 = 0;
BY REGION
BY PRODUCT
BY YR
BY MM
ON TABLE HOLD AS BUCKETFIL
END
-RUN

DEFINE FILE GGSALES
YR /YY = DATE;
MM /Mt = DATE;
END
TABLE FILE GGSALES
SUM DOLLARS/D8 AS 'DOL'
    BUDDOLLARS/D8 AS 'BDG'
BY REGION
BY PRODUCT
BY YR
BY MM
ON TABLE HOLD AS EXTDATA
END
-RUN

TABLE FILE BUCKETFIL
SUM DOL
    BDG
BY REGION
BY PRODUCT
ACROSS YR
ACROSS MM
MORE
FILE EXTDATA
END
-RUN



WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
October 24, 2018, 02:59 PM
vaayu
Thank you Martin/David,
I like the idea of creating the buckets and filling it up with data. This seems to be a good fit for me and working.

Thanks again!