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

Announcements
Only at Qlik Connect! Guest keynote Jesse Cole shares his secrets for daring to be different. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Using triggers to select data in Alternate States

Hi all,

This is my first post.

I am currently trying to select a data from the default state.

Eg DepartureDate 30/12/2015 and with this date find out what the Last last year comparison date is.

These last year comparison dates are set by the business and look as follows:

Capture.PNG

Once I have found the last last year comparison date in the default state I then want to use this date eg 30/12/2013 and use this for my departuredate in the alternate state I have called "alt" to fidn the sum(rev) for 30/12/2013. LLY_COM means last last year comparison date

Capture2.PNG

To do this i have added the following triggers:

Capture3.PNGCapture4.PNGCapture5.PNGCapture6.PNG

The string search has the following expression

='=LLY_COM=Aggr(NODISTINCT Only(total {<DepartureDate=P($::LLY_COM)>} LLY_COM), DepartureDate)'

Capture7.PNG

The issue is that when I use the above trigger in the alternate state it doesn't select just one DepartureDate it selects them all...

Capture9.PNG

Can someone please help, I think maybe the following expression is not the correct one:

='=LLY_COM=Aggr(NODISTINCT Only(total {<DepartureDate=P($::LLY_COM)>} LLY_COM), DepartureDate)'


although this whole method worked for LY_COM so using the last year comparison date......just not for last last year.

7 Replies
sunny_talwar

Have you tried using this may be?

='(' & Concat({$} Chr(34) & LLY_COM & Chr(34),  '|') & ')'

Not applicable
Author

Hi,

Thanks for replying.

I have placed that here:

Capture11.PNG

and tried it like this also but still not working....

Capture12.PNG

Capture13.PNG

sunny_talwar

You don't need to add this -> =LLY_COM='(' & Concat({$} Chr(34) & LLY_COM & Chr(34),  '|') & ')'


Just use this search string -> ='(' & Concat({$} Chr(34) & LLY_COM & Chr(34),  '|') & ')'

Not applicable
Author

Ye i did that but still not working, am I using the right state?

Capture21.PNG

Capture22.PNG

sunny_talwar

Looks right, not sure what isn't right. Can you share a sample?

Not applicable
Author

How do I add a qvw?

sunny_talwar

Step 1:

Capture.PNG

Step 2:

Capture.PNG