# QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
LINKEDIN LIVE: Democratizing data to enhance customer-centricity. JULY 29TH REGISTER TODAY
cancel
Showing results for
Did you mean:
Contributor II

## Use of Groups in an Aggregation Function

Is ot possible to use groups in an expression with aggregated function?

Sample:

=(if(GetSelectedCount(PROYECTO)>1,
Sum( Aggr(Count({Grupo_3< AGRUPACION_LP = {'Ligeros'}>} ID_TRANSIT) * Only(POND_TOTAL), FECHAT, PROYECTO, DESCRIPCION))/
COUNT({Grupo_3<DUE = {'1'}>} Día),
if(IsNull(GetFieldSelections(PROYECTO)),
Sum( Aggr(Count({Grupo_3< AGRUPACION_LP = {'Ligeros'}>} ID_TRANSIT) * Only(POND_TOTAL), FECHAT, PROYECTO, DESCRIPCION))/
COUNT({Grupo_3<DUE = {'1'}>} Día),
Sum( Aggr(Count({Grupo_3< AGRUPACION_LP = {'Ligeros'}>} ID_TRANSIT) * Only(POND_PROY), FECHAT, PROYECTO, DESCRIPCION))/
COUNT({Grupo_3<DUE = {'1'}>} Día))))

Best

1 Solution

Accepted Solutions
Contributor II
Author

Well, I did it by myself hehe!

Here's the solution:

=(if(GetSelectedCount(PROYECTO)>1,
Sum({Grupo_2} Aggr(Count( {Grupo_2}ID_TRANSIT) * Only({Grupo_2}POND_TOTAL), FECHAT, PROYECTO, DESCRIPCION))/
COUNT({<DUE = {'1'}>} Día),
if(IsNull(GetFieldSelections(PROYECTO)),
Sum({Grupo_2} Aggr(Count({Grupo_2} ID_TRANSIT) * Only({Grupo_2}POND_TOTAL), FECHAT, PROYECTO, DESCRIPCION))/
COUNT({<DUE = {'1'}>} Día),
Sum({Grupo_2} Aggr(Count( {Grupo_2}ID_TRANSIT) * Only({Grupo_2}POND_PROY), FECHAT, PROYECTO, DESCRIPCION))/
COUNT({<DUE = {'1'}>} Día))))

Here's the result.-

2 Replies
Contributor II
Author

Just clarifying,

Instead of groups I wanted to say States, in other words, I have created two states named Grupo_3 and Grupo_4 , and I want to use them in the expressions but is not working, I wonder if th problem is that I'm using n aggregted function.

Hope I was clear enough

Best

Contributor II
Author

Well, I did it by myself hehe!

Here's the solution:

=(if(GetSelectedCount(PROYECTO)>1,
Sum({Grupo_2} Aggr(Count( {Grupo_2}ID_TRANSIT) * Only({Grupo_2}POND_TOTAL), FECHAT, PROYECTO, DESCRIPCION))/
COUNT({<DUE = {'1'}>} Día),
if(IsNull(GetFieldSelections(PROYECTO)),
Sum({Grupo_2} Aggr(Count({Grupo_2} ID_TRANSIT) * Only({Grupo_2}POND_TOTAL), FECHAT, PROYECTO, DESCRIPCION))/
COUNT({<DUE = {'1'}>} Día),
Sum({Grupo_2} Aggr(Count( {Grupo_2}ID_TRANSIT) * Only({Grupo_2}POND_PROY), FECHAT, PROYECTO, DESCRIPCION))/
COUNT({<DUE = {'1'}>} Día))))

Here's the result.-

Community Browser