Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
QlikWorld 2020: Join us May 11 - 14, 2020 in Phoenix, AZ. Register early and save $400. Learn More
Partner
Partner

display latest value for each subject based on date.

Given the following table in Qlik Sense:

First Name, Last Name, State, Sale Date, Sale Amount

 

 I want to display a table that contains:

First Name, Last Name, State, Latest Sale, Sale Amount

 

I almost get there with First Name, Last Name, State as dimensions and max([Sale Date]) as a measure; the data looks good.

But when I add a column with sum({<[Sale Date]={$(=max([Sale Date]))}>}[Sale Amount])  as a measure it returns zeros. 

If I change it to just sum([Sale Amount]) I see the total, so I know the [Sale Amount] values are good.  It's something about the set analysis that's hanging me up.

 

Thanks for any help. 

Labels (1)
2 Replies
Partner
Partner

Re: display latest value for each subject based on date.

Set analysis calculated once per table. it doesnt do it per row.
So your max(SaleDate) would return max of every date not just per dimension
I suggesting creating a flag on the data while loading to indicate the latest value
Khan_Mohammed
Honored Contributor II

Re: display latest value for each subject based on date.

Maybe
sum({<[Sale Date]= {'$(=Max([Sale Date]))'}>}[Sale Amount])