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

Announcements
Save an extra $150 Dec 1–7 with code CYBERWEEK - stackable with early bird savings: Register
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Using a current selection (YEAR) to look at Previous Year with set analysis

Based on a current selection (of DEPARTURE YEAR) im trying to look at data from that current selected year minus one year, and for (BOOKED_DATE)  to be a year ago to date.

So a total snapshot of the situation this time last year - I've tried the below set analyis and this does not work - how can I combine the field selection?

({$<DEPARTURE_YEAR = {$(=GetFieldSelection(DEPARTURE_YEAR)-1)}>}  BOOKED_DATE <=dayend (TODAY(),-365, PASS_NO))

3 Replies
Not applicable
Author

Hi James,

Are using any aggregation function?

Regards,

Shameem.

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

No idea if you want to use count or max or sum or whatever, but the set modifier for booked date wasn't correct. Try something like:

count({$<DEPARTURE_YEAR = {'$(=max(DEPARTURE_YEAR)-1)'}, BOOKED_DATE={'<$(=makedate(max(DEPARTURE_YEAR)-1))+DayNumberOfYear(today())+1)'} PASS_NO)


talk is cheap, supply exceeds demand
Not applicable
Author

Thanks Gusbert, I think I am almost there but essentially im using the Getfieldselection , which means the departure is variable. So if 2014 was selected I want to see 2014 and  2013 data (a snap shot of this time last year). So a Year on Year comparison.