Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
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
Master
Master

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
Master
Master

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.