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: 
smanas
Contributor III
Contributor III

Flag

Hello,

I have a column with numbers ranging from 1 to 15, I want to create a flag such as if number is 1 - Primary if the number is 2 and greater secondary into a new column, please advise thank you

Labels (1)
3 Replies
BrunPierre
Partner - Master II
Partner - Master II

IF([Number Column]='1','Primary',

IF([Number Column]>'1','Secondary',NULL())) AS [New Column]

smanas
Contributor III
Contributor III
Author

Hi @BrunPierre  thanks for the query, but it's giving me an error 

I think AS is not accepted

 

BrunPierre
Partner - Master II
Partner - Master II

That statement should be in the script, then perhaps the resultant field i.e. [Primary/Secondary] will be used as a dimension against an expression like Count(distinct DiagnosisCD ).

I hope this helps or better yet share what you want to achieve.