Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
Chanty4u
Esteemed Contributor III

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
MVP
MVP

Re: RE:IF again

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

4 Replies

Re: RE:IF again

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

MVP
MVP

Re: RE:IF again

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
Esteemed Contributor III

Re: RE:IF again

Thanks sunny &Tre

MVP & Luminary
MVP & Luminary

Re: RE:IF again

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.