I have a very weird problem with a a chart expression. The simplified problem: I have a table with a dimension going from 1 to 10. My expression needs to be calculated depending on the dimension. So I write as expression (with DIM the dimension):
if (DIM=1, valueForDim1,
if (DIM=2, valueForDim2,
if (DIM=3, valueForDim3, [...]
Normally this doesn't give me any problems. However this time I need to use the advanced aggregation function (with AggrDim the aggregation dimension and AggrExpr the aggregation expression):
if (DIM=1, avg(aggr(AggrExpr1,AggrDim)),
if (DIM=2, avg(aggr(AggrExpr2,AggrDim)),
if (DIM=3, avg(aggr(AggrExpr3,AggrDim)), [...]
Now I only get a result for my first dimension! The other dimensions are not calculated! When I delete the if(DIM=1...) then I only get a result for the second dimension (and so on). The aggregations work like a charm when I use them outside the if() clauses.
Does anyone know how to fix this? Is this a bug? Thanks!
That's right. I found that out just trying a couple of things without really knowing what I'm doing. Using the NODISTINCT that works very well. Although I have to ressearch if the results are indeed OK. But I have no idea what the difference is between the default and the NODISTINCT aggregations.