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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
Nagaraju_KCS
Specialist III
Specialist III

Range Selection

Hi All,

I have developed one report, based on select ranges..

Here not showing Total Contribution %, I have to show Contribution % and Based on top selection.. it should be change the %

If I am clear range, it should be top5 records.

PFA,

Thanks in Advance..

Labels (1)
1 Solution

Accepted Solutions
sunny_talwar
MVP
MVP

Try this expression:

Num(1 -

Sum(Aggr(If(Rank(If(vMin='--Select--' or vMax='--Select--', Sum(LineSalesAmount),

  If(Sum(LineSalesAmount)>=$(vMin) and Sum(LineSalesAmount)<=$(vMax),

  Sum(LineSalesAmount)))) <= $(vTop),

  If(vMin='--Select--' or vMax='--Select--', Sum(LineSalesAmount),

  If(Sum(LineSalesAmount)>=$(vMin) and Sum(LineSalesAmount)<=$(vMax),

  Sum(LineSalesAmount)))), Category))/

Sum(Aggr(If(Rank(If(vMin='--Select--' or vMax='--Select--', Sum(LineSalesAmount),

  If(Sum(LineSalesAmount)>=$(vMin) and Sum(LineSalesAmount)<=$(vMax),

  Sum(LineSalesAmount)))) <= $(vTop),

  If(vMin='--Select--' or vMax='--Select--', Sum(OrderSalesAmount),

  If(Sum(LineSalesAmount)>=$(vMin) and Sum(LineSalesAmount)<=$(vMax),

  Sum(OrderSalesAmount)))), Category)), '#0.00%')

View solution in original post

5 Replies
sunny_talwar
MVP
MVP

I am not sure I follow your requirement. Can you elaborate?

sunny_talwar
MVP
MVP

Try this expression:

Num(1 -

Sum(Aggr(If(Rank(If(vMin='--Select--' or vMax='--Select--', Sum(LineSalesAmount),

  If(Sum(LineSalesAmount)>=$(vMin) and Sum(LineSalesAmount)<=$(vMax),

  Sum(LineSalesAmount)))) <= $(vTop),

  If(vMin='--Select--' or vMax='--Select--', Sum(LineSalesAmount),

  If(Sum(LineSalesAmount)>=$(vMin) and Sum(LineSalesAmount)<=$(vMax),

  Sum(LineSalesAmount)))), Category))/

Sum(Aggr(If(Rank(If(vMin='--Select--' or vMax='--Select--', Sum(LineSalesAmount),

  If(Sum(LineSalesAmount)>=$(vMin) and Sum(LineSalesAmount)<=$(vMax),

  Sum(LineSalesAmount)))) <= $(vTop),

  If(vMin='--Select--' or vMax='--Select--', Sum(OrderSalesAmount),

  If(Sum(LineSalesAmount)>=$(vMin) and Sum(LineSalesAmount)<=$(vMax),

  Sum(OrderSalesAmount)))), Category)), '#0.00%')

Nagaraju_KCS
Specialist III
Specialist III
Author

Thank you so much...

Actually in my real data  my dimension Calculated dimension

if i am use that dimension.

will it works???

sunny_talwar
MVP
MVP

Nope, try with both Product and Category without the if statement

UPDATE: If this doesn't work, then I propose calculating this if statement in the script and call it Dimension (maybe) and then use Dimension as your dimension and use that in the Aggr() function also

Nagaraju_KCS
Specialist III
Specialist III
Author

Thank you sunny..

It's really very helpful....