Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
joshakehurst
Partner - Contributor III
Partner - Contributor III

Set Analysis - Last 90 Days

I'm attempting to use Set Analysis in Qlik Sense to filter a date range based on the last 90 days.  Using the expression below does not seem to have any effect.  I've tried various combinations, but just can't get anything to work.  The dimension in this scenario is Interaction Start Date Local. 

=Avg({$<[Interaction Start Date Local]=${">=today()-90"}>}Duration)

18 Replies
sunny_talwar

Try this

=Avg({$<[Interaction Start Date Local] = ${">=$(=Date(Today()-90, 'M/D/YYYY'))"}>} Duration)

Assuming, Interaction Start Date Local is in the format M/D/YYYY... if it is not, then you can do this

LOAD Date([Interaction Start Date Local]) as [Interaction Start Date Local]

and then this

=Avg({$<[Interaction Start Date Local] = ${">=$(=Date(Today()-90))"}>} Duration)

Also, look here

Dates in Set Analysis

joshakehurst
Partner - Contributor III
Partner - Contributor III
Author

Good stuff thanks for sharing.  Unfortunately, nothing seems to work which is rather frustrating.  Looking at our data set it would seem everything should line up correctly, but implementing the Date clause in the expression has no effect. 

Screen Shot 2018-05-30 at 10.07.57 AM.png

marcginqo
Partner - Creator
Partner - Creator

Josh,

is there a way you could send us the qvf? This way I can take a deeper look at it.

I got it working on one of my dashboards so must me a small thing.

Marc

sunny_talwar

Are you may be missing the dollar sign expansion?

=Avg({$<[Interaction Start Date Local] = ${">=$(=Date(Today()-90))"}>} Duration)


Capture.PNG

joshakehurst
Partner - Contributor III
Partner - Contributor III
Author

Unfortunately I can't share the qvf file due to data / privacy restrictions. 

joshakehurst
Partner - Contributor III
Partner - Contributor III
Author

Unfortunately I can't share the qvf file due to data / privacy restrictions.  Thanks for the offer though.  

joshakehurst
Partner - Contributor III
Partner - Contributor III
Author

Sunny - I tried adding the $ as described, but nothing changed. 

sunny_talwar

Would you be able to share the same image like above with this expression

=Avg({$<[Interaction Start Date Local] = {">=$(=Date(Today()-90, 'M/D/YYYY'))"}>} Duration)

joshakehurst
Partner - Contributor III
Partner - Contributor III
Author

Thanks this works!