Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
h_prakash
Creator II
Creator II

Max Date Value with in Year

Hello Experts,

I have a requirement where I need to show amount for the maxdate with in each year. This is in the front end side.

The Data is like in the backend.

Year   Date                 Amount

2017  01/01/2019    100

2017  05/01/2019    200

2017  11/01/2019    150

2018  03/01/2019    400

2018  05/01/2019    500

2019  08/01/2019    600

2019  12/01/2019    100

 

I need to create a Table Chart where I need to show the amount where the date is maximum for that year.

Year   Amount

2017   150

2018    500

2019    100

 

Thanks

Hari

Labels (2)
1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Dimension: Year

Measure: Max(aggr(sum(Amount), Date))

-Rob

View solution in original post

3 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Dimension: Year

Measure: Max(aggr(sum(Amount), Date))

-Rob

h_prakash
Creator II
Creator II
Author

Thanks Rob for replying will try that. When we will use Firstsortvalue function?

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Use FirstSortValue when you want to return a value based on the rank of another value, for example if  you want the Date on which the max Amount occurred:

FirstSortedValue(Date, -Max(aggr(sum(Amount), Date)))

-Rob
http://masterssummit.com
http://qlikviewcookbook.com
http://www.easyqlik.com