Qlik Community

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Tell us which business and trade publications you read most regularly: RESPOND NOW
Showing results for 
Search instead for 
Did you mean: 
Partner - Creator II
Partner - Creator II

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 - Master III
Partner - Master III

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

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