Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set analysis for cumulative data

Hello,

I have data that has selection for year and month and I want to see a cumulative amount for up to the period chosen. So if, say, user selects "7" for month, I would like to get the cumulative Jan-July for this selection, while year variable is not affected - if year is not selected, the user gets cumulative for Jan-July, but if year is chosen, say 2014, then user sees cumulative Jan-July for 2014.

I am trying to use a very simple code, but it does not seem to work in pivot table (I must use pivot table):

Sum({$<month_id={"<=$month_id"}>} (sum_invoiced_company_eur+freight_company_eur)/1000)

Could you please point me to the correct direction of modifying it?

Thanks in advance!

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

try like this:

=(Sum({$<month_id={'<=$(=max(month_id))'}>} sum_invoiced_company_eur)

+

Sum({$<month_id={'<=$(=max(month_id))'}>} freight_company_eur))/1000



View solution in original post

3 Replies
sunny_talwar

It would be easier to resolve if you can share a sample data or sample application with the expected output.

Anonymous
Not applicable
Author

try like this:

=(Sum({$<month_id={'<=$(=max(month_id))'}>} sum_invoiced_company_eur)

+

Sum({$<month_id={'<=$(=max(month_id))'}>} freight_company_eur))/1000



Not applicable
Author

Thanks a lot Balraj, this works like a treat!