# QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Join us for a live Q&A! September 21, 10 AM ET - Onboarding Fast in Qlik Sense SaaS! REGISTER
cancel
Showing results for
Did you mean:
Not applicable

## Chart Sort Question

I would like to sort based on the current month's sales figures in descending order. I have both current and previous month's data.

Let' say I have the following data -

`Table:LOAD * INLINE [Customer, Month, Item, SalesKobe Bryant, 2010/5, Basketball, 25Kobe Bryant, 2010/5, Cap, 75Kobe Bryant, 2010/6, Shirt, 100Kobe Bryant, 2010/6, Basketball Shoes, 200Paul Pierce, 2010/5, Towel, 50Paul Pierce, 2010/5, Shorts, 200Paul Pierce, 2010/6, Basketall, 25Paul Pierce, 2010/6, Cap, 50Ray Allen, 2010/5 , Basketball, 25Ray Allen, 2010/5 , Golf Balls, 25Ray Allen, 2010/6 , Towel, 50Ray Allen, 2010/6 , Shirt, 100Pau Gasol, 2010/5 , Shirt, 100Pau Gasol, 2010/5 , Basketball, 250Pau Gasol, 2010/6 , Pants, 25Pau Gasol, 2010/6 , Shirt, 25];`

The sort should be based on the current month's sales data in descending order followed by it's previous month's data.

Desired results below -

`Customer Month Sales CurrMonthSales Rank-----------+-------+------+---------------+----+Kobe Bryant 2010/6 300 300 1Kobe Bryant 2010/5 100 300 1Ray Allen 2010/6 150 150 2Ray Allen 2010/5 50 150 2Paul Pierce 2010/6 75 75 3Paul Pierce 2010/5 250 75 3Pau Gasol 2010/6 50 50 4Pau Gasol 2010/5 350 50 4`

Tried using set analysis to get the current month sales and refer to that value per month but can't get the previous month row to line up with the current month's data ie. for Kobe Bryant, I can display CurrMonthSales = 300 for 2010/6 but not 2010/5. I would like to use this expression to create my sort order via ranking. I have attached a sample QVW and the expected result.

Thanks.

2 Replies
Not applicable
Author

Tried using set analysis to get the current month sales and refer to that value per month but can't get the previous month row to line up with the current month's data ie. for Kobe Bryant, I can display CurrMonthSales = 300 for 2010/6 but not 2010/5. I would like to use this expression to create my sort order via ranking. I have attached a sample QVW and the expected result.

Luminary Alumni

Anthony,

I almost got you your expected result. Let's see if somebody can work out the rank column or if I come up with something later. The set analysis I did should be replaced with something dynamic and you can use an if instead of set analysis, too.

Regards.

Community Browser