Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Using set analysis to filter on the date in the dimension

Hi I want to use set analysis on the As Of Date in the dimension column. I am trying to count the paid amount up to a certain date.

This formula works.           sum(if([Paid Date] <= [As Of Date], [Paid Amount]))


This does not. It grabs the max date of the entire set, not the dimension.

sum({<[Paid Date] ={"$(= '<=' & max([As Of Date]))"}>} [Paid Amount])

As Of DatePaid Amount To Date
5/1/2016$                     2,500.00
4/1/2016$                     1,100.00
3/1/2016$                        800.00
2/1/2016$                        400.00

Edit for clarification:

My issue is that for sum({<[Paid Date] ={"$(= '<=' & max([As Of Date]))"}>} [Paid Amount]), max([As Of Date]) always equals 5/1/2016. I want it to equal 2/1/2016 when 2/1/2016 is the value in dimension, 3/1/2016 when 3/1/2016 is the value in dimension, and so on. I hope that clarifies my question.

Thanks in advance.

7 Replies
sunny_talwar

Would you be able to share a sample to look at this?

vishsaggi
Champion III
Champion III

You are missing the Set syntax I presume, try again:

sum( {< [Paid Date] = { "$(= '<=' & max([As Of Date]))" }  >} [Paid Amount])

Not applicable
Author

I did have the Set syntax right in Qlikview, I just forgot to type it out correctly in my question.

My issue is that for sum({<[Paid Date] ={"$(= '<=' & max([As Of Date]))"}>} [Paid Amount]), max([As Of Date]) always equals 5/1/2016. I want it to equal 2/1/2016 when 2/1/2016 is the value in dimension, 3/1/2016 when 3/1/2016 is the value in dimension, and so on. I hope that clarifies my question.

vishsaggi
Champion III
Champion III

Oh ok. Would it be possible to send us a sample app your are working on?

Not applicable
Author

Try this expression:

sum({<As Of Date={"$(='>=' & PaidDate)"}>}Amount)

Not applicable
Author

I did try this expression and it did not work:

sum({<As Of Date={"$(='>=' & PaidDate)"}>}Amount)



sunny_talwar

I guess the issue here is that set analysis is defined once per chart and cannot be done for each row. Like vishsaggi‌ mentioned, we might be able to help you better if you are able to share a sample with us.

Preparing examples for Upload - Reduction and Data Scrambling

Uploading a Sample