2 Replies Latest reply: Jun 20, 2011 3:30 PM by Enrico Annibale Ruggeri

Aggr function in set analysis

Hello:

in a table like this:

campo1  campo2  valore

A             10         1

A               3       99

A             27         3

B             14         1

B             32         2

C           100         6

C           200         7

C           300       14

I want in a graph obtain for every value in campo1 the value of valore for the minimum of campo2, in this example I want to obtain this:

A  99

B   1

C   6

I tried a graph/pivot with campo1 as dimension and sum({\$<campo2={\$(=min(aggr(min(campo2),campo1)))}>}valore) as expression but also

sum({\$<campo2={\$(=aggr(min(campo2),campo1))}>}valore). But In first case I get only 99 and 0 for other campo1 values, in second case I get 0 and a value only if I select only one value of campo1.

• Aggr function in set analysis

Something like this:

campo1 as dimension

=aggr(if(campo2=min(total <campo1> campo2),valore),campo1,campo2)

You could put sum in front of it b ut it wouldn't matter unless there are 2+ rows with the same campo1 and campo2, the campo2 is the min for that campo1, and the valore is different.