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

select multiple values in fields

Hi,

I am comparing yesterday to the same day last year and am trying to find a better way to achieve this.  At the moment I am using select in field for 'week of year' and 'day of week'r.  This falls over at this time of year though as Week 52 or Week 1 does not cross over between years.

At some stage I will need to look into the fault in the calendar but for the moment I just need a workaround.  I know if I manually select the two dates I am interested in it works but as the select in field is part of an automatic process I need to set this up as a trigger.

So far I have got max(FullDate) and max(FullDate)-364 working individually but how do I combine these into a single trigger?

Thanks in advance,

Julian

1 Solution

Accepted Solutions
marcus_sommer

You could use a search-expression like this one - you need only to adjust the date-format to the format from your date-field:

= '(' & date(today()-1, 'DD.MM.YYYY') & '|' & date(today()-364, 'DD.MM.YYYY') & ')'

- Marcus

View solution in original post

4 Replies
marcus_sommer

You could try it with two expression like:

sum({< Date = {"=date(today()-1)"}>} value) // yesterday

sum({< Date = {"=date(today()-1 - 364)"}>} value) // same weekday in previous year

Another possibility might be to use daynumberofyear() - maybe within a master-calendar: How to use - Master-Calendar and Date-Values

- Marcus

Not applicable
Author

Hi Marcus,  Those expressions would work as well but how do I combine them in a select in field trigger to choose both dates?

marcus_sommer

You could use a search-expression like this one - you need only to adjust the date-format to the format from your date-field:

= '(' & date(today()-1, 'DD.MM.YYYY') & '|' & date(today()-364, 'DD.MM.YYYY') & ')'

- Marcus

Not applicable
Author

Thanks Marcus I was missing the brackets in my expression.