Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Highlighted
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

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

For expressions use

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


Hope that helps

7 Replies

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

Hello Aldo,

For values, the folowing will work

(Value1 | Value2)


Hope this helps

Not applicable

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

Hi Miguel,

I tried:

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

and is not working...

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

For expressions use

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


Hope that helps

Not applicable

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

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

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

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) & ')'

twebber
Contributor II

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

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?

nadeemsmarty
Valued Contributor

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

Hi,

you can use this

=Year(Today()) for your Year field

=Month(Today()) for your Month field