Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Firstsortedvalue

=FirstSortedValue( Aggr(Concat(DISTINCT EmployeeID, ','),YearlyIncome),-Aggr(YearlyIncome,YearlyIncome))


how to write this expression in script level

1 Solution

Accepted Solutions
Anil_Babu_Samineni

May be this?

Table:

Load EmploeeID,

          YearlyIncome FROM Table;

NoConcatenate

Table1:

Load Concat(EmployeeID, ',') as EmployeeID, YearIncome Resident Table Group By YearIncome;

Left Join (Table1)

Load EmployeeID, YearIncome, FirstSortedValue(EmployeeID, -YearIncome) as FirstValue Resident Table1 Group By YearIncome;

Drop Table Table;

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful

View solution in original post

7 Replies
Anil_Babu_Samineni

May be this?

Table:

Load EmploeeID,

          YearlyIncome FROM Table;

NoConcatenate

Table1:

Load Concat(EmployeeID, ',') as EmployeeID, YearIncome Resident Table Group By YearIncome;

Left Join (Table1)

Load EmployeeID, YearIncome, FirstSortedValue(EmployeeID, -YearIncome) as FirstValue Resident Table1 Group By YearIncome;

Drop Table Table;

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
tresesco
MVP
MVP

May be like:

t1:

load

     Concat(DISTINCT EmployeeID, ',') as NewField

From <> Group BY YearlyIncome;

t2:

Load

     FirstSortedValue(NewField,-YearlyIncome) as NewFinal

resident t1 ; //Group By YearlyIncome;

    

Anonymous
Not applicable
Author

it's not working

tresesco
MVP
MVP

Ashok chowdary wrote:

it's not working

'not working' and yet you mark it as 'correct'. Both can't be right. If you have marked it by mistake, you can unmark it so that you keep getting attention of people want to help. If 'working', you can edit and remove 'not' to remove confusion.

And if 'not working' is the actual status, please explain what,how.. it is not working. Perhaps a sample data set and expected output could help us better understand and better help you in turn.

Anil_Babu_Samineni

Then why you mark it as Correct answer. Does this useful or not atlast. Not sure, Your intend here. Perhaps provide more details with same data set that may demonstrates the output..

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anonymous
Not applicable
Author

Invalid expression

left join(Temp)

Load  newone, Date, FirstSortedValue(newone,-Date) as FirstValue Resident Temp Group By Date

Anil_Babu_Samineni

Can you provide sample data

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful