Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
etiennesan
Contributor III
Contributor III

Calculate a measure even when a dimension has no value associated

Hello everyone,

Here is my problem: I want to compare my daily orders with my monthly forecast, by assuming that my orders will be split equally on my days of the month, removing weekends, according to a calendar that I'm loading (with a column shippable equal to -1 if it is a day where we can ship, 0 if not).

I tried adding a new table for a daily forecast and it works. In blue the forecast, in red the orders.

etiennesan_0-1615185989666.png

However, with this method I end up with additional keys based on the shippingDate, and I would like to avoid that.

Therefore I tried using this formula:

 

Rangesum(Above(Sum(If(shippable = -1, Forecast / vNumberOfDays)), 0, RowNo()))

 

But then it only gets calculated for the days where I have orders:

etiennesan_1-1615186122970.png

Any idea on how to change the formula so that it's calculed for every day of the month?

 Thank you very much!

1 Solution

Accepted Solutions
etiennesan
Contributor III
Contributor III
Author

Actually could get it to work with the following formula: using TOTAL to disregard dimension, but with special conditions to tailor my needs

If(shippable = -1, Sum(TOTAL  {$<Description={*}>}  Forecast) / vNumberOfDays, 0)

View solution in original post

2 Replies
etiennesan
Contributor III
Contributor III
Author

I can see it has to do with the fact that my forecast and my calendar are only linked through the orders table, but there should be a way to calculate for every value, or should I create a calendar just for the forecast too?

etiennesan_0-1615265068268.png

 

etiennesan
Contributor III
Contributor III
Author

Actually could get it to work with the following formula: using TOTAL to disregard dimension, but with special conditions to tailor my needs

If(shippable = -1, Sum(TOTAL  {$<Description={*}>}  Forecast) / vNumberOfDays, 0)