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

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Using Rank function...

Hi All,

I have sample data, I want analyze the top second sales and top sales with top most product.

Dev01:
LOAD * Inline [
Year,Sales,P_ID
2010,100,01
2010,200,02
2010,300,03
2010,400,04
2010,500,05
2012,1000,01
2012,2000,02
2012,3000,03
2012,4000,04
2012,5000,05
2013,1100,01
2013,1200,02
2013,1300,03
2013,1400,04
2013,1500,05
2014,10,01
2014,20,02
30
];

I try to this expression but not exact reply.

Aggr(IF(Rank(sum(Sales),2)<=2,Sum(Sales)),P_ID),

I am expect like this Year =2012, 2013 with sum of sales P_Id is 03, 04, 05 for both year.

Rregards,

Raja.

6 Replies
tresesco
MVP
MVP

Not very clear. Could you explain a bit more?

Not applicable
Author

Hi Tresesco,

Above script reference,

I looking like (using rank function), top(first,second) of the sales year and that particular year which product obtain more sales,

For Ex,

Year = 2012, 2013

Year 2012:

Year,Sales,P_ID

2012,3000,03

2012,4000,04

2012,5000,05

like 2012 Year Sum(15000) .

Year,Sales,P_ID

2013,1300,03

2013,1400,04

2013,1500,05

2013 Year Sum of Sales(4200).


Regards,

Raja.

jagan
Partner - Champion III
Partner - Champion III

Hi,

Use Dimension Limits for doing this, very simpler one, please find attachment for solution.

Regards,

Jagan.

Not applicable
Author

Hi Jagan,


Thanks Jangan , prompt your replay,

I make sure  the Pivot table.

Not applicable
Author

Hi Jana,

I am trying Pivot Table with Rank Function.

Regards,

Raja.

jagan
Partner - Champion III
Partner - Champion III

Hi,

Please find attached file for solution.

Regards,

Jagan.