Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
nkosinde13
Contributor

Sorting a pivot

Good day community

I have another challenge where I need to sort a pivot table using expressions. I know this works in a straight table and not a pivot. I've looked through the Qlikview pages and I cant seem to find any example that is easier to understand. So basically what I want is that a selection of a list box needs to sort the pivot table on expression. Currently the selection  shows and hides the table, meaning I have 5 different pivot tables that show and get hidden depending on the selection. So I want the same selection to also sort the table by expression when it gets displayed e.g. If  a user selects Budget Var %, the chart needs to sort by Budget Var % column either ascending or descending.  Also note that the expressions are Cyclic as well.

Please see the attached screenshot for details and any help is greatly appreciated.

Thanks

Matlotlo

Capture.PNG

4 Replies
Partner
Partner

Re: Sorting a pivot

in tab sort

biff expresion

 
nkosinde13
Contributor

Re: Sorting a pivot

Hi Florentina

Thank you for the quick response.

kindly note that I did put in the expression on Sort tab but it's not working. My expression is as follows and this is exactly what I put on sort tab: Or do you mean I should modify the expression  on sorting to something else? 

Sum({<$(eSetFYTD_CN)>}Amount) / $(ThouMenu)

/

(Sum(Budget) / $(ThouMenu))
 

Thanks 

Matlotlo

atoz1158
Contributor II

Re: Sorting a pivot

Hi

I found that I needed to wrap the Expression inside the AGGR() function using the dimensions of the Pivot table.

Give that a try.

Regards

Adrian

Support
Support

Re: Sorting a pivot

Matlotlo, did Adrian's post help you get things working as you wish?  If so, do not forget to come back and give credit by using the Accept as Solution button on the post and to let others know things did work.  If you still need further help, leave an update on where you are with things.

Here is a Help link that may be helpful in this case regarding the AGGR function Adrian mentioned, it may help you get the hang of things if you are still working on them:

https://help.qlik.com/en-US/qlikview/April2019/Subsystems/Client/Content/QV_QlikView/ChartFunctions/...

Regards,
Brett

To help users find verified answers, please don't forget to use the "Accept as Solution" button on any posts that helped you resolve your problem or question.