In case you missed the announcement: Alteryx One is here, and so is the Spring Release! Learn more about these new and exciting releases here!

Alteryx Designer Desktop Discussions

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

Nested and multiple If else statements

Mj9715
8 - Asteroid

Hi All, I have a field denoting number of years as shown below and based on the value, I need to categorize as mentioned buckets as a new column. I tried standard if, if else statements and alteryx is giving me the malformed function cell error. Please can someone tell me the best way to categorize this ? Attached input and output col in file. 

  • <1 year
  • 1-2 years
  • 2-5 years
  • 5-7 years
  • 7-10 years
  • 10-25 years
  • >25 years

 

 No of years 
                (0.56)
                  0.73
                  1.70
                24.46
                23.46
                17.05
                (0.56)
                  4.45
                  6.96
                13.45
                18.33
                17.05
                  4.45
                24.46
                17.05
                  1.10
                17.05
                24.46
                23.46
                24.46
                23.46
                24.46
3 REPLIES 3
messi007
15 - Aurora
15 - Aurora

@Mj9715,

 

Please see below how you can do it 

 

messi007_0-1638173348182.png

 

Attached the workflow.

Regards,

Mj9715
8 - Asteroid

Hi @messi007 - I had tried this exact formula and so far so good, the syntax shows up well. The minute I finish typing "endif" , the formula shows an error. Please can you refer to screenshot one and two respectively and see what I am doing wrong?

 

 

Mj9715_1-1638175378881.png

 

Mj9715_2-1638175417626.png

 

 

 

afv2688
16 - Nebula
16 - Nebula

Hello @Mj9715 ,

 

This usually means that you have the field in the incorrect data type. For example, if you are trying in this case to apply a comparative between to values and one of them is a string, it doesn't make a sense for it. You need to transform them into a number field:

 

Untitled.png

 

Untitled2.png

 

Regards

Labels
Top Solution Authors