Pivot Table measure expression depending on the dimension selected
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:
Or a combination of them such as this one:
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.
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.
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?