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: 
Not applicable

Sum and date on date difference

Hi all,

I have table that looks like this:

Capture.PNG

I am trying to sum up the goals that each team scored on the latest date (max date). I've created a variable

vMaxDate = (Date(Max(Date)),Team). I've tried 2 expressions and it keeps selecting the largest goals scored. These are my expressions:

(aggr(SUM(if(Date=$(=vMaxDate), Goals,0)),Team))

(if(Date=$(=vMaxDate), Goals,0))

I want my output to look like this:

Capture2.PNG


I also need to calculate a sequential difference based on the date i.e. :

Capture3.PNG

1 Solution

Accepted Solutions
sunny_talwar

Try this in a straight table

Dimension: Team

Expression1: =Date(Max(Date))

Expression2: =FirstSortedValue(Aggr(Sum(Goals), Team, Date), -Aggr(Date, Team, Date))

Capture.PNG

View solution in original post

3 Replies
sunny_talwar

Try this in a straight table

Dimension: Team

Expression1: =Date(Max(Date))

Expression2: =FirstSortedValue(Aggr(Sum(Goals), Team, Date), -Aggr(Date, Team, Date))

Capture.PNG

sunny_talwar

For your second requirement create another straight table:

Dimension: Team, Division, Date

Expression1: Goals

Expression2: =Goals - Above(Goals)

Capture.PNG

Not applicable
Author

Thank Sunny T. Works perfectly!