Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Use trigger to select values in one field based on values in another

Hi community,  You guys are great and I really appreciate all your help!  If I have a field that has 12 values say A, B, C and woul like each of those to trigger the selection of a different value say 1, 2, 3, how would I do that?  I think I'd need to use a trigger.  I'd like something like selecting A in field ONE to select 1 in field TWO and selecting B in field ONE to select 2 in field TWO.

20 Replies
Not applicable
Author

Is there any thread which explains the basic on how to use triggers in Qlikview? Can anyone please direct me there?

varunjain
Creator
Creator

Hi Oscsar,

Somehow, the solution provided by you isn't working on my QV doc. Please assist and let me know if I am missing out on something. Thanks

oscar_ortiz
Partner - Specialist
Partner - Specialist

It looks like you needed to change your variable:

FROM

=FieldIndex( 'Alpha', '$(vSelect)' )

TO

=FieldIndex( 'Alpha', '$(VSelect)' )

Variables are case sensitive.

Hope this works for you.

Not applicable
Author

Hi Oscsar,

Greetings!!

http://community.qlik.com/thread/156118

I am expecting your are the correct person to answer my question in above thread?

Please advice me the solution!

This is higly appreiciated!

Thanks,

Raju

Not applicable
Author

I have a similar case and it would be great if you could help

I have two fields -

A - (All, x1,x2,x3,x4, unknown)

B -  (x1,x2,x3,x4,x5,x7)

I only want B to get auto-selected when value of A is (x1 or x2 or x3 or x4); when all or unknown is selected, nothing in B should be selected, i.e. all B values should be selected.

B will have the same value as A except when A is All or unknown

is this possible? please help

Anonymous
Not applicable
Author

Hello Hrithik,

You should be able to use set analysis along with the triggers to do this. You would set up a trigger where a selection in field A would select in field B with the search string something like this:

='("' & concat({$<FieldA-={'All','unknown'}>} distinct FieldA,'"|"') & '")'

Karim_Khan
Creator III
Creator III

Hi Oscar,

     U really desrve OScar for Qlik

KK
Anonymous
Not applicable
Author

Hi Oscar,

Below is my data model where USER_LOB and INACTIVE_USERLOB are having the same values.

Requirement is "when USER_LOB' value is selected, the same value should be selected in INACTIVE_USERLOB and displayed in the chart.

CAAF1A34-6873-4C04-832A-85E87B60D5F3.JPG

But in my case when OGC is selected under USE_LOB, nothing is being filtered under INACTIVE_USERLOB

536F73E8-51F2-4A77-BC71-0B7F3103FD8A.JPG

can you please help me with this? Thanks!

oscar_ortiz
Partner - Specialist
Partner - Specialist

Roshita,

You must be careful in this situation because of the possible associations in your data.  In the example I've uploaded I tried to make the schema resemble your schema.  But in my data set there is no relationship between AWM in USER_LOB and AWM in INACTIVEUSER_LOB.  So this will not work for that particular LOB.  It will work with other LOB's because there is a relationship within the data.

Hope this helps.  Look at Sheet 1 for your particular request.  Select a value in USER_LOB and click the Test LOB button.  Check the properties under action for what I've done:

1498919.PNG

In your particular case you may want to change your schema to have a relationship between the USER_LOB and INACTIVE_USER_LOB.

Good luck

Oscar

Anonymous
Not applicable
Author

Thanks much Oscar.