Forum Discussion
Creating Table Based on Year Month and ID
Hello,
Here is my isssue:
I have a list of distributor names, year month, and sales. However, sometimes a distributor will not buy in a given month (have no sales) and thus be left out of my "fact" table.
So, when I go to do calculations like "show me all sales from last year" and the filter is on a month in which the distributor had no sales, I return a blank instead of the sales for the PY.
I know for this one use-case, I could likely do some measure manipulation (datesbetween etc..) to get my desired result. But this same issue comes up for all sorts of calculations.
It would be better if my distributor, year month, sales table had the distributor name, the given year month, and a 0 for sales for a month in which a distributor had no sales.
I am a bit lost on how to enforce "if a distributor does not have sales in a given year month, insert a row with their name, the year month, and sales = 0. I would like to accomplish this task in the query editor.
Example data:
Notice for distributor A, there is no sales in January. So, if I filter on January, I get a bunch of blank results (even for PY logic calculations etc.).
Any suggestions for adding distributor A with a year month and sales =0? No need to add product group stuff, but if I added two lines each with 0, that also would be fine.
Thanks much!! 🙂
-Joel
1 Reply
- PadycosmosSolution Sage
hope this helps: