Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
Hi Michael S.
Thanks.
I got it to work with a Set Analysis and the concat-function as discribed in the thread:
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,
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.
Hi,
Ronalds solution shud work. Try =GetFieldSelection(YearWeek1) instead of just =YearWeek1
Thanks Shed!
Hmmm I'm using V9 SR2. our solution should work. I attached my test qvw here.
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.
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?
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.
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)
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: