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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
rido1421
Creator III
Creator III

Creating Text box with max an min values

Hi All

I would like to create 4 text boxes

in each text box I would like to individually Rank them  according to the sum of the sales value using a dimension Category

I would need to display the name of the category in one text box overlaying the text box with the sum.

how can I achieve this...

Fields are Category, Value

Ive used the below to get the name of the highest category... but how would i get the 2nd highest... etc

FIRSTSORTEDVALUE (Category,-Aggr(sum(Value),Category))

ive used this to get the highest number 

it seems to be working... but how would i get the 2nd highest etc ...

Max (Aggr(sum(Value),Category))

Appreciate your assistance

1 Solution

Accepted Solutions
rustyfishbones
Master II
Master II

Try the following

Object1

FIRSTSORTEDVALUE (Category,-Aggr(sum(Value),Category)) & CHR(13) &

Max (Aggr(sum(Value),Category))


Object2

FIRSTSORTEDVALUE (Category,-Aggr(sum(Value),Category),2) & CHR(13) &

Max (Aggr(sum(Value),Category),2)


Object3

FIRSTSORTEDVALUE (Category,-Aggr(sum(Value),Category),3) & CHR(13) &

Max (Aggr(sum(Value),Category),3)


Object4

FIRSTSORTEDVALUE (Category,-Aggr(sum(Value),Category),4) & CHR(13) &

Max (Aggr(sum(Value),Category),4)

View solution in original post

5 Replies
ashfaq_haseeb
Champion III
Champion III

Try below

FIRSTSORTEDVALUE (Category,-Aggr(sum(Value),Category),2)

FIRSTSORTEDVALUE (Category,-Aggr(sum(Value),Category),3)


Regards

ASHFAQ

giakoum
Partner - Master II
Partner - Master II

Why not just using a chart? Same result, more elegant way.

rustyfishbones
Master II
Master II

Try the following

Object1

FIRSTSORTEDVALUE (Category,-Aggr(sum(Value),Category)) & CHR(13) &

Max (Aggr(sum(Value),Category))


Object2

FIRSTSORTEDVALUE (Category,-Aggr(sum(Value),Category),2) & CHR(13) &

Max (Aggr(sum(Value),Category),2)


Object3

FIRSTSORTEDVALUE (Category,-Aggr(sum(Value),Category),3) & CHR(13) &

Max (Aggr(sum(Value),Category),3)


Object4

FIRSTSORTEDVALUE (Category,-Aggr(sum(Value),Category),4) & CHR(13) &

Max (Aggr(sum(Value),Category),4)

rido1421
Creator III
Creator III
Author

Thanks Asfaq ..

what about the value?

rido1421
Creator III
Creator III
Author

Thank you very much!