# QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Make your voice heard! Participate in the 2020 Wisdom of Crowds® Survey. BEGIN SURVEY
Contributor

## AGGR Fuction

Hi,

I need help, I have this por expression Double,

IF(SUM(AGGR(sum(Amount),Group))>9,

Sum(Aggr(sum(9),Group)),

Sum(Aggr(sum(Amount),Group)))

and this por Triple

IF(SUM(AGGR(SUM(Amount),Group))<9,0,

Sum(Aggr(Sum(Amount)-9,Group)))

I have this natural table:

Group Amount
A1
A2
A4
B2
B3
C1
C4
D4
D6
E5
E6
F1
F2
F3
F4

But I need to separete de data of the Amount, for example, Sum Value F is 10, so for doubles is 9 and for Triples 1,

the maximum for Doubles is 9, and Triples don´t have limits,

The total results are this

Group SUM(AGGR(SUM(Amount),Group))
48
A7
B5
C5
D10
E11
F10

And Amount in Doubles and Triples need to be this

Group Dobles Triples
63 -6
A70
B50
C50
D91
E92
F91

But the total sum not is true, Doubles=44 and Triples=4, I don´t Found the solution, and subsequently, I will to do a chart whit the velocimeter, Thanks a lot.

Tags (5)
1 Solution

Accepted Solutions
Highlighted
MVP

## Re: AGGR Fuction

Suggest to slightly simplify the expressions

Doubles

=Sum(Aggr(RangeMin(9, Sum(Amount)), Group))

Triples

=Sum(Aggr(RangeMax(0, Sum(Amount)-9), Group))

4 Replies
Highlighted

## Re: AGGR Fuction

Attached

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Highlighted
MVP

## Re: AGGR Fuction

Suggest to slightly simplify the expressions

Doubles

=Sum(Aggr(RangeMin(9, Sum(Amount)), Group))

Triples

=Sum(Aggr(RangeMax(0, Sum(Amount)-9), Group))

Highlighted
Contributor

## Re: AGGR Fuction

Sunny,

Thanks a lot, its working, and very simple.

Highlighted
Contributor

## Re: AGGR Fuction

Anil,

Thanks a lot, its work, too.