4 Replies Latest reply on Oct 11, 2012 12:05 PM by Michael Nealey

# If statement with conditions

I'm pretty certain a fix to this problem is possible.

I'd like to create a calculation that allows me to say:

IF [Dimension] = "X"

AND [Measure] <=n

THEN "Improve"

ELSE "Promote"

But if [Dimension] = "Y"

AND [Measure] >=N

THEN "Fix"

ELSE "Monitor"

Any thoughts?

• ###### 1. Re: If statement with conditions

Hi Michael,

The calculation might look something like the following:

if [Dimension]='X' and [Measure]<=n then 'Improve'

elseif [Dimension]='X' and [Measure]>n then 'Promote'

elseif [Dimension]='Y' and [Measure]>=N then 'Fix'

elseif [Dimension]='Y' and [Measure]<N then 'Monitor'

end

Hope this helps!

-Tracy

• ###### 2. Re: If statement with conditions

OK...I think I have some additional complexity.

I'll try and write this in a table so you can see what I am trying to do.

If [Measure 1] >n1 Then "Text a" ....If Dimension = A

If [Measure 1] >n1 Then "Text b" ....If Dimension = B or C

but

If [Measure 1] <n1 AND If [Measure 2] >n2 Then "Text c" ....If Dimension = A

If [Measure 1] <n1 AND If [Measure 2] >n2 Then "Text b" ....If Dimension = B or C

else

"Text d"....for all Dimensions

• ###### 3. Re: If statement with conditions

Hi Michael,

So would this work?:

if [Dimension]='A' and [Measure1]>n1 then 'Text a'

elseif [Dimension]='B' or [Dimension]='C' and [Measure1]>n1 then 'Text b'

elseif [Dimension]='A' and [Measure1]<n1 and [Measure2]>n2 then 'Text c'

elseif [Dimension]='B' or [Dimension]='C' and [Measure1]<n1 and [Measure2]>n2 then 'Text b'

else 'Text d'

end

-Tracy

• ###### 4. Re: If statement with conditions

Almost...

I seem to be seeing one of the conditions not working...

Does there need to be an ordering of the conditions?