Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
ramrongala
Contributor II
Contributor II

how to show bottom 2 sales(to avoid zero sales )

HI Experts,

I want show Bottom 2 Sales but it shoes Zero sales(in table Zero sales also there).

So need to avoid zero sales and display the bottom 2 values expect zero sales.

expression used : sum({<Produ_name = {"=Rank(-sum(Sales))<=2"}>}Sales)

Data and display highlighted ones (bottom 2)

ramrongala_1-1601576231157.png

at present it showing like below

ramrongala_2-1601576500779.png

 

Please help me to resolve this issue ASAP

1 Solution

Accepted Solutions
sunny_talwar

@ramrongala it gets a little complicated, but you can do this as your calculated dimension

=Aggr(If(Rank(If(Sum(Sales) = 0, -10000000, -sum({<Sales -= {"0"}>}Sales))) <= 2, Produ_name), Produ_name)

and your expression will just be Sum(Sales)

View solution in original post

4 Replies
sunny_talwar

@ramrongala  try this

=sum({<Produ_name = {"=Rank(-sum({<Sales -= {[0]}>}Sales))<=2"}>}Sales)
ramrongala
Contributor II
Contributor II
Author

Hi Sunny,

Thank you for quick reply 

its working as measure but i need as dimension (need to show bottom 2 products )

need to restrict the bottom-2 products in dimension level.

because based on the bottom-2 products need to add measures(sales,growth,growth%).

i hope u understand my problem.

sunny_talwar

@ramrongala it gets a little complicated, but you can do this as your calculated dimension

=Aggr(If(Rank(If(Sum(Sales) = 0, -10000000, -sum({<Sales -= {"0"}>}Sales))) <= 2, Produ_name), Produ_name)

and your expression will just be Sum(Sales)

ramrongala
Contributor II
Contributor II
Author

Thank you very much sunny ...