Start Free Trial

Alteryx Designer Desktop Discussions

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

Two Nested IIF

Jerlyn05
5 - Atom

Hi,

Can anyone please help me what I did wrong on the second formula. I can't seem to make the Aging Bucket field work.

NESTED IIF.PNG

2 REPLIES 2
Qiu
21 - Polaris
21 - Polaris

@Jerlyn05 
You only provide the upper bounding, while missing lower bonding,

it should be something like "[Current Age] >= 0 and [Current Age] <= 14". 

ntakeda
12 - Quasar

2025-04-11_13h59_31.png

The "y" is missing.
This isn’t related to the error, but the inequality signs (> 60) are also reversed.

Either of the following will work:

 

IIF([TASK_ID] = "" OR IsNull([TASK_ID]), "", 
    IIF([Current Age] <= 14, "0-14",
    IIF([Current Age] <= 19, "15-19",
    IIF([Current Age] <= 24, "20-24",
    IIF([Current Age] <= 29, "25-29",
    IIF([Current Age] <= 39, "30-39",
    IIF([Current Age] <= 59, "40-59",
    IIF([Current Age] > 60, "60+",
    "unknown")))))))
)

 

IIF([TASK_ID] = "" OR IsNull([TASK_ID]), "", 
    IIF([Current Age] <= 14, "0-14",
    IIF([Current Age] <= 19, "15-19",
    IIF([Current Age] <= 24, "20-24",
    IIF([Current Age] <= 29, "25-29",
    IIF([Current Age] <= 39, "30-39",
    IIF([Current Age] <= 59, "40-59",
    "60+"))))))
)

 

2025-04-11_14h04_34.png

Labels
Top Solution Authors