Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a strange behaviour of the GetfieldSelection function.
I have a field loaded into the script with AUTOGENERATE :
Annee_Test:
LOAD
$(vAnneeMin) + rowno()-1 as _Annee_Test
AUTOGENERATE $(vAnneeMax) - $(vAnneeMin) + 1;
In the application , i added a trigger onselect on the field _Annee_test and define a variable vAnneeTest: =GetFieldSelections(_Annee_Test)
Than i have a listbox with _Annee_Test and when i display the variable vAnneeTest it takes the value of _Annee_Test but when i choose the max year or the max year-1 it stuck on the last selected value:
Weird indeed. Perhaps you have competing triggers? At this point I don't really know what else to suggest... maybe try with a new variable / new name for the field and see if that fixes it.
I had a bit of trouble following along:
1) Your field appears to be Annee_Test, not _Annee_Test (with a leading underscore)
2) Why did you add a trigger? What does the trigger do?
1 ) it's _Annee_Test ? I just change the label in the listbox
2) I added a trigger on select to get the value of _Annee_Test into the variable vAnneeTest (Same result if i just declare the variable as =getfieldSlections(_Annee_Test)
1) OK - obviously, there was no way to know that based on the image, so had to make sure that wasn't the issue
2) I'm not sure why you're doing it with a trigger instead of using a regular variable. OnSelect triggers are known to be somewhat wonky, particularly in the ajax client (for example, https://community.qlik.com/t5/QlikView-App-Dev/Onselect-Trigger-not-firing-when-selected-through-a-b... ) - are you able to use OnChange instead? If so, does that work as expected?
same thing with OnChange
I've attempted to test this locally and it works fine on my end, no matter which selections I make (QV 12.5 SR3).
You could try using a value of =_Annee_Test (instead of GetFieldSelections) and see if that works - obviously it'll only work for one year but it's worth testing out. You could also try with Concat(distinct Year,';').
I've attempted to test this locally and it works fine on my end, no matter which selections I make (QV 12.5 SR3).
You could try using a value of =_Annee_Test (instead of GetFieldSelections) and see if that works - obviously it'll only work for one year but it's worth testing out. You could also try with Concat(distinct Year,';').
it is really weird . I also do the same thing in a separate application and it works.
But still not working in the other application , i also tried the web view and same thing
Weird indeed. Perhaps you have competing triggers? At this point I don't really know what else to suggest... maybe try with a new variable / new name for the field and see if that fixes it.
i create a new variable with the same configuration and it works 🙂