7 Replies Latest reply on Oct 3, 2017 12:36 PM by Gerardo Varela

# Solution for aggregate ando no aggregate fields

Hello,

Does anyone know a possible solution for a calculate field that is using 2 fields: one is aggregate and the other no aggregate: In this case Total % is :

{FIXED: SUM([Total]) / SUM([Venta año anterior Día Calendario]) }

Thanks

• ###### 1. Re: Solution for aggregate ando no aggregate fields

The usual solution is to wrap the non-aggregated field in an ATTR() function.

In this case, it should be ATTR([% Cr Dia Calendario ]).

I'd start there and see what happens.

• ###### 2. Re: Solution for aggregate ando no aggregate fields

Hi

in any calcualted field all of the data values either have to be aggregated or at the dis-aggregate level - as Michael points out the usual way is to wrap the value in Attr() but it is not the only way - Min(), Max, Count() and Countd() also can be used to aggrewgate a variable - you can use the one(s) that make the most snese in the formula that you are using - als be aware that Attr() can not be used in LOD expressions

Jim

• ###### 3. Re: Solution for aggregate ando no aggregate fields

Hola Ailed,

Cambia to calculo a lo siguiente:

IF ([%Cr Día Calendario ])<=0

then "ROJO"

ELSEIF ( [%Cr Día Calendario ]>=0 AND [%Cr Día Calendario ]<=SUM([Total %]))

THEN "GRIS"

ELSEIF [%Cr Día Calendario ]<=SUM([Total %])

then "Verde"

END Saludos,

Gerardo

1 of 1 people found this helpful
• ###### 4. Re: Solution for aggregate ando no aggregate fields

Thank you @Gerardo , It worked!

• ###### 5. Re: Solution for aggregate ando no aggregate fields

Hola Ailed,

De nada!  Cuando tengas una oportunidad seria posible que marcas mi respuesta como la correcta para cerrar la pregunta?  Tambien, si es posible puedieras hacer los mismo con la otra pregunta en que te ayuda?

Muchisimas Gracias,

Gerardo

• ###### 6. Re: Solution for aggregate ando no aggregate fields

Claro, pero en que parte le doy que la respuesta fue la correcta?

• ###### 7. Re: Solution for aggregate ando no aggregate fields

El documente esta en ingles pero se que lo entiendes:

Saludos,

Gerardo