Skip to main content
Announcements
NEW Customer Portal: Initial launch will improve how you submit Support Cases. FIND OUT MORE

Cyclic Groups in Qlik Sense

100% helpful (3/3)
cancel
Showing results for 
Search instead for 
Did you mean: 
Patric_Nordstrom
Employee
Employee

Cyclic Groups in Qlik Sense

Last Update:

Nov 20, 2020 3:40:05 AM

Updated By:

Patric_Nordstrom

Created date:

Nov 20, 2020 3:31:37 AM

Attachments

This doc and app shows a workaround how to make cyclic groups for dimensions and measures. Qlik Sense 2018 November or later is required. The workaround is based on a variable and the button. The solution is not self service but no extensions or add-ons are required and using master items simplifies the usage.

Cyclic Dimension Group

  1. Add a variable vDimension and set it to Year.
  2. Add a button, set the label to =vDimension and add an set variable action for vDimension to toggle the dimensions:
    =pick(match(vDimension,'Year','Quarter','Month'),'Quarter','Month','Year')

Write dimension dependent expressions using vDimension (instead of GetCurrentField), ex:
=Sum(Sales)/ Sum(Total Aggr(Sum(Sales), $(=vDimension)))

For convenience, add master dimension CyclicDimension =$(vDimension) set to label =vDimension and make the button a master visualization.

Cyclic Measure Group 

  1. Add a variable vButton and set it to Sales
  2. Add a button set the label to vButton and add a set variable action for vButton to toggle the measures:
    =pick(match(vButton,'Sales','Orders','COS'),'Orders','COS','Sales')
  3. Add a variable vMeasure and set it to hold the measure expressions:
    =pick(match(vButton,'Sales','Orders','COS'),'sum(Sales)','count(OrderID)','sum(COS)')

For convenience, add master measure CyclicMeasure =$(vMeasure) set to label =vMeasure and make the button a master visualization.

 

allcyclic.gif

 

This technique has been mentioned before in: 
Top-10-Viz-tricks-Qonnections-2019
Top-10-Viz-tricks-Part-2

There are several proposals for cyclic groups, thanks for the inspiration:

Juraj Misina, https://dataqlues.com/getobjectfield-function-and-alternate-dimensions/

 

 

Labels (2)
Comments
RoryMcHugh-Catalyst
Partner - Contributor III
Partner - Contributor III

Thanks for posting this workaround, really useful 😄

It would be great if this could be a feature that's just built in, rather than a workaround. Do you know if it's on the list to be added?

 

cotiso_hanganu
Partner - Creator III
Partner - Creator III

We are using for 10 years an equivalent approach, improved  even more after we discovered the Instant App from Steve Dark: https://www.quickintelligence.co.uk/instant-qlik-sense-application/

PS:Agree with Rory... (despite all the love I have for Patric) 
It should have been already built in !
(It was in Qlikview, 20 years ago...)

PPS: At least we will be able soon to edit fonts and font colors without fighting with css... 

marksouzacosta
Partner - Specialist
Partner - Specialist

Cyclic Groups are now officially available in Qlik Sense:

https://youtu.be/1JsUNJwFxAs?si=_nKW5ih-BGeTGlEA

agigliotti
Partner - Champion
Partner - Champion

Hi,

With the new Cyclic dimension is there a way to get the current dimension name?

rzenere_avvale
Partner - Specialist II
Partner - Specialist II

Hey there @agigliotti ,
You should be able to use the function GroupDimensionLabel() to know the dimension currently used, or GroupDimensionIndex() to know the index of the dimension currently used.
You can find more in Patric's pdf here: Qlik Sense May 2024 What's new Viz 

Riccardo

agigliotti
Partner - Champion
Partner - Champion

Hi @rzenere_avvale ,

Thanks for your input, I just tried GroupDimensionLabel function but it doesn't works as expected, it returns null.

rzenere_avvale
Partner - Specialist II
Partner - Specialist II

Hi @agigliotti ,
Where are you trying the function? QS May 2024 Technical Preview (where cyclic groups are not fully implemented) or Qlik SaaS?
On Qlik SaaS you should be able to use it without issues

rzenere_avvale_0-1715337228110.png

Riccardo

 

agigliotti
Partner - Champion
Partner - Champion

Hi @rzenere_avvale ,

I'm trying to use it in a label button in Qlik Sense SaaS.

marksouzacosta
Partner - Specialist
Partner - Specialist

@agigliotti ,

I answer this question on the topic below. Check if it helps you, please:
Solved: Re: Cycling Dim Label - Qlik Community - 2450510

agigliotti
Partner - Champion
Partner - Champion

HI@marksouzacosta ,
Yes it's working fine, i was using the action label rather than the button label.

Version history
Last update:
‎2020-11-20 03:40 AM
Updated by: