Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
yh2023
Contributor III
Contributor III

Issue with Cumulative Count Calculation Across Months in Qlik Sense using set analysis

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

Labels (2)
3 Replies
F_B
Specialist
Specialist

Hi @yh2023 

your expression is looking for values in your field YH_Month_num that equals to the string between quotes: <=([YH_Month_num]).

yh2023
Contributor III
Contributor III
Author

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.

F_B
Specialist
Specialist

Try this:

Count({<YH_Month_num = {"<=$(=num(month(today())))"}>} distinct sno)