Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Experts,
I have the below expression
Expression : =Sum(AGGR((if(Branch='1',[Target]*3,if(sum({<[Group]={'01'}>}Sales)=0,0,[Target]),Branch,Month))
i m trying to apply condition like, if the branch is 1, then i should bring target*3, if sum(sales) for group 01 is 0, then it should give zero, else target.
i m not getting correct values on total.
i couldnt find out what is wrong in my expression.
please help me to correct my expression.
First, you have a mismatch in the number of brackets. If I correct that, your expression will look like
Sum(
AGGR(
if(
Branch='1',
[Target]*3,
if(
sum({<[Group]={'01'}>}Sales)=0,
0,
[Target]
)
),
Branch,
Month
)
)
The next problem is that you use naked field references, when you need aggregation functions. These are marked in red. See Use Aggregation Functions!
Finally, I am not sure you need the Aggr(). I would in any case start without the Aggr() so I know that the base calculation works.
HIC
First, you have a mismatch in the number of brackets. If I correct that, your expression will look like
Sum(
AGGR(
if(
Branch='1',
[Target]*3,
if(
sum({<[Group]={'01'}>}Sales)=0,
0,
[Target]
)
),
Branch,
Month
)
)
The next problem is that you use naked field references, when you need aggregation functions. These are marked in red. See Use Aggregation Functions!
Finally, I am not sure you need the Aggr(). I would in any case start without the Aggr() so I know that the base calculation works.
HIC
thanks henric