Data Element
» See all 6 related threads
May 09 21

WEBI Nesting IF statements and use of ELSE  

11:21 // Simon Nandlal

Hi,

Am quite new to the use of WEBI as I have traditionally been brought up in a full client environment so am used to writing IF statements with THEN and ELSE commands. However I noted that the same functionality doesnt appear to exist in WEBI, so was wondering how one writes an IF statement against a variable which has four outputs which all need to be independently named. Have tried using ; between if statements but it only appears to allow me to use a maximum of two....

Appreciate the assistance.

Thanks,

 
May 09 21

Re: WEBI Nesting IF statements and use of ELSE  

15:54

Hi,

Please follow the below syntax and let me know if this works for you:-

=if(Condition1;if true value or Condition 2; false value or condition)

example: =if(sal>1000;if(sal<1500;"value between 1000 to 1500";"value more than 1500");"Value less than 1000)

Please try this and let me know.

Thanks,

Madhu.

May 09 21

Re: WEBI Nesting IF statements and use of ELSE  

16:18 // Simon Nandlal

Thanks for that. I think I managed to get through to roughly that stage but I needed to add in a 3rd and 4th IF statement (I have an object which has four results each which need to be named independently). The example below would only allow me to label two of these and I couldnt find a way in BOXI for adding in the third and fourth name:-

=if(sal>1000;if(sal<1500;"value between 1000 to 1500";"value more than 1500");"Value less than 1000)

Appreciate some more assistance. Thanks, Simon

May 09 21

Re: WEBI Nesting IF statements and use of ELSE  

16:30

Hi Simon,

Check the below syntax:

=if(sal>1000;if(sal<1500;if(sal>1100;if(sal>1300;"value between 1300 and 1500";"value between 1000 and 1300");"Value between 1100 and 1000");"value more than 1500");"Value less than 1000)

Let me know if you understand the syntax.

Thanks,

madhu.

May 09 21

Re: WEBI Nesting IF statements and use of ELSE  

16:59 // Simon Nandlal

Thanks Madhu

Understand your logic perfectly and nests ok but it all seems to return as either "d" or "#NA" in the below example, despite having data for "a" "b" and "c":-

=if([Question Number]=u201D_1_2_5_1u201D;if([Question Number]=u201D_1_2_5_2u201D;if([Question Number]=u201D_1_2_5_3u201D;if([Question Number]=u201D_1_2_5_4u201D;"a";"b");"c");"d");"#NAu201D)

Do you know what's wrong?

Thanks, Simon Nand-Lal

May 09 21

Re: WEBI Nesting IF statements and use of ELSE  

17:15

Hi,

Below is your syntax:

=if(Question Number=u201D_1_2_5_1u201D;if(Question Number=u201D_1_2_5_2u201D;if(Question Number=u201D_1_2_5_3u201D;if(Question Number=u201D_1_2_5_4u201D;"a";"b");"c");"d");"#NAu201D)

Here what exactly is happening is:-

If condition1, cond2, cond3, cond4 are true then only you will get a,

if condition1 to condition3 are true and condn4 is false then you will get b,

if condn1 and condn2 are true and if condn3 is false then you will get c,

if condition 1 is true and condition2 is false then you will get d

and if condition1 is false then u will get #NA

Please let me know what is your requirement.

Thanks,

Madhu.

May 09 21

Re: WEBI Nesting IF statements and use of ELSE  

17:19

You need NestedIf ?? Why can't you try ElseIf or If then else...

like:

If(a>1) then "a" etc...

or

If(a>1) then "a" ElseIf(a>2) then "b" etc...

Thank You!

May 09 21

Re: WEBI Nesting IF statements and use of ELSE  

17:38 // Simon Nandlal

Thanks Madhu,

All I'm trying to do is something along the lines of:-

=if((Question Number=u201D_1_2_5_1u201D then "a") else if(Question Number=u201D_1_2_5_2u201D then "b") else if(Question Number=u201D_1_2_5_3u201D then "c") Else "#NAu201D). Unfortunately I cant use the Else or Then commands in WEBI, so seem to be reliant on combining the IF statements.

So basically whenever a question number meets an individual condition (they are not combined conditions) I need to return a result a seperate result label...

Thanks, Simon

Date Views Headline Answers
18.08.2010 1035 Multiplying of pricing condition 4
29.05.2010 296 Calculate Pricing conditions 1
21.07.2008 595 Probleem regarding SM30 3
18.06.2008 488 select query 11
10.03.2006 2105 Modify Database table 15
03.01.2006 214 Multiple Conditions in Smartforms 10

Feedback