Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
ttal7878
Contributor

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
Contributor II

Re: How to show max value row in straight table

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

Re: How to show max value row in straight table

Try to use this?

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

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)