Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Taylorcc
Contributor III
Contributor III

Create a new field in script with IF statement

Hello, 

I am wanting to create a new field based of two current fields in my data set 

My current fields are CareClient and Focus, i would like to create the field CosNps

I am trying the below with no luck - can anyone see where i am going wrong? 

if(CareClient='Yes', 'Continuity of support',

if(CareClient='No' and Focus='Psychosocial support',
'National psychosocial support measure',

if(Focus='Clinical care coordination',
'Clinical care coordination',

'Other') as CosNps

 

Thank you !

 

Labels (2)
1 Solution

Accepted Solutions
Vegar
MVP
MVP

It looks like you are missing a couple of  closing paranthesis. 

if(CareClient='Yes',

   'Continuity of support',

   if(CareClient='No' and Focus='Psychosocial support',

        'National psychosocial support measure',

         If( Focus='Clinical care coordination',

               'Clinical care coordination',

                'Other')

)) as CosNps

View solution in original post

2 Replies
Vegar
MVP
MVP

It looks like you are missing a couple of  closing paranthesis. 

if(CareClient='Yes',

   'Continuity of support',

   if(CareClient='No' and Focus='Psychosocial support',

        'National psychosocial support measure',

         If( Focus='Clinical care coordination',

               'Clinical care coordination',

                'Other')

)) as CosNps

Taylorcc
Contributor III
Contributor III
Author

That worked perfectly, thanks so much!