Skip to Content
0

If and Else statement in webi

Aug 10, 2017 at 03:14 PM

168

avatar image
Former Member

Hello Friends,


I am struggling with a if and else statement in WebI, thought i post it here for quick help.

=If
([V100 2012].[Net Forecast]=0 Or IsNull([V100 2012].[Net Forecast]))
Then ([V200 2012].[Net Forecast])

ElseIf
([V200 2012].[Net Forecast]=0 Or IsNull([V200 2012].[Net Forecast]))
Then ([V300 2012].[Net Forecast])

Else
([V100 2012].[Net Forecast])

This statement does not seem to be working in a situation where variable [V100 2012].[Net Forecast] has a value greater than 0 and [V200 2012].[Net Forecast] & [V300 2012].[Net Forecast] is either 0 or null as it should give the value for [V100 2012].[Net Forecast] but instead produces the value for [V300 2012].[Net Forecast]

Can someone please help.


Thanks.

if | else | elseif
10 |10000 characters needed characters left characters exceeded
Former Member

Thanks Amit

The new statement worked up to second elseif statement but failed on the third

What I am trying to achieve is this: I have 3 variables A, B & C

when A=0 or isnull display B

when B=0 or isnull display C

when C=0 or isnull display A

When A>0 always display A regardless of whether B & C =>0 or IsNull

0

you can try to create two variables.

First variable

when A=0 or isnull display B

when B=0 or isnull display C

when C=0 or isnull display A

Second Variable on the first variable and When A>0 always display A regardless of whether B & C =>0 or IsNull

0
Former Member

Thanks Amit,

I created two variables as advised and it worked.

0
* Please Login or Register to Answer, Follow or Comment.

1 Answer

AMIT KUMAR
Aug 10, 2017 at 03:40 PM
0

what about if you add one more if-else condition?

=If
([V100 2012].[Net Forecast]=0 Or IsNull([V100 2012].[Net Forecast]))
Then ([V200 2012].[Net Forecast])

ElseIf
([V200 2012].[Net Forecast]=0 Or IsNull([V200 2012].[Net Forecast]))
Then ([V300 2012].[Net Forecast])

elseif

([V100 2012].[Net Forecast]>0 Or IsNull([V200 2012].[Net Forecast]
or IsNull([V300 2012].[Net Forecast])))

Then ([V100 2012].[Net Forecast])

else

([V100 2012].[Net Forecast])

Share
10 |10000 characters needed characters left characters exceeded