Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
fishmanl
Contributor II
Contributor II

Calculating values only if date1 > date2 using set anlysys

Hi

lets say i have the attached table, and i want to sum only values when date2 is greater than date1 - marked in yellow

i don't want to use IF statement, instead i would like to do it with Set Analysis, i use the following and it didn't work:

=Sum( {<date1={">$(=MIN(date2))"}>} cost)

what im doing wrong?

fishmanl_0-1640432839483.png

fishmanl_1-1640433023207.png

 

Labels (2)
1 Solution

Accepted Solutions
AshutoshBhumkar
Partner - Specialist
Partner - Specialist

Hello,

Try below,

Sum({<Cost = {"=Date2>=Date1"}>}Cost)

 

AshutoshBhumkar_0-1640437234064.png

 

Hope this helps.

 

Thanks,
Ashutosh

View solution in original post

3 Replies
AshutoshBhumkar
Partner - Specialist
Partner - Specialist

Hello,

Try below,

Sum({<Cost = {"=Date2>=Date1"}>}Cost)

 

AshutoshBhumkar_0-1640437234064.png

 

Hope this helps.

 

Thanks,
Ashutosh

fishmanl
Contributor II
Contributor II
Author

hi

working great!

but why the modifier is cost? shouldn't it be date1 vs date2?

 

AshutoshBhumkar
Partner - Specialist
Partner - Specialist

We are taking only cost line items where Date2 is greater than Date1