11 Replies Latest reply: Jan 5, 2016 11:16 AM by Sunny Talwar

# Sum() in the If Condition

Hi all,

I was trying to sum the filed grouped by name in the if loop.

=If(Status=1,Sum(Aggr([Amount],Name)))

This is not giving any result.

• ###### Re: Sum() in the If Condition

May be this:

Sum({<Status = {1}>} Aggr(Only({<Status = {1}>} Amount), Name))

• ###### Re: Sum() in the If Condition

It's just giving 0 sunny.

• ###### Re: Sum() in the If Condition

Would you be able to share a sample?

• ###### Re: Sum() in the If Condition

Hi Mark,'

Only function returns 0(Zero) if they is more than one value for a dimension

Regards

Neetha

• ###### Re: Sum() in the If Condition

Thanq neeta.

It worked

• ###### Re: Sum() in the If Condition

Hi

Can you put some dummy data.

Thanks

Kiran Kumar

• ###### Re: Sum() in the If Condition

!Here is the sample application..

I was trying to do the calcualtions using the variables.

• ###### Re: Sum() in the If Condition

I see this:

• ###### Re: Sum() in the If Condition

Sunny its working for me.

Also, i'm trying to store the value of the Column's total in chart to a variable...

I can do it by storing the expression in Variabloe.

But due to req. constraints i wanna do it the other way.

Can we do it?

• ###### Re: Sum() in the If Condition

Is this going to change based on selections?

• ###### Re: Sum() in the If Condition

Hi Mark,