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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
HAMID_AKBARI
Contributor III
Contributor III

group data by max of one column

I need to expression in a table which group rows by max of a column.

The result need to show the latest "Description" which is filled in the biggest "stage".

Sample.jpg

Thank you Q cmmunity

Labels (2)
4 Replies
Pierrick
Partner - Contributor III
Partner - Contributor III

Hello @HAMID_AKBARI,

You can do a table with ID like a dimension, and measure : FirstSortedValue(Description,-Stage)

FirstSortedValue is a function that allows you to retrieve the first value of a column according to a certain sort order.

Have a good day !

Chanty4u
MVP
MVP

Try this 

 

FirstSortedValue(Description, -Stage)

 

Or 

 

FirstSortedValue(DISTINCT Description, -Stage)

 

Or 

 

FirstSortedValue(Description, -

Stage, 1)

 

HAMID_AKBARI
Contributor III
Contributor III
Author

It dosent work,in fact the data contains one work order to many childs(stage).

in every stage there is User,Date,and Description ...

now i want to see the final status of the table which contain last User,Date and desciption,,,also ther is a Delay duration that calculate time between every data registerd.

thank you

AndrzejD
Partner - Contributor
Partner - Contributor

for example:
data:
load
ID,
FirstSortedValue( Description, -Stage ) as Description
group by ID
;
load * Inline [
ID, Stage, Description
1014, 1, Text1
1014, 2, Text2
..
Andrzej