Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Save the Date: QlikWorld Online, June 24-25, 2020. Free global virtual event for data integration and data analytic gurus. Register Today
Highlighted
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
Highlighted
MVP & Luminary
MVP & Luminary

Re: select multiple values in fields

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
Highlighted
MVP & Luminary
MVP & Luminary

Re: select multiple values in fields

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

Highlighted
Not applicable

Re: select multiple values in fields

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

Highlighted
MVP & Luminary
MVP & Luminary

Re: select multiple values in fields

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

Highlighted
Not applicable

Re: select multiple values in fields

Thanks Marcus I was missing the brackets in my expression.