Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

Parse Error help

aberthiaume
8 - Asteroid

I am getting a parse error at the last character of my formula, but no error is showing in the code.  I was wonderinfg if someone could take a look and see what I am missing.  I have tried to re create the formula and the same thing happens.  Any insight you have would be greatly appreciatated.  Here is a screen shot and the code itself.  

 

aberthiaume_0-1660926411176.png

 

 

if contains([Name2],"Accountability") then "Accountability" else if contains ([Name2],"Leadership and Culture") then "Leadership and Culture" else if contains ([Name2],"Policies and Procedures") then "Policies and Procedures" else if contains ([Name2],"Track, Monitor, Report and Respond to Data") then "Track, Monitor, Report and Respond to Data" else if contains ([Name2], "Patient and Family/Caregiver Education") then "Patient and Family/Caregiver Education" else if contains ([Name2],"Pain Management") then "Pain Management" else if contains ([Name2],"Prescriber and Staff Education and Competency") then "Prescriber and Staff Education and Competency" else if contains ([Name2],"Technical Support") then "Technical Support" else if contains ([Name2],"Tapering") then "Tapering" else if contains ([Name2],"OUD & MAT") then "OUD & MAT" else if contains([Name2],"Community Collaboration") then "Community Collaboration" else "" endif

 

2 REPLIES 2
Luke_C
17 - Castor
17 - Castor

Hi @aberthiaume 

 

Change all of your 'else if's to be 'elseif' with no space. 

Maskell_Rascal
13 - Pulsar

Hi @aberthiaume 

 

@Luke_C is 100% correct on the formula issue, but I want to address something else with your request.

 

This formula will be an enormous pain to maintain on a regular basis if anything changes or someone else needs to take over this workflow. I would instead recommend using a reference file and the Find Replace tool to match these values and append them to your output. 

 

Maskell_Rascal_0-1660929339006.png

 

Take a look at the workflow attached. I think you'll find this method is a lot easier to manage when working with multiple references as opposed to writing giant IF THEN CONTAINS statements.  

 

Cheers!

Phil

 

 

Labels
Top Solution Authors