Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
romeopav
Contributor
Contributor

Sum amount of past dates by ID

Hi,

i need to pick the max date happened in the past by ID, if there is any, and the relative sum of amounts, regarding the example below i need the result for ID 1 as 10/10/20 with amount 4500, in two columns of presentation, and for ID 2 data null and amount zero

Many thanks

Qlik example.PNG

1 Reply
tresesco
MVP
MVP

@romeopav You are essentially looking for amount for 2nd last date

Try like:

Dim : ID

Exp : FirstSortedValue( Aggr(Sum(Amount) ID, Date), - Date, 2)