Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
vvvvvvizard
Partner - Specialist
Partner - Specialist

Sort by expression

I have a pivot table with two dimensions Region and Department and two expressions Sum(Actual) and Sum(Budget)

For the region i have them sorted by expression as region 1 , 2 , 3, admin ect

Now how do i sort the department within each region . I want to sort them by the smallest difference between expression 1 and two first

                                       actual  budget

eg region  1  depart10  100 99

                      depart 8    50 84

                      depart 3    2    100

   region 2       depart 5   80 100

                        depart 2  10  90

so the department with smallest difference between actual and budget must be first for each region .

Please assist

1 Solution

Accepted Solutions
hhajjali
Contributor III
Contributor III

Hello,

In sort parameters first put region, then department, then actual, then budget.

In department sort, set by expression, and in the expression :

[Budget]-[Actual].

Hope it help.

View solution in original post

2 Replies
hhajjali
Contributor III
Contributor III

Hello,

In sort parameters first put region, then department, then actual, then budget.

In department sort, set by expression, and in the expression :

[Budget]-[Actual].

Hope it help.

jonathandienst
Partner - Champion III
Partner - Champion III

Switch the sort for department to Expression (ascending) , and enter the difference expression - something like

=Sum(..... Actual) - Sum(..... Budget)

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein