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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

CASE statement in QlikSense

HI ,

i need to write case statement in qliksense for below statement

CASE  WHEN column_name  IN ('A-Dallas', 'A-Texas') THEN 'US' end

I tried in qliksense as below, which throwed error and displayed nothing

if(wildmatch([ column_name],'A*', 'US'))

Can anyone please help

1 Solution

Accepted Solutions
sunny_talwar
MVP
MVP

You have incorrect positioning of the parenthesis

This is incorrect

If(WildMatch([ column_name],'A*', 'US'))

Try this instead

If(WildMatch([ column_name],'A*'), 'US')

View solution in original post

13 Replies
kvanandan1
Creator
Creator

Hi,


Please try


if(WildMatch([column_name],'A*')=1,'US')

sunny_talwar
MVP
MVP

You have incorrect positioning of the parenthesis

This is incorrect

If(WildMatch([ column_name],'A*', 'US'))

Try this instead

If(WildMatch([ column_name],'A*'), 'US')

Anonymous
Not applicable
Author

How can i deal with blank values

when i have blank i need to get as '1' if have some value then '0'

Anonymous
Not applicable
Author

hi

How can i deal with blank values

when i have blank i need to get as '1' if have some value then '0'

can you please help on this

sunny_talwar
MVP
MVP

Use Len(Trim()).... for example

If(Len(Trim(FieldName)) = 0, 1, 0) as Flag

Anonymous
Not applicable
Author

Hi

it is throwing error

sunny_talwar
MVP
MVP

Did you replace Fieldname with your own field?

Anonymous
Not applicable
Author

yes

i used as this

If(Len(Trim(column_name)) = 0, 1, 0)

sunny_talwar
MVP
MVP

Can you post a screenshot of the error message?