Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us at Qlik Connect 2026 in Orlando, April 13–15: Register Here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Aditya_Chitale
Specialist
Specialist

Confusing behaviour of Alternate states

Hello All,

I am encountering a strange situation while using alternate states. I am using getfieldselections(ISBFlag) in my set analysis expression, I did bind my filters and KPI using an alternate state, so when selections are made in ISBFlag field, the values will get passed in set analysis expression only for that fixed KPI (which I configured to use the alternate state).

The issue I am facing is when I make selections, they are not getting passed in the KPI expression. Rather when I add only the getfieldselections(ISBFlag) part from previous KPI set expression into a separate KPI and configure this KPI with same AE, strangely the value is passed perfectly.

For eg, I select Non-ISB from ISBFlag field, but instead of Non-ISB, ISB value gets passed in Set expression

 

Selections:

Aditya_Chitale_0-1765272525497.png

 

Evaluated Expression:

Aditya_Chitale_1-1765272606195.png

Any help on this would be highly appreciated

 

Regards,

Aditya

Labels (3)
4 Replies
Or
MVP
MVP

Have you confirmed that the object and field are both in the default state? If not, have you tried specifically referencing the state using the GetFieldSelection() parameter, and/or using double-semicolon to pass it (if that works in QS, I forget, I know it was a thing in QV)?

Aditya_Chitale
Specialist
Specialist
Author

@Or , both the object and field are in the same state I have confirmed this several times. I also tried to pass getfieldselections() in double quotes.

I am not able to understand how to pass double semicolon for getfieldselections(). It would be very useful if you can help figure it out.

 

Regards,

Aditya

Or
MVP
MVP

If both objects are in the same state (and the expression as well) then you shouldn't have to pass anything, but if one of the lot isn't, you'll want to parameterize your GetFieldSelections() or try double-colon. 

GetFieldSelections ( field_name [, value_sep [, max_values [, state_name]]]) 

You'll want to set the fourth parameter to the appropriate state name here.

 

Double-colon is covered here, though it's outdated help (but I think it still works?) 

https://help.qlik.com/en-US/qlikview/May2023/Subsystems/Client/Content/QV_QlikView/Examples%20of%20A...

 

 

marcus_sommer

Alternate states refers to objects and not to fields. Therefore will the getfieldselections() without specifying a certain state - like hinted from @Or - referring to the default-state.

Simpler and more powerful would be to use p() and e() instead of getfieldselections() and to nest there the wanted state.