Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
brucemeyers
Contributor II
Contributor II

Sum goals scored

Here is my expression, that’s not working

Sum({$<[Date]={$(=Max([Date]))}>}[Goals Scored])

Here is my data

DateCountryGoals Scored
7/15/2018France4
7/15/2018Croatia2
7/14/2018Belgium2
7/14/2018England0
7/11/2018England1
7/11/2018Croatia2
7/10/2018France1
7/10/2018Belgium0
7/7/2018Sweden0
7/7/2018England2
7/7/2018Russia5
7/7/2018Croatia6
7/6/2018Uruguay0
7/6/2018France2
7/6/2018Brazil1
7/6/2018Belgium2

I want to create a measure in a Table chart that will sum the ‘Goals  Scored’ of the most recent ‘Date’ for each country. 

Using the data above my Table chart should look like this …

  

CountryGoals Scored
Belgium0
Brazil0
Croatia2
England0
France4
Russia0
Sweden0
Uruguay0

Can you help?

1 Solution

Accepted Solutions
balabhaskarqlik

=Sum({$<[Date]={"$(=Max([Date]))"}>}[Goals Scored])

View solution in original post

3 Replies
balabhaskarqlik

=Sum({$<[Date]={"$(=Max([Date]))"}>}[Goals Scored])

balabhaskarqlik

=Sum({1<[Date]={"$(=Max([Date]))"}>}[Goals Scored])

giovanneb
Creator II
Creator II

Qlik with dates fields when we use the max function it transforms into numerical value causing problems in the relation so I suggest using fields num to date.

Do it

in the source table create a field in a (Date) as NumDate

use it in set analysis

Sum({$<NumDate= {$(=(Max([NumDate])))}>}[Goals Scored])

Your problem will be solved.

Regards