Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

kouroshkarimi
Contributor III

Getting max value for combination of dimensions

Hi,

I have a simple pivot table with two dimensions and a sum(value) expression, see screenshot below.

Table.JPG

What I need is another pivot table which has Year as the dimension and the sum(Value) for the highest Age in each Year. So the table should look like:

Year     Value

2013     168,366,539

2012     150,206,177

2011     195,035,156

2010     213,980,411

etc...

Can anyone help?

Thanks.

1 Solution

Accepted Solutions
MVP
MVP

Re: Getting max value for combination of dimensions

use

FirstSortedValue( aggr(sum(Value),Year,Age), -aggr(Age, Year, Age) )

3 Replies
MVP
MVP

Re: Getting max value for combination of dimensions

use

FirstSortedValue( aggr(sum(Value),Year,Age), -aggr(Age, Year, Age) )

Not applicable

Re: Getting max value for combination of dimensions

Hi,

Have you tried using MAX (Age)?

spividori
Valued Contributor

Re: Getting max value for combination of dimensions

Hi.

You can also do it the following way:

sum( {$<Age= {$(#=max(Age))}>} Value)

Regards.

Community Browser