Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to sort items based on spend and i need figures based on savings in the pie-chart

How to sort items based on spend and i need figures based on savings in the pie-chart.I want to sort only top 3 items and  this is my table


 

Item ID SpendSavings
1112012
1214014
139040
143016
1518018
166030
1711017
18408
1913025
2016010

So pie-chart answer should be like this                                          and NOT like this

Item ID      Savings                                                                 Item ID      Savings

15                18                                                                          13             40

20                10                                                                          16             30

12                14                                                                          19             25

Thanks in advance

Regards

Nagarjuna

31 Replies
Not applicable
Author

My Skype ID : nagarjuna000024@hotmail.com,

If you are free just send me the request we will discuss it. I will be available after one hr.

Thank you

Anonymous
Not applicable
Author

=if(

Aggr(Rank(Sum(Item ID)), Spend)<=3,

Savings,

'Others'

)

sunny_talwar

Unfortunately, I cannot... May be somebody else can offer assistance

Not applicable
Author

This is my sample data, if u get this correctly then probably works for me. Please do this favor

 

Item ID Spend Savings
511230001500
5112200004000
5112250003000
6113345602000
7889560004000
98876700006000
6113345204000
98871200001200
788930001000
51127500012000
7889100002000
9887140001400
61139876020000
34563456010000
611310000030000
78892000200
45624568908000
61132000100
5112600007000
3452234804000
9870180001800
9870260002000
3452350005000
61135000500
988712556

1234

Thanks in advance

Regards

Nagarjuna.

sunny_talwar

Is this the expected output?

Capture.PNG

Not applicable
Author

Thanks @ sunnny Talwar, now it works for me. I need one more favor , Can i sort only top 2 item? i.e not item 1 and item 2 . It should display only 2nd item based on spend. It should work without match function.

sunny_talwar

Hahahaha now it works? I did not change a single thing except using the new data. Expression stayed the exact same.

Try this for 2 items

Sum({<[Item ID] = {"=Rank(Sum(Spend)) < 3"}>}Savings)

Capture.PNG

Not applicable
Author

I did one mistake, now i understood what it is for the earlier one.Here i need only 4562 item and not 9887 , I have more columns like savings 1, savings 2 and etc for all items , here i want to use bar charts for one item ID , I want to 10 charts for 10 item IDs so wanna sort each item ID i.e Item 1,2,3, and etc is this possible? when i sort item IDs it should display based on spend only.

sunny_talwar

What is a point of pie chart with just one item? Anyways, try this

Sum({<[Item ID] = {"=Rank(Sum(Spend)) < 3 and Rank(Sum(Spend)) > 1"}>}Savings)

I have no idea what you mean here:

I have more columns like savings 1, savings 2 and etc for all items , here i want to use bar charts for one item ID , I want to 10 charts for 10 item IDs so wanna sort each item ID i.e Item 1,2,3, and etc is this possible? when i sort item IDs it should display based on spend only.

Can you share a sample and also please provide the desired output from the same provided

Anonymous
Not applicable
Author

Dear Nagarjuna Vattikuti

fine the attach file and pay attention to Dimension Limits tab and sort tab