Cyclic Dimension in Qliksense
I am going to Share My knowledge, How to create Cyclic Dimension in Qliksense. We can Create Cyclic Dimension in Qliksense Using QsVariable Extension and without Extension also there is a way. In this Blog I am going to discuss both ways.
Cyclic Dimension by using Filter Pane
To see the New Visitors by Date, Year, Quarter and Month need to follow the below steps.
Step 1:
Create one inline table in script for Cyclic Dimension after your data load based on which fields do you want to create as Cyclic Group like below:
Cyclic_Table:
load * inline [
Cyclic_dimension
Date
Year
Quarter
Month
];
Step 2:
Load the data and go to app overview and create chart by taking
Dimension:
=$(=if(GetSelectedCount(Cyclic_dimension)=0,'Date',Only(Cyclic_dimension)))
Measure:
Sum([New Visitors])
Step 3:
if(Cyclic_dimension='Year',2,
if(Cyclic_dimension='Quarter',3,
if(Cyclic_dimension='Month',4))))
Step 4:
To Change the Chart Title based on Field Name selection in the Filter Pane use below Expression
Go to Chart Properties > Appearance > General > Show Titles-On> Title
='New Visitors by '&' '&if(GetSelectedCount(Cyclic_dimension )=0,'Date',
if(Only(Cyclic_dimension )='Year','Year',
if(Only(Cyclic_dimension )='Quarter','Quarter',
if(Only(Cyclic_dimension )='Month','Month'
))))
Cyclic Dimension by using QsVariable Extension:
To see the New Visitors by Date, Year, Quarter and Month using QsVariable extension need to follow the below steps.
Step 1:
Download and install the QsVariable extension from Qlik Branch.
Desktop Users Copy and Paste the Extension under below folders:
Step 2:
Create a Variable named vDimension in the variable editor and assign the default dimension i.e., Date as first dimension in the button and click on save.
Step 3:
Drag and Drop QS Variable extension named Variable into sheet and select Created variable named vDimension from the Drop down and select Show as Button, Style as Qlik.
Step 4:
Then go to values section assign each dimension by clicking on Add Alternative between single colon ('Date').without single colon it won’t work. Give the labels as your wish.
Step 5:
Now Drag and drop chart into Sheet. Under Dimension add created variable =$(vDimension) and assign the label as =vDimension for dynamic labels like below
Step 6: Under Measure add Sum ([New Visitors])
Step 7: Now for Dynamic Titles go to General > Click on Title > enter this expression> ='$(vDimension)' &'-'& 'New Visitors'
Now by clicking on each Buttons the corresponding dimension related Trend will be visible in the Chart.
Cyclic Dimension by using Filter Pane
To see the New Visitors by Date, Year, Quarter and Month need to follow the below steps.
Step 1:
Create one inline table in script for Cyclic Dimension after your data load based on which fields do you want to create as Cyclic Group like below:
Cyclic_Table:
load * inline [
Cyclic_dimension
Date
Year
Quarter
Month
];
Step 2:
Load the data and go to app overview and create chart by taking
Dimension:
=$(=if(GetSelectedCount(Cyclic_dimension)=0,'Date',Only(Cyclic_dimension)))
Measure:
Sum([New Visitors])
Step 3:
Take Cyclic_dimension field in Filter Pane. To sort the Order of Fields use below Sort Expression at Filter Pane Properties. Go to Sorting > Custom > Sort by expression
=if(Cyclic_dimension='Date',1,if(Cyclic_dimension='Year',2,
if(Cyclic_dimension='Quarter',3,
if(Cyclic_dimension='Month',4))))
Step 4:
To Change the Chart Title based on Field Name selection in the Filter Pane use below Expression
Go to Chart Properties > Appearance > General > Show Titles-On> Title
='New Visitors by '&' '&if(GetSelectedCount(Cyclic_dimension )=0,'Date',
if(Only(Cyclic_dimension )='Year','Year',
if(Only(Cyclic_dimension )='Quarter','Quarter',
if(Only(Cyclic_dimension )='Month','Month'
))))
Cyclic Dimension by using QsVariable Extension:
To see the New Visitors by Date, Year, Quarter and Month using QsVariable extension need to follow the below steps.
Step 1:
Download and install the QsVariable extension from Qlik Branch.
Desktop Users Copy and Paste the Extension under below folders:
- C:\Users\bsbi\Documents\Qlik\Examples\Extensions
- C:\Users\bsbi\Documents\Qlik\Sense\Extensions\Templates
Step 2:
Create a Variable named vDimension in the variable editor and assign the default dimension i.e., Date as first dimension in the button and click on save.
Step 3:
Drag and Drop QS Variable extension named Variable into sheet and select Created variable named vDimension from the Drop down and select Show as Button, Style as Qlik.
Step 4:
Then go to values section assign each dimension by clicking on Add Alternative between single colon ('Date').without single colon it won’t work. Give the labels as your wish.
Step 5:
Now Drag and drop chart into Sheet. Under Dimension add created variable =$(vDimension) and assign the label as =vDimension for dynamic labels like below
Step 6: Under Measure add Sum ([New Visitors])
Step 7: Now for Dynamic Titles go to General > Click on Title > enter this expression> ='$(vDimension)' &'-'& 'New Visitors'
Now by clicking on each Buttons the corresponding dimension related Trend will be visible in the Chart.