Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

Elseif condition with AND formula help

ervelasco
5 - Atom

I had the following formula built:

If [Material] = 4528638001 then 7.00
Elseif [Material] = 4980263001 then 8.75
Elseif [Material] = 5509661001 then 22.5
Elseif [Material] = 6908349001 then 53.81
Elseif [Material] = 8256292001 then 20.00
Elseif [Material] = 7748906001 then 7.00
Else "Error"
Endif

 

....but needed to add a condition to one of the line items based off a date. 

 

If [Material] = 4528638001 then 7.00
Elseif [Material] = 4980263001 then 8.75
Elseif [Material] = 5509661001 and [Order Date] < 2/1/2020 then 22.5
Elseif [Material] = 5509661001 and [Order Date] >= 2/1/2020 then 6.50
Elseif [Material] = 6908349001 then 53.81
Elseif [Material] = 8256292001 then 20.00
Elseif [Material] = 7748906001 then 7.00
Else "Error"
Endif

 

Once I added this condition, no data is coming back for this Material. Any solutions for why Alteryx isn't able to read my conditional AND statement? Fixes/work-arounds? 

3 REPLIES 3
grossal
15 - Aurora
15 - Aurora

Hi @ervelasco,

 

your date needs to be wrapped in quotes and the right format.

 

Try this:

 

If [Material] = 4528638001 then 7.00
Elseif [Material] = 4980263001 then 8.75
Elseif [Material] = 5509661001 and [Order Date] < "2020-01-02" then 22.5
Elseif [Material] = 5509661001 and [Order Date] >= "2020-01-02" then 6.50
Elseif [Material] = 6908349001 then 53.81
Elseif [Material] = 8256292001 then 20.00
Elseif [Material] = 7748906001 then 7.00
Else "Error"
Endif

 

Let me know if it works.

 

Best

Alex 

MarqueeCrew
20 - Arcturus
20 - Arcturus

@ervelasco ,

 

Please make sure that your dates are in the format of:  YYYY-MM-DD.

 

If [Material] = 4528638001 then 7.00
Elseif [Material] = 4980263001 then 8.75
Elseif [Material] = 5509661001 and [Order Date] < "2020/02/01" then 22.5
Elseif [Material] = 5509661001 and [Order Date] >= "2020-02-01" then 6.50
Elseif [Material] = 6908349001 then 53.81
Elseif [Material] = 8256292001 then 20.00
Elseif [Material] = 7748906001 then 7.00
Else "Error"
Endif

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
ervelasco
5 - Atom

Thanks Alex - once I reformatted the date it is working! 

Labels