Alteryx Designer Desktop Discussions

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

malformed if statement - Date

Chunbin
6 - Meteoroid

Hi I am trying to add a custom filter by apply IF functions but it doesnt seem worked.

 

how can I optimise the formula?

 

Thanks 

 

IIF([Sales Date]>("07/02/2016"),[Post Sector]<("05/04/2016"),"Yes","No")

 

5 REPLIES 5
JordanB
Alteryx
Alteryx

Hi @Chunbin

 

I just tested this formula and it worked: IIF([Sales Date]>="07/02/2016" AND [Post Sector]<="05/04/2016", "YES", "NO")

 

I have also attached a workflow built in Alteryx 10.6 which shows the calculation. I used <= & >=  because of my dataset. 

 

Best,

 

Jordan Barker

Solutions Consultant

Chunbin
6 - Meteoroid

Hi @ JordanB

 

Thank you for the solution and this time ths formula is valid to go forward but will the result has return will all "NO".

 

I basically need to select data from the date range between 08/02/2016 to 04/04/2016.

 

Thanks

JordanB
Alteryx
Alteryx

@Chunbin

 

The formula tool will look on a row by row basis so it depends how your data is orientated. 

 

For Example:

If you have fields side by side 

Date1                       Date 2

2015-01-01              2016-01-01

 

The formaul is going to look at this row.

 

Can you provide some sameple dat or layout of fields. 

 

Best,

 

Jordan 

Chunbin
6 - Meteoroid

hi Jordan

 

I have written the date as 08/02/2016 which alteryx cant recongnise so I have change it to 2016-02-08.

 

 

It is now work!!

 

Thank you for your help

 

Chunbin

LMB
6 - Meteoroid

switch the < and >

Labels