Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have a pivot table where i am trying to sort my columns (dimensions) either ascending or descending order dynamically. For this i have two buttons that return a boolean (vSort) : -1 if you click on descending or 1 if you click on ascending. In my pivot table , in "Sorting" then I "Sort by expression:" =if($(vSort) = 1, Count([Number]),-Count([Number])) where Count([Number]) is my Measure in the pivot table.
The problem is that the sorting only applies to the first dimension of the table and I am trying to apply it to all dimensions. Do you have an idea how to do it?
Thanks.
To apply dynamic sorting to all dimensions in pivot table, you can use a combination of the Aggr function and sorting expressions for each dimensions.
let's say you have 3 dimensions, dim1, dim2 and dim3.
based on your sorting expression you can do this:-
for Dimension1:
>go to the soring setting for Dim1
>Select "Sort by Expression"
>Enter the sorting expression: =Aggr(If($(vSort) = 1, Count([Number]), -Count([Number])), Dim1)
for Dimension2:
>go to the soring setting for Dim2
>Select "Sort by Expression"
>Enter the sorting expression: =Aggr(If($(vSort) = 1, Count([Number]), -Count([Number])), Dim2)
and so on.
I hope this will help you.
Hi @Thathayoyo
Dont know if the dimensionality might work for this. Perhaps give it a try.
Regards Jandre
Mark the solution as accepted that solved your problem and if you found it useful, press the like button! Check out my YouTube Channel | Follow me on LinkedIn