Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
vikasshana
Creator III
Creator III

Need help in dual function

Hi,

I've a pivot table like below in my Qlikview app.

   

TestServersum(sales1)Sum(Sales)
A1 50
2 90
3 100
B2360
3448
5456

   

I would like to sort the sum(sales) based on server dimension and I'm using below expression in the sort tab of the pivot table.

dual(Test='A',sum(sales))

And I'm getting the output as below.

   

   

TestServersum(sales1)Sum(Sales)
A3 100
2 90
1 50
B2360
3448
5456

Now my requirement is I would like to sort both the 'Tests(A and B)' and I'm trying the below expression and is giving me the error message saying it is not possible.

dual(Test='A',sum(sales),

dual(Test='B',sum(sales1))

I would like to see output as below,

   

   

TestServersum(sales1)Sum(Sales)
A3 100
2 90
1 50
B2360
5456
3448

Regards,

Vikas

7 Replies
Anil_Babu_Samineni

May be

dual(Test='A' or Test='B',sum(sales))

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
vikasshana
Creator III
Creator III
Author

Sorry Anil, I just edited my question

Anil_Babu_Samineni

Why 34 and 54 interchange?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
vikasshana
Creator III
Creator III
Author

I want that sorted based on the highest value, so that's why they got interchanged.

sunny_talwar

I see you have changed your requirement a little bit, so you don't want this any more?

Capture.PNG

Dimension

Test

=Aggr(Dual(Server, Sum(Sales)), Test, Server)

Expression

=If(Test = 'B', Sum(Sales))

=If(Test = 'A', Sum(Sales))

Sort tab

Make sure to sort numerically the second dimension by descending order

vikasshana
Creator III
Creator III
Author

No sunny, I'm using different expression sum(sales) and sum(sales1).

sunny_talwar

How does it matter....Changed the data to this

LOAD * INLINE [

    Test, Server, Sales, Sales1

    A, 1, 50

    A, 2, 90

    A, 3, 100

    B, 23, , 60

    B, 34, , 48

    B, 54, , 56

];

and use this

Dimension

Test

=Aggr(Dual(Server, Sum(Sales)+Sum(Sales1)), Test, Server)

Expression

=If(Test = 'B', Sum(Sales1))

=If(Test = 'A', Sum(Sales))