Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
RickyLam
Contributor III
Contributor III

Pivot Table measure expression depending on the dimension selected

Hi all,

I have a pivot table, whose measure is daily average sales, with several time frame related dimensions such as "Yearly", "Quarterly", "Monthly", "Weekly" and "Daily" as selectable column dimensions. The visibility of these column dimensions are user-configurable, which means users can make any one of them appears in the pivot table such as this: 

RickyLam_0-1690871134319.png

Or a combination of them such as this one:

RickyLam_1-1690871270602.png

That means the dimensionality of the pivotable column is not fixed. 

Now my question is, the measure expression for daily average sales is different for each time-frame based dimension. How can I modify the measure expression to take into account of which dimension is actually present in the column of the pivot table? Thanks very much of your advice in advance. 

 

 

 

Labels (2)
2 Replies
Lisa_Sun
Support
Support

You can use this as an example to allow the users to select their pivot table dimensions.  This will be in the controlled.  So basically, you use the variable to decide the dynamic dimensions. Then in the measure expression, you can use if statement for the calculation based on the variable's selected value. 

Pivot table dynamic change in dimensions - Qlik Community - 1735895

Help users find answers! Don't forget to mark a solution that worked for you! If already marked, give it a thumbs up!
RickyLam
Contributor III
Contributor III
Author

Thanks for your response but I am afraid you have got my issue wrong. 

In my Qlik Sense app, all dimensions are already user-configurable in the same way that you have mentioned in your response. 

My question is, the expression of the same pivot-table measure, Dally Average Sales, is different according the the dimension the user selected. One of the possible workarounds is create a  separate pivot table for each dimension, i.e one pviot table for weekly daily average sales, an another one for monthly average sales. I DON'T want that.  I just want one single pivot table to do the job. So how can I modify the measure expression so that the expression can change according to what the pivot table dimension is selected?