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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
ttal7878
Creator
Creator

How to show max value row in straight table

Hi,

In case there is a sale with the same orderID and Unique which are associated with two teams, I want to display only the team with the min value by the column "timestamp", in a  straight table in Qlik view.

Do I need to use a calculated dimension? and if so, what is the calculation? 

Or, should I use an expression?

below is my sample data.

UniqueorderID timestampteam
11231/1/2019A
112320/2/2019B

 

I need the following in OutPut:

UniqueorderID timestampteam
11231/1/2019A

 

Thanks in advance,

Labels (1)
2 Replies
tincholiver
Creator III
Creator III

Hi Ttal,

You need to first take the minimum value that the date field has.
For that you must do the following:

Table:
LOAD * Inline [
Unique, orderID, timestamp, team
1,123.01 / 01/2019, A
1,123.20 / 02/2019, B];

Temp_Table:
LOAD
orderID,
date (min (timestamp)) as MinDate
Resident Table Group By orderID;

Then in the graph you put as dimensions Unique, timestamp, ordeID and in the expression:
Only ({<timestamp = {'$ (= MinDate)'}>} team)

Tell me if I help you answer.

Result is:

 

orderIDtimestampUniqueteam
12301/01/20191A
Anil_Babu_Samineni

Try to use this?

Aggr(FirstSortedValue(team, -timestamp), orderID)

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