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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Please help me to convert this SQL case statement to qlikview

Case WHEN ITEM_ID = 'LI_NRR6R7'

AND (ACCOUNT_NO = '10-2980928'

OR ACCOUNT_NO LIKE '10-6%'
OR ACCOUNT_NO LIKE '10-H%' '
OR ACCOUNT_NO = '55-7324302'
OR ACCOUNT_NO = '81-1039237'     

THEN SUBSTR(ACCOUNT_NO,-7)
ELSE ACCOUNT_NO END AS InSite_Acct,

I tried

 

if(match([ITEM ID],'LI_NRR6R7') and if

(Wildmatch([Account Number],'10-2980928*','10-6*','10-H*','55-7324302*', '81-1039237*,  mid([Account Number],-7)),

[Account Number]) as InSite_Acct

It is not working.Please help me with this.

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Try

if(match([ITEM ID],'LI_NRR6R7') and

Wildmatch([Account Number],'10-2980928*','10-6*','10-H*','55-7324302*', '81-1039237*),  right([Account Number],7),

[Account Number]) as InSite_Acct

View solution in original post

3 Replies
swuehl
MVP
MVP

Try

if(match([ITEM ID],'LI_NRR6R7') and

Wildmatch([Account Number],'10-2980928*','10-6*','10-H*','55-7324302*', '81-1039237*),  right([Account Number],7),

[Account Number]) as InSite_Acct

Anonymous
Not applicable
Author

Try this:

if(ITEM_ID = 'LI_NRR6R7' and wildmatch(ACCOUNT_NO, '10-2980928*','10-6*','10-H*','55-7324302*', '81-1039237*'), right(ACCOUNT_NO,7), ACCOUNT_NO) AS InSite_Acct,

Not applicable
Author

I think you need something for the if statement to actually test?

Try

if(match([ITEM ID],'LI_NRR6R7') > 0 and

Wildmatch([Account Number],'10-2980928*','10-6*','10-H*','55-7324302*', '81-1039237*) > 0,  right([Account Number],7),

[Account Number]) as InSite_Acct