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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

set Set Analysis between dates

hey guys

Ive been trying to make this set analysis work but i just keep on getting 0

sum({$<Datetime ={"$(<(date(max({1}Datetime)-1)))    $(>(date(max({Datetime)-15)))"}>}tests)

what am i doing wrong????

6 Replies
Not applicable
Author

Use something like this

=Sum({$<closeDate = {">=$(=vstartdate)<=$(=venddate) "}>} sales)

Instead of vstartdate and venddate, you can use expression to derive your date also.


=Sum({$<Datetime = {">=$(=date(max(Datetime )-15)) <=$(=date(max(Datetime )-1)) "}>} tests)




MayilVahanan

Hi

Try like this

sum({$<Datetime ={"<$(date(max({1}Datetime)-1))  >$(date(max(Datetime)-15))"}>}tests)

For set analysis
http://community.qlik.com/docs/DOC-2895

http://community.qlik.com/docs/DOC-3872

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Anonymous
Not applicable
Author

hey

i cant use Var

and sadly this to

sum({$<Datetime ={"<$(date(max({1}Datetime)-1))  >$(date(max(Datetime)-15))"}>}tests)

didnt work thanks guys


any other ideas

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

     This might not have worked because the date format will be different.

     Meaning the format for the field Datetime and the value which you are checking ({"<$(date(max({1}Datetime)-1))  >$(date(max(Datetime)-15))"}) should be same.

     Kindly check that.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
jonathandienst
Partner - Champion III
Partner - Champion III

Hi

Give this a try:

sum({$<Datetime ={"<$(=date(max({1} Datetime) - 1)) >$(=date(max({1} Datetime) - 15))"}>}tests)

Regards

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
jldengra
Creator
Creator

Hello, Jonathan.

In some of the QlikTech courses it is recommended to convert dates to numbers in order to be used in Set Analysis, since sometimes it does not work properly using a date value.

Being aware of this issue, whenever I need to use dates in set analysis I create additional fields with the num(field) value, and I work only with numeric format for dates, and they always work properly.

I hope this helps.