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: 
vikasshana
Creator II
Creator II

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))

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
vikasshana
Creator II
Creator II
Author

Sorry Anil, I just edited my question

Anil_Babu_Samineni

Why 34 and 54 interchange?

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
vikasshana
Creator II
Creator II
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 II
Creator II
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))