Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

rido1421
Contributor II

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
Honored Contributor II

Re: Creating Text box with max an min values

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)

5 Replies

Re: Creating Text box with max an min values

Try below

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

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


Regards

ASHFAQ

giakoum
Honored Contributor II

Re: Creating Text box with max an min values

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

rustyfishbones
Honored Contributor II

Re: Creating Text box with max an min values

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
Contributor II

Re: Creating Text box with max an min values

Thanks Asfaq ..

what about the value?

rido1421
Contributor II

Re: Creating Text box with max an min values

Thank you very much!

Community Browser