Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

PLEASE HELP ME WITH THIS CASE STATEMENT.

CASE WHEN ITEM_ID LIKE '%CB%' THEN SUBSTR(ACCOUNT_NO,4,10)            

         WHEN ITEM_ID LIKE 'D%'   THEN SUBSTR(ACCOUNT_NO,5,8)

ELSE ACCOUNT_NO END AS InSite_Acct,

I am trying like this below.It is giving me error.Can anybody tell me what am I doing wrong here?

 

if(WildMatch([ITEM ID],'*CB*',mid([Account Number],4,10)

if(WildMatch([ITEM ID],'*D*',mid([Account Number],5,8),([Account Number])) as INsite_Acct,

1 Solution

Accepted Solutions
Nicole-Smith

if(WildMatch([ITEM ID],'*CB*'),mid([Account Number],4,10),

if(WildMatch([ITEM ID],'*D*'),mid([Account Number],5,8),[Account Number])) as INsite_Acct,

View solution in original post

3 Replies
Nicole-Smith

if(WildMatch([ITEM ID],'*CB*'),mid([Account Number],4,10),

if(WildMatch([ITEM ID],'*D*'),mid([Account Number],5,8),[Account Number])) as INsite_Acct,

Peter_Cammaert
Partner - Champion III
Partner - Champion III

Various things are wrong. In LOAD statements, QlikView has this annoying IF syntax because an IF really is a function with two or three parameters. Check the nesting of the two IFs. It should be more like:

  IF (wildmatch(), result1,

                            IF (wildmatch(), result2,

                                                      result3)) AS Fieldname ...

Count the comma's and the parentheses.

Luck,

Peter

Not applicable
Author

Thank you very much.