Alteryx Designer Desktop Discussions

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

Age brackets

Devika
8 - Asteroid

Hello,

 

Wantedto set aging bracket for the attached data.

0-4
5-14
15-30
31 Above

 

3 REPLIES 3
Jonathan-Sherman
15 - Aurora
15 - Aurora

Hi @Devika,

 

This can be completed with a simple formula:

 

If [Age] <= 4 THEN '0-4'
ELSEIF [Age] <= 14 THEN '5-14'
ELSEIF [Age] <= 30 THEN '15-30'
ELSE '31 Above'
ENDIF

 

image.png

 

If this solves your issue please mark the answer as correct, if not let me know! I've attached my workflow for you to download if needed.

 

Regards,

Jonathan

Devika
8 - Asteroid

Hello Jonathan,

 

i tired using the same formula that you mentioned but the third line of the formula is not getting accepted.

once i select the Third AGE then the whole formula gets invalid 

Jonathan-Sherman
15 - Aurora
15 - Aurora

Perhaps your [Age] field is being stored as a string rather than numeric. Could you try:

 

IF ToNumber([Age]) <= 4 THEN '0-4'
ELSEIF ToNumber([Age]) <= 14 THEN '5-14'
ELSEIF ToNumber([Age]) <= 30 THEN '15-30'
ELSE '31 Above'
ENDIF

 

If this solves your issue please mark the answer as correct, if not let me know!

 

Regards,

Jonathan

Labels