Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

General Discussions

Discuss any topics that are not product-specific here.
SOLVED

Ranged Formula tool issue

Madzy
7 - Meteor

Hey I am having an issue with my formula tool regarding on doing a ranged formula. 

IF [Days] >= "0" AND [Days] < "30" THEN
"0 - 30 Days"
elseif [Days] >= "30" AND [Days] < "60" THEN
"30 - 60 Days"
elseif [Days] >= "60" AND [Days] < "90" THEN
"60 - 90 Days"
elseif [Days] >= "90" THEN
"Greater 90 Days"
else Null()
endif

This is y formula but it is spouting out 

Madzy_1-1682948334132.png

Where I want those to be > 90 days. Any suggestions? 

BTW The days columns is being generated by a formula --> DateTimeDiff(DateTimeToday(),[Invoice Date],'days')

1 REPLY 1
DataNath
17 - Castor
17 - Castor

Hey @Madzy, the issue here lies with using the wrong data types. When making your [Days] field, make sure it's numeric (options in the dropdown):

 

DataNath_0-1682948757918.png

 

Then, for your [>= Days] field, write this without the quotes around the numbers:

 

IF [Days] >= 0 AND [Days] < 30 THEN
"0 - 30 Days"
elseif [Days] >= 30 AND [Days] < 60 THEN
"30 - 60 Days"
elseif [Days] >= 60 AND [Days] < 90 THEN
"60 - 90 Days"
elseif [Days] >= 90 THEN
"Greater 90 Days"
else Null()
endif

 

DataNath_1-1682948828677.png

Labels
Top Solution Authors