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

Alternate states with getfieldselections

Hi ALL,

How can i use alternate state with getfieldselections? Please post an example or expression.

14 Replies
jagan
Luminary Alumni
Luminary Alumni

Hi,

Try like this

=Concat({[AlternateStateName]}DimensionName)

Regards,

Jagan.

Not applicable
Author

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?

Not applicable
Author

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])

Not applicable
Author

But the Maxstring is giving me the maximum value only, i want the currently selected field.

jagan
Luminary Alumni
Luminary Alumni

Hi,

Can you come up with an example?  It helps in understanding the scenario.

Regards,

Jagan.

murozel76
Contributor III
Contributor III

Thank you for this. I used the "maxstring" function for the very same purpose and it's ok.

Regards,

Anonymous
Not applicable
Author

Excellent! Thank you.

swuehl
MVP
MVP

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')

Anonymous
Not applicable
Author

Oh Wow! Thanks for this. Much appreciated.