Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
entsh
Contributor II
Contributor II

FirstSortedValue for each name

hi

Please see the below table

nameidnumberlevel
teh10A
teh20A
teh31A
teh41A
SO81A
SO91B
SO121C
teh151B
teh191B
SO201C
teh251B
SO261

C

 

I want the last level of each name (largest id)

I want this:

NAMERESULT
tehB
soC

 

so I use this formula

=firstsortedvalue(level, -id, 1) and its ok ! 

but i want to use variable! vll=firstsortedvalue(level, -id, 1) and this variable return C for both names and this is wrong answer!

please help me 🙂

 

1 Solution

Accepted Solutions
Or
MVP
MVP

I'd give it a whirl with using a string variable and evaluating it within the expression. No idea if that'd work, but that's my best bet.

firstsortedvalue(level, -id, 1)

with no equal sign (so it's a string, not a formula)

Then, =$(vLL) in your expression.

View solution in original post

6 Replies
Or
MVP
MVP

Using your formula on your data returned this...

Or_0-1616703593606.png

 

entsh
Contributor II
Contributor II
Author

YES but I used variable ! vLL=firstsortedvalue(level, -id, 1) and use a variable in expressions

it returns C for both names!

how can I use a variable instead of write a formula?

 

Or
MVP
MVP

No idea! If you'd asked that in the first place I would have left this for someone else to try and answer... (;

entsh
Contributor II
Contributor II
Author

I appreciate your attention 🙂

Or
MVP
MVP

I'd give it a whirl with using a string variable and evaluating it within the expression. No idea if that'd work, but that's my best bet.

firstsortedvalue(level, -id, 1)

with no equal sign (so it's a string, not a formula)

Then, =$(vLL) in your expression.

entsh
Contributor II
Contributor II
Author

THX A LOT 🙂