Qlik Community

Qlik Sense Documents

Qlik Sense documentation and resources.

Announcements
IMPORTANT security patches for GeoAnalytics Server available to download: READ DETAILS

Cyclic Groups in Qlik Sense

cancel
Showing results for 
Search instead for 
Did you mean: 
Patric_Nordstrom
Employee
Employee

Cyclic Groups in Qlik Sense

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)
Version history
Last update:
‎2020-11-20 03:40 AM
Updated by: