6 Replies Latest reply: Mar 5, 2014 4:02 PM by Massimo Grossi

Using if, sum, Total in the same Expression

I have an expression as

sum(Total<A,B,C>Revenue)

I want to put an if condition in the same. When i put if condition in beginning like:

if(Quarter='Q1', sum(Total<A,B,C>Revenue),0)

it does not give any result.

How should i write the expression for it to work.

• Re: Using if, sum, Total in the same Expression

Had you have a dimension Quarter, your expression would work. Else, try like:

=Sum( TOTAL <A,B,C> If(Quarter='Q1', Revenue,0))

• Re: Using if, sum, Total in the same Expression

=SUM(TOTAL <A,B,C> {<Quarter = {'Q1'}>} Revenue)

• Re: Using if, sum, Total in the same Expression

Hi Manish,

In Quarter I am trying to use an Alphanumeric variable. Its not working for that. Any change in syntax required?

Thanks and Regards,

Gaurang.

• Re: Using if, sum, Total in the same Expression

Quarter = {'\$(Variable)'}

• Re: Using if, sum, Total in the same Expression

Try this

=if(Qtr>0,sum(Total<A,B,C> )Revenue)

• Re: Using if, sum, Total in the same Expression

sum({\$ <Quarter={'\$(var)'}>} TOTAL <A,B,C> Revenue)