Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

Is there a limited to how many nested IF Then statements can be used in one statement?

Brad1
11 - Bolide

I have a pretty long nest of statements and it's returning one particular value that probably shouldn't be found at all.

 

It looks like this but goes on for a long way:

 

IF "AA" THEN "Afar" ELSEIF "AB" THEN "Abkhazian" ELSEIF "AF" THEN "Afrikaans" ELSEIF "AM" THEN "Amharic" ELSEIF "AR" THEN "Arabic" ELSEIF "AS" THEN "Assamese" ELSEIF "AY" THEN "Aymara" ELSEIF "AZ" THEN "Azerbaijani" ELSEIF "BA" THEN "Bashkir" ELSEIF "BE" THEN "Byelorussian" ELSEIF "BG" THEN "Bulgarian" ELSEIF "BH" THEN "Bihari" ELSEIF "BI" THEN "Bislama" ELSEIF "BN" THEN "Bengali" ELSEIF "BO" THEN "Tibetan" ELSEIF "BR" THEN "Breton" ELSEIF "CA" THEN "Catalan" ELSEIF "CO" THEN "Corsican" [.......] ELSE "" ENDIF

4 REPLIES 4
NicoleJohnson
ACE Emeritus
ACE Emeritus

I would suggest creating a Text Input table to feed into your data with a Find & Replace tool... so create a list like this:

 

AbbrName
AAAfar
ABAbkhazian
AF

Afrikaans

 etc...

 

Then Use the Find & Replace tool to connect this list to your original data, finding the code in the Abbr column and replacing it with the word in the Name column. That should help with eliminating the very long nested IF statement, as well as make it much easier to add to/modify the list of abbreviations/names after the fact!

 

NJ

 

Brad1
11 - Bolide

...So, I've never used that tool.  I do have the Code and the Language column in an Excel file.  I'll start researching that - if you have any additional info on how to go about setting that up - that would be great.  Thanks for all your help.   Greatly appreciated.

Brad1
11 - Bolide

I think we got it.  Thanks again.

itaiH
5 - Atom

.

Labels