Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Trigger automatic selection identical to possible values in another field.

Hi.

I have 2 fields: YearWeek1 and YearWeek2.

And now I would like an working function/trigger - (the best would bee a trigger 'OnAnyChange') -, that automaticly makes a selection in YearWeek2 identical to the possible values in YearWeek1 - that is: the selection in YearWeek2 should always 'mirror' the possible values in YearWeek1.

I guess, it's easy, but I just can't get it to work.

1 Solution

Accepted Solutions
Not applicable
Author

Hi Michael S.

Thanks.

I got it to work with a Set Analysis and the concat-function as discribed in the thread:

http://community.qlik.com/media/p/72390.aspx

View solution in original post

11 Replies
Not applicable
Author

Hi,

Try this:

Add a field event trigger on YearWeek1. Add "Select In Field" Action. On field textbox put YearWeek2 and on the search string put =YearWeek1

This will mirror any selection from YearWeek1

Regards,

Not applicable
Author

Hi Ronald C.

I've tried that (in QV 9.0 SR1 and SR6), and it doesn't work - unfortunately.

(I didn't mention before, that the 2 fields aren't associated in the data model - because I guess that it makes no difference, as long as the selection in YearWeek1 doesn't conflict with the selection in YearWeek2 in a associated data model).

Any other suggestions?

I've tried to get a Set Analysis in the SearchString to work, but without any luck.

syed_muzammil
Partner - Creator II
Partner - Creator II

Hi,

Ronalds solution shud work. Try =GetFieldSelection(YearWeek1) instead of just =YearWeek1

Not applicable
Author

Thanks Shed!

Hmmm I'm using V9 SR2. our solution should work. I attached my test qvw here.

Not applicable
Author

Hi Syed.

I can get it to work with a OnSelect-Trigger on the YearWeek1 field - but only when only one value is selected in YearWeek1, and it's the same problem with the GetFieldSelections(YearWeek1) solution.

But the OnChange-trigger won't do the job.

From the QV-manual:

"OnChange
The action will be executed each time a selection has been
made in any field which is logically associated with the
specified field."

I guess the problem has to do with the output-format of the searchstring?

And to make it even worse - the solution should make a selection in YearWeek2 'mirroring' the possible (not selected) values of YearWeek1.

Not applicable
Author

Hi Ronald.

I've just had a look at your qvw - and it looks to mee as if it only works with one-value-selections, isn't that true?

syed_muzammil
Partner - Creator II
Partner - Creator II

Hi,

It wud be helpful if you attach an example.

Instead of mirroring the values of YearWeek1 in YearWeek2 you can use indirect set analysis in your expression where you want the YearWeek2.

Eg: Sum({1<YearWeek2=P(YearWeek1)>} Sales2).

Or

if both are not associated try a Date Island in which you will have both YearWeek1 and YearWeek2 .

Regards,

Syed.

Not applicable
Author

Hi Cap,

Do you really need the solution in OnChange Trigger?

And for the mirroring issue you can use this code to display "mirrored" values (but not selecting)


=if(match(YearWeek2,YearWeek1),YearWeek2)


Not applicable
Author

Hi Syed and Ronald.

Thanks for the effort.

The different suggestions didn't realy solve the problem, but someone mentioned this thread, that might do the trick - haven't tested it yet:

http://community.qlik.com/media/p/72390.aspx