Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello community,
I'm encountering an issue with calculating a cumulative count across months in Qlik Sense. I have a dataset with a field sno
representing serial numbers and another field YH_Month_num
representing months as 1, 2, 3, 4, 5, etc.. I'm trying to calculate the cumulative count of distinct sno
up to the current month.
Here's the expression I'm using:
Count({<YH_Month_num = {"<=([YH_Month_num])"}>} distinct sno)
However, this expression is resulting 0.
Could someone help me understand what might be going wrong with this expression or suggest an alternative approach to achieve the cumulative count across months?
Any assistance would be greatly appreciated.
Thanks
Regards
Bhavya
Hi @yh2023
your expression is looking for values in your field YH_Month_num that equals to the string between quotes: <=([YH_Month_num]).
Hi @F_B
When I use Count({<YH_Month_num = {"=([YH_Month_num])"}>} distinct sno)
, I'm getting the count for every month. But "<=([YH_Month_num])" doesn't work for cumulative sum.
Try this:
Count({<YH_Month_num = {"<=$(=num(month(today())))"}>} distinct sno)