Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Chanty4u
MVP
MVP

RE:IF again

Hi all,

I have samll error in below  code.

if(vServerName='1-2-3-4','1-2-3-4',if(vServerName='1-0-3-4','1-0-3-4',if (vServerName = 'ABC','CBD' ))) as vServerName

end if;

can anyone give suggestions on this

Thanks in advance.est

Chanty

1 Solution

Accepted Solutions
tresesco
MVP
MVP

May be you just need to define a variable like:

Let vServerName=ComputerName();

And then use this variable like:

IF vServerName='ABC' Then

Do this...

   Else IF vServerName = 'XYZ' Then

          Do.. this2

          Else IF vServerName= 'Others' Then

                   Do ..that

          End IF    

   End IF

End IF

View solution in original post

4 Replies
sunny_talwar

Is this within the LOAD statement? If it is, I don't think you need a ENDIF

If(vServerName = '1-2-3-4','1-2-3-4',

if(vServerName = '1-0-3-4','1-0-3-4',

If(vServerName = 'ABC', 'CBD'))) as vServerName

tresesco
MVP
MVP

May be you just need to define a variable like:

Let vServerName=ComputerName();

And then use this variable like:

IF vServerName='ABC' Then

Do this...

   Else IF vServerName = 'XYZ' Then

          Do.. this2

          Else IF vServerName= 'Others' Then

                   Do ..that

          End IF    

   End IF

End IF

Chanty4u
MVP
MVP
Author

Thanks sunny &Tre

jagan
Luminary Alumni
Luminary Alumni

Hi,

You can simply use this

if(vServerName= 'ABC','CBD', If(Mixmatch(vServerName, '1-2-3-4', '1-0-3-4'), vServerName)) as vServerName

Regards,

Jagan.