Advent of Code is now back for a limited time only! Complete as many challenges as you can to earn those badges you may have missed in December. Learn more about how to participate here!
Start Free Trial

Alteryx Designer Desktop Discussions

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

If function error

AJ_AJ
7 - Meteor

Hi Guys,

 

I'm new to Alteryx.

 

I'm facing issues using If condition in my workflow. I guess the issue is with the String used.

My output what I need is if the if the days are more that 365 I want it to say "LT" if not then "ST"

 

Can someone help me with the issue. I have attached my sample workflow here.

 

Thanks for helping in advance.

2 REPLIES 2
afv2688
16 - Nebula
16 - Nebula

Hello @AJ_AJ ,

 

When you put a number within quotes "365" means that you are using a string and not a number. If you want it to work first you have to change te value to number:

 

IF ToNumber([# Days])>365 THEN "LT" ELSE "ST" ENDIF

 

This way it should work

 

Cheers

 

 

danilang
19 - Altair
19 - Altair

Hi @AJ_AJ 

 

 

The Select in your workflow converts [# Days] to a string.  Why do this if you want to do numerical comparisons further on?  I don't have your input xlsx file, but I would guess that [# Days] is being read as a number.  If you leave [# Days] as a number, you don't need ToNumber() when using it formulas. 

 

Dan

Labels
Top Solution Authors