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: 
jadams123
Creator
Creator

Easy Question

Hi Experts:

I am putting the following code in my dimensions and its sort of working:

=if(REGION<>'ZZ'AND
REGION<>'zz' AND
REGION<>'Dx'AND
REGION<>'Nx' AND
REGION<>'Not Assigned' AND
REGION<>'-',
REGION)

Problem with this code is that there is a NULL value or some value '-' that keeps on showing up. So what I see is :

ON 
QC
WST 
-

only want to choose 'ON', 'QC', and 'WST' in my REGION and nothing else. Not even null values or any value. 

 

Thanks, 

J

 

 

1 Solution

Accepted Solutions
Somasundaram
Creator III
Creator III

Use,

Match(REGION,' 'ON', 'QC', 'WST')

and suppress Null


-Somasundaram

If this resolves your Query please like and accept this as an answer.

View solution in original post

4 Replies
jadams123
Creator
Creator
Author

Also When I do 'Supress when Values are Null' it works. 

 

Is there a better way to write the code?

Somasundaram
Creator III
Creator III

Check the Suppress Null value  property.


-Somasundaram

If this resolves your Query please like and accept this as an answer.
Somasundaram
Creator III
Creator III

Use,

Match(REGION,' 'ON', 'QC', 'WST')

and suppress Null


-Somasundaram

If this resolves your Query please like and accept this as an answer.
dplr-rn
Partner - Master III
Partner - Master III

I would set analysis rather than a calculated dimension. it gives better performance (wont matter much if data size is small but its the recommended practice)

just use {<REGION={'ON', 'QC', 'WST' }>} in your expression
or put your code in the load script as a flag column. and use that flag as part of set analysis