Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Triggers / OnOpen / Select In Field - Two selection in same field

Hi guys,

I have defined a Trigger:

Document Properties / Triggers / OnOpen / Select In Field

Field ==> [Field1]

Search String ==> =Max(Field1)-1

It is working, but now I need to one more value to the selection. Is that possible?

Thanks in advance,

Aldo.

1 Solution

Accepted Solutions
Miguel_Angel_Baeyens

For expressions use

='(' & $(=Max(Field)) & '|' & $(=Min(Field)) & ')'


Hope that helps

View solution in original post

7 Replies
Miguel_Angel_Baeyens

Hello Aldo,

For values, the folowing will work

(Value1 | Value2)


Hope this helps

Not applicable
Author

Hi Miguel,

I tried:

Search String ==> = ( Max([Shipments.Recognition Year])-1 | Max([Shipments.Recognition Year]) )

and is not working...

Miguel_Angel_Baeyens

For expressions use

='(' & $(=Max(Field)) & '|' & $(=Min(Field)) & ')'


Hope that helps

Not applicable
Author

Try

Select in Field => = Max([Shipments.Recognition Year])-1

Toggle Select=> = Max([Shipments.Recognition Year])

I got the idea from here: http://community.qlik.com/forums/p/23382/89372.aspx

HTH

Not applicable
Author

Thanks guys.

This one also works (3 values):

= '(' & Max({1} [Shipments.Recognition Year]) & '|' & (Max({1} [Shipments.Recognition Year])-1) & '|' & (Max({1} [Shipments.Recognition Year])-2) & ')'

Anonymous
Not applicable
Author

Miguel, is it possible to have more than one field selection? I'll give an example. I want to select the latest year and month in my trigger. i have a Year attribute and a Month attribute. I know I can create a YearMonth attribute in the script but I dont want to do this. I want to use the two attribute I already have.

So, i tried creating multiple "Select in Field" actions. First i used Year and made the search string =Max(Year). Second I used Month and the search string is =Max(Month). It would appear to me that the second select in field action overwrites the first selection. This is not what i expected but such is like.

So, i thought maybe I could write and expression to handle this. Something like what you have above but with two "different" attributes. Is this possible?

fashid
Specialist
Specialist

Hi,

you can use this

=Year(Today()) for your Year field

=Month(Today()) for your Month field