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

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
yacine
Contributor II
Contributor II

variable is not getting the firstsortedvalue

I want to get the value (string) of column 1 (GJ__)  that corresponds to the maximum value (integer) of column 2 (Jahr__)

i tried using firstsortedvalue() in this way:

let aktuellesjahr = firstsortedvalue( GJ_, -[Jahr__]);

table1: load
GJ_,
if(GJ_ = '$(aktuellesjahr)' ,'yes', 'no') as "current year",

...

this doesn't seem to be working. Theres surely somthing wrong in it but i could find it out. Thank you in advance.

Labels (5)
1 Reply
vikasmahajan

try this

FirstSortedValue((GJ__) ,-aggr(Sum((Jahr__)),(GJ__) ),1)

 

Vikas

Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.