Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi ALL,
How can i use alternate state with getfieldselections? Please post an example or expression.
Hi,
Try like this
=Concat({[AlternateStateName]}DimensionName)
Regards,
Jagan.
Thanks for the reply Jagan. But right now this is showing all the values from that dimesnion concatenated and i just want to get only that value from the dimension which is selected.
How can i do that?
see link http://dailyqv.blogspot.in/2013_05_01_archive.html
Functions which won't support Alternative states and its work around
Functions which basically operate on current selection state like
GetFieldSelections, GetPossibleCount will not take parameter as Alternative states.
some thing like GetFieldSelections(<State1> Field1) is not possible in Qlikview 11.
Instead we can use general functions like Maxstring, Concat, Count functions.
For example if we want to know selection made in a field which has an alternative state and have 'Allways one selection'.
In this case for accessing the selection made in that field we can use.
maxstring({[State1]} [Field1]).
If allways one selections is disabled and for getting all selections we can use.
=concat({[State1]} distinct [Field1],'|')
For getting Selection count we can use.
=count({[State1]} distinct [Field1])
But the Maxstring is giving me the maximum value only, i want the currently selected field.
Hi,
Can you come up with an example? It helps in understanding the scenario.
Regards,
Jagan.
Thank you for this. I used the "maxstring" function for the very same purpose and it's ok.
Regards,
Excellent! Thank you.
Just an update:
Since 11.20 SR8, these functions accept a third argument to define the state:
1.4.3 Alternate state parameter for certain functions
New parameter added to the functions “GetSelectedCount()”, “GetFieldSelections()” and
“GetCurrentSelections()” to query other states than the main state.
E.g. =GetFieldSelections(Quantity, ';', ,'StateA')
Oh Wow! Thanks for this. Much appreciated.