Alteryx Designer Desktop Discussions

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

Formula Date Range

ozzy78910
6 - Meteoroid

Struggling to crack the below formula. 

 

I need to replace a cell with the correct season by implementing a date range formula below:

 

IF [SO Type Desc]="Cust At-OnceCall-off" AND [CRD Dt]>="19.03.2019" and [CRD Dt]<="31.03.2019" THEN "SU19" ELSE [Season] ENDIF

 

The formula doesnt above doesnt seem to work as i believe its looking at anything greater than the 19.03.2019 separately to anything less than the 31.03.2019 meaning its replacing all the cells with SU19 when i only want it to change cells which has a date between the 19.03.2019 - 31.03.2019

 

Any help would be great (work flow attached)

 

thanks

ozzy

3 REPLIES 3
RobertOdera
13 - Pulsar

Hi there!

 

Try and use Alteryx syntax for date format "YYYY-MM-DD" like so using Multi-Field Formula Tool:

 

In the tool, Select Text Fields = Season, unchecked Copy Output Fields Add, unchecked Change Output Type to, paste the below in the Expression

 

IF [SO Type Desc] ="Cust At-OnceCall-off" AND
[CRD Dt] >="2019-03-19" AND
[CRD Dt]<="2019-03-31"
THEN "SU19" ELSE [_CurrentField_] ENDIF

 

Where _CurrentField_ == [Season]

 

Please see attachment; hopefully this works for you.

 

FYI you will need to connect your file to the input on the attachment. 

FYI the Filter tool used for validation purposes only...feel free to remove it once you confirm that the output is what you need.

ozzy78910
6 - Meteoroid

Thank you very much that has solved my issues!

 

Have a great day

 

Thanks

ozzy

RobertOdera
13 - Pulsar

You're most welcome!

Labels