Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

pick a value from table


Hi all,

there is a table and i want specific row number to be picked in an expression after its sorted by a Column

ID     Qty

1     100

2     200

3      150

4     175

5     250

this table should be sorted by Qty ascending and i want to pick 3rd ranked Qty in expression value

which function i can use

thanks

Sukhwant

7 Replies
anbu1984
Master III
Master III

Try Min(Qty,3)

Load Min(Qty,3) Inline [

ID     ,Qty

1,100

2     ,200

3      ,150

4     ,175

5     ,250 ];

anbu1984
Master III
Master III

Using FirstSortedValue

Load FirstSortedValue(Qty,Qty,3) Inline [

ID     ,Qty

1,100

2     ,200

3      ,150

4     ,175

5     ,250 ];

Not applicable
Author

need this in an expression and not in Script. this 3 i will later declare as a vairable to make it flexible.

Also the challenge is in some cases QTY value is same

please advise a expression solution

anbu1984
Master III
Master III

You can use Min(Qty,3) in expression. This works even in case of duplicates

Update using variable

=Min(Qty1,$(vRnk))

Not applicable
Author

thanks

but i am creating a straight table and i have my dimension and expression as below:

ID     Qty

1     100

2     200    

3     150

4     175

5     250

but i added second expression with above formula and then the third column is not giving me any data

please advise

thanks


anbu1984
Master III
Master III

If you pick only 3rd rank, why did you use straight table? Can you provide expected output?

jagan
Luminary Alumni
Luminary Alumni

Hi,

Please find attached file for solution.

Regards,

Jagan.