Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
h_demarco
Contributor III
Contributor III

set analysis with criteria before max date

I have a balance sheet dashboard with all accounting statements and a initial balance of each G/L account.

When I filter dates, I want the set analysis to sum initial balance + all statements BEFORE maximum selected date.

[Data] is the date field and to get maximum date I use

=Max(Data)

This is working fine.

But to sum values

<= Max(Data)

in set analysis is not working.


It should be something like below formula as I saw in many related discussions, but it is not working.

=initial_balance+sum({<Data={"<=$(=max(Data))"}>} AMOUNT)

Any idea on how to correctly write this set analysis sentence?

1 Solution

Accepted Solutions
sunny_talwar

May be you need to use only less than < instead of less than equal to <=

=RangeSum(initial_balance, Sum({<Data={"<$(=max(Data))"}>} AMOUNT))

Also do you make any selection in date related field which might contradict your set analysis? like selection in Month field? If you do, then you need to ignore that in your set analysis

View solution in original post

2 Replies
sunny_talwar

May be you need to use only less than < instead of less than equal to <=

=RangeSum(initial_balance, Sum({<Data={"<$(=max(Data))"}>} AMOUNT))

Also do you make any selection in date related field which might contradict your set analysis? like selection in Month field? If you do, then you need to ignore that in your set analysis

h_demarco
Contributor III
Contributor III
Author

It worked. In fact, error was in contradicted selection. Once we ignored it, correct sum showed up.

Thanks