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: 
Not applicable

rank()

hi, i have script as follows

tab1:

load * Inline [

MANUFACTURER_LDESC,CATEGORY_LDESC,sales

sonata,ACC,50000

lonad,CHEESE CAKE,100000

lonad,ACC,5000000

];

in chart with manufacturer_ldesc as dimension and following as expression;

 

=

sum({1<MANUFACTURER_LDESC={"=rank(sum({1<CATEGORY_LDESC={'ACC'}>}sales),4)<=2"}>}sales)

then i got  2 bars in a chart

1 is lonad with 5100000   and other is

sonata with 50000

lonad must be 5000000 right as i filtered out category of 'ACC'.

pls tell me y it is happening !

@jagan,

@hic

Labels (1)
1 Solution

Accepted Solutions
swuehl
Champion III
Champion III

You only filtered the rank:

sum({1<MANUFACTURER_LDESC={"=rank(sum({1<CATEGORY_LDESC={'ACC'}>}sales),4)<=2"}, CATEGORY_LDESC={'ACC'} >}sales)

View solution in original post

4 Replies
swuehl
Champion III
Champion III

You only filtered the rank:

sum({1<MANUFACTURER_LDESC={"=rank(sum({1<CATEGORY_LDESC={'ACC'}>}sales),4)<=2"}, CATEGORY_LDESC={'ACC'} >}sales)

MayilVahanan
MVP
MVP

Hi Prudhvi,

Try like this

=sum({<MANUFACTURER_LDESC={"=rank(sum({1<CATEGORY_LDESC={'ACC'}>}sales),4)<=2"}>}sales)

In your expression,

sum({1<MANUFACTURER_LDESC={"=rank(sum({1<CATEGORY_LDESC={'ACC'}>}sales),4)<=2"}>}sales)


1 restrict the selections

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
sunilkumarqv
Specialist II
Specialist II

since you have same name across MANUFACTURER_LDESC as lonad were you used dimension

try below  that gives desired result

Expression

Sum({1<CATEGORY_LDESC=P({<CATEGORY_LDESC={'ACC'}>})>}sales)

Use Dimension limits  show largest value 2

Not applicable
Author

if under acc category, there are other manufacturers, all those will b summed up as others this is againist requirement

Ex:

tab1:

load * Inline [
MANUFACTURER_LDESC,CATEGORY_LDESC,sales
sonata,ACC,50000
lonad,CHEESE CAKE,10
lonad,ACC,5000000
lonafd,ACC,5000
]
;

then lonad,ACC,5000000 will b shown in 1 bar n there will b others bar wth value 55000