Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Problem with Avg function

Hello Everybody,

I have a problem with my following expression :

I'm trying to make a custom multiple list with the following expression :

if(ESMS.CODE_CATEGORIE=200,10 * ($(v_pct_plafond)/100), $(v_capacite_au_01/01/N) *  avg (COUT_MOYEN_NATIONAL.COUT_MOYEN) * ($(v_pct_plafond)/100)).

It doesn't work beacuse of the AVG function.

When i replace the AVG expression with a constant, it works perfectly, i can choose any value as I want to.

Can you please explain me why? Is there any solution to make it work with the avg function?

We previously faced the same problem with sum() function and it seems that "aggr()" was the solution.

But this time, it's a bit more complicated

1 Solution

Accepted Solutions
JonnyPoole
Employee
Employee

you may need to wrap the existing expression in an aggr()

Aggr(  <existing expression >   ,  <Dimension> )

If you are using it in a chart with multiple dimensions, list all dimensions.

if you get stuck see if you can attach a QVW sample

View solution in original post

3 Replies
JonnyPoole
Employee
Employee

you may need to wrap the existing expression in an aggr()

Aggr(  <existing expression >   ,  <Dimension> )

If you are using it in a chart with multiple dimensions, list all dimensions.

if you get stuck see if you can attach a QVW sample

Not applicable
Author

Ok, I will try different uses of the Aggr() function, thank you.

Not applicable
Author

it is indeed the right solution, thanks a lot .