Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
rhyseretto
Contributor III
Contributor III

Sales outside of month selection showing as '-' if month selected has no sales

rhys.png

 

I've dumbed this down a bit, but here is the gist.. User selects a Calendar YearMonth. The second column reads that month's sales and is simply: 'Sum(Sales)'.

The first column shows the sales from 2 months ago. For simplicity, this currently is: 'if([Calendar YearMonth]='2021-02',Sum({<[Calendar YearMonth]={'2020-12'}>} Sales))'.

This works except for Retailer 5. Retailer 5 has $500 of Sales for Dec 2020, and $0 Sales for Feb 2021. QlikSense sort of seems to know this (hence it appearing in the table when Retailers with $0 for Dec 2020 and Feb 2021 don't). However, Dec 2020 is reading '-', when it should say $500. I'm obviously missing something important.

Help appreciated. Thanks.

Labels (6)
3 Replies
Or
MVP
MVP

I'm guessing your issue is with the set analysis / variable / whatever used to generate the 2020-12 value. Do you get a correct result if you hard-code that value instead of using a variable/formula?

rhyseretto
Contributor III
Contributor III
Author

Thanks for putting me onto the right path. Instead of if([Calendar YearMonth] = xxx, I needed to have if(v_CalMonth = xxx

Or
MVP
MVP

Perfect. This was the suspect because the combination of Retailer 5 - 2021-02 presumably doesn't exist in the data, so trying to read Calendar YearMonth in that context would return null rather than the 'expected' 2020-12. Glad you got it working.