Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
SAM81
Contributor II
Contributor II

Sum WHEN max date - help!!

Hi

I am trying to create an expression that generates a SUMPRODUCT value but only for the latest date in my data set.

Current expression is SUM(CLOSED*C_AGE)/SUM(CLOSED).  But this will calculate for all dates in my data set.  

I need this to only calculate for the latest week in my data set based on the week field name being 'WEEK_COMMENCING'

Can anyone help?

1 Reply
GaryGiles
Specialist
Specialist

Something like this:

=sum({<WEEK_COMMENCING={'$(=max(WEEK_COMMENCING))'}>} CLOSED*C_AGE) / sum({<WEEK_COMMENCING={'$(=max(WEEK_COMMENCING))'}>} CLOSED)