Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

question on expression with two or more rows

Is there a way to create an expression to only return value based on the latest Date?

For example, there are two entries for the same item but I want to return $100,000 as it has the latest date changed.

Latest Date.JPG.jpg

thanks!

Derrell

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Thanks Daniel.

I was still getting the sum of both the values. Further searching I found a solution as below:

Sum(If(Aggr(NODISTINCT Max(LastChangedDate), P8_OpportunityID) = LastChangedDate, P8_EstimatedValue))

View solution in original post

2 Replies
danieloberbilli
Specialist II
Specialist II

try something like this in your P8_EstimatedValue expression: I use 'sum' - maybe in your case you rather use only(), avg() or whatever suits your calculation:

=sum({<LastChangedDate={"=max(LastChangedDate)"}>}  P8_EstimatedValue)

edited: sorry - I meant to write LastChangedDate...not CreatedDate

Anonymous
Not applicable
Author

Thanks Daniel.

I was still getting the sum of both the values. Further searching I found a solution as below:

Sum(If(Aggr(NODISTINCT Max(LastChangedDate), P8_OpportunityID) = LastChangedDate, P8_EstimatedValue))