Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Scripting If Statement / Case Statement

All

I'm having issues using the If statement on the scripting back end of QlikView

Can somebody explain why this doesn't work?

If Left([Insurer Policy Number],7) = 'GSPC701' Then 'Skippy'

Else 'Sampras'

End If as [Test],

Thanks in advance

13 Replies
tresesco
MVP
MVP

Have you tried this?

Load *,

     If ( Left([Insurer Policy Number],7) = 'GSPC701' ,'Skippy' ,'Sampras' ) as  Test ;


SQL SELECT

*

FROM SkippyReporting.dbo.Core_Product_All_Txns;

Not applicable
Author

Hi, It's like this.

LOAD

If (Left([Insurer Policy Number],7) = 'GSPC701','Skippy', 'Sampras')as [Test]

from file;

Regards.

CELAMBARASAN
Partner - Champion
Partner - Champion

My previous post has the solution, didn't you tried that?


Load *,

     If ( Left([Insurer Policy Number],7) = 'GSPC701','Skippy' ,'Sampras' ) as [Test];

SQL SELECT

       *
FROM SkippyReporting.dbo.Core_Product_All_Txns;

Not applicable
Author

this is my existing code. how do I factor your suggestions into this?

ODBC CONNECT TO lassie (XUserId is GaLDOJdJDaSYFVFMNLZGHXUNBbaKGYVMBbYKWdA);

SQL SELECT
    *
FROM SkippyReporting.dbo.Core_Product_All_Txns;