# QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

New Contributor II

## SUM of MAX day by day

Hi,

i have a problem.

i have many counters with growing values:

COUNTER 1 , DAY 1 = 1

2

4

7

counter 1 day 2 =  9

11

18

ecc...

COUNTER 2 , DAY 1 = 3

5

6

9

counter 2 day 2 =  12

13

15

ecc...

i need a table that day by day make the sum of max value for each counter like:

day 1 : 16 (max of counter 1 & counter 2 in the first day =7+9)

day 2 : 33 (max of counter 1 & counter 2 in the second day = 18+15)

i can make a table day by day but sum of max doesn't work...

Thanks

1 Solution

Accepted Solutions
MVP

## SUM of MAX day by day

You need to use advanced aggregation:

=sum( aggr( max(CounterField), CounterField, DayField) )

Hope this helps,

Stefan

4 Replies
MVP

## SUM of MAX day by day

You need to use advanced aggregation:

=sum( aggr( max(CounterField), CounterField, DayField) )

Hope this helps,

Stefan

New Contributor II

## SUM of MAX day by day

Thanks a lot Stefan,

works great.

Can i ask you another question?

can i exclude some counter field ?

if i don't want the counter 1 and make the "sum of max" of counter 2,3,4....

can i use something like if(CounterField <>1, ......

i have try this "if" but doesn't work.

MVP

## SUM of MAX day by day

Yes, you can do this, try this:

=sum( aggr( max( if( CounterField<>1, CounterField)), CounterField, DayField) )

New Contributor II

## SUM of MAX day by day

Thanks a lot, again !

Now works...

i had put the IF expression in the wrong field...