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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
ashis
Creator III
Creator III

Toggling cyclic group value from button

Hi All,

I am trying to create a cyclic group using 3 dimension , for example Dim A, Dim B and Dim C and giving a name to group Dynamic.

Is there any way i can toggle the value of the cyclic group using button. Like when i click on the button the value of Dynamic group would change from Dim A to Dim B then again on click it will change to Dim C.

is there any way to achieve it.

 

Thank you,

 

 

1 Solution

Accepted Solutions
mato32188
Specialist
Specialist

Hi Ashissau,
yes, it is.

  • create variable (i.e. vButton), assign default value to 1
  • create button with action - set variable, variable: vButton, value: =if($(vButton)=1,2,if($(vButton)=2,3,1))
  • create cyclic group (Edit groups) with 3 Used Fields and
    • =if($(vButton)=1,DIM A,if($(vButton)=2,DIM B,DIM C))
    • =if($(vButton)=1,DIM A,if($(vButton)=2,DIM B,DIM C))
    • =if($(vButton)=1,DIM A,if($(vButton)=2,DIM B,DIM C))

Press the button to see, how your cyclic dimension is being changed in chart, pivot table, etc.

BR

Martin

ECG line chart is the most important visualization in your life.

View solution in original post

4 Replies
Sloan258
Contributor
Contributor

jQuery also provides an animation method named .toggle() that toggles the visibility of elements kroger feedback.

mato32188
Specialist
Specialist

Hi Ashissau,
yes, it is.

  • create variable (i.e. vButton), assign default value to 1
  • create button with action - set variable, variable: vButton, value: =if($(vButton)=1,2,if($(vButton)=2,3,1))
  • create cyclic group (Edit groups) with 3 Used Fields and
    • =if($(vButton)=1,DIM A,if($(vButton)=2,DIM B,DIM C))
    • =if($(vButton)=1,DIM A,if($(vButton)=2,DIM B,DIM C))
    • =if($(vButton)=1,DIM A,if($(vButton)=2,DIM B,DIM C))

Press the button to see, how your cyclic dimension is being changed in chart, pivot table, etc.

BR

Martin

ECG line chart is the most important visualization in your life.
ashis
Creator III
Creator III
Author

Hi Martin, Thank you so much. your solution worked.

I removed the field names from cyclic group and only kept the following expression

  • =if($(vButton)=1,DIM A,if($(vButton)=2,DIM B,DIM C))

And with  the button the dimensions are changing. Thank you.

One thing , if i want to show the value of this Dimension in text box , how do i do it.

=GetCurrentField(groupname)  - this expression does not return value , it is returning above expression of cyclic group.

ashis
Creator III
Creator III
Author

I found a way to show this inside text box .

This same expression would do 

  • =if($(vButton)=1,DIM A,if($(vButton)=2,DIM B,DIM C))

Thanks again .