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

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Previously selected cyclic group value

Hi All,

In the context of cyclic group, we can find out the current selected group value through "GetCurrentField(cyRegion)" .

But Is there any way to find out previously selected group value?

4 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

There's no getpreviousfield() function. I think the only way is to use bookmarks with the option Include Layout State enabled.

Another thing you can try is create a table in the script with a field that contains the fieldnames you now use in the group. You can use the listbox to select a fieldname and use that value as dimension name for your chart. Now you can get the previous selection with =only({$1}Field). See attached example.


talk is cheap, supply exceeds demand
Not applicable
Author

Hi Gysbert,

I am storing the Current value in Variable1 by using below expression:

Variable1

=MinString

(

     If(GetCurrentField(cyRegion)='VCC',VCC_CUR,

        If(GetCurrentField(cyRegion)='COMP2',COMP2_CUR

  ))

)

Variable1 changes at every selection.

Now I want to store the previously calculated value in Variable 2.

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

The answer is pretty much the same. Either use bookmarks and enable to option to include variable values in the bookmark or use a field like I did in my example.


talk is cheap, supply exceeds demand
Not applicable
Author

That means I have to apply the trigger on Change Event of variable 'Variable1' to add bookmark and extract the previous value using bookmark name.