We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Formula Based on Dates

bsolove123
6 - Meteoroid

I am trying to do a formula in the Effective Date Determination column. I am trying to get the workflow to do the follow:

 

1. If effective date2 is empty, then effective date1.

2. If effective date2 is not empty, but tax year beginning is less than or equal to effective date1, then effective date1.

3. If effective date2 is not empty, but tax year beginning is after effective date1, but before effective date 2, then effective date1.

4. if effective date2 is not empty and tax year beginning is after or equal to effective date2 then effective date2. 

 

You can see that the formula is not being applied properly to records 2 and 6. I've attached my test data and a screen shot of my formulas. Thanks in advance for your help!

 

 

     Workflow ResultsDesired Results 
Record IDTax Year BeginningTax Year EndingEffective Date1Effective Date2Effective Date DeterminationEffective Date Determination 
112/1/201911/30/20201/1/2020 1/1/20201/1/2020TRUE
212/1/201911/30/20201/1/20201/1/20211/1/20211/1/2020FALSE
31/1/202012/31/20201/1/2020 1/1/20201/1/2020TRUE
41/1/202012/31/20201/1/20201/1/20211/1/20201/1/2020TRUE
56/30/20205/31/20211/1/2020 1/1/20201/1/2020TRUE
66/30/20205/31/20211/1/20201/1/20211/1/20211/1/2020FALSE
71/1/202112/31/20211/1/2020 1/1/20201/1/2020TRUE
81/1/202112/31/20211/1/20201/1/20211/1/20211/1/2021TRUE
96/30/20215/31/20221/1/2020 1/1/20201/1/2020TRUE
106/30/20215/31/20221/1/20201/1/20211/1/20211/1/2021TRUE

 

bsolove123_0-1649435632349.png

 

 

1 REPLY 1
atcodedog05
22 - Nova
22 - Nova

Hi @bsolove123 

 

I would advice you to convert the dates to proper Alteryx dateformat (YYYY-MM-DD). Because currently its treated as a string and not as date. Please use  datetimeparse function to convert it to dates and after that your logic might work.

 

DateTimeParse()

atcodedog05_0-1649436011632.png

https://help.alteryx.com/20214/designer/datetime-functions

 

You can club datetimeprase function with multi-field formula tool to apply it on multiple columns here is an interactive lesson on it.

https://community.alteryx.com/t5/Interactive-Lessons/Multi-Field-Formulas/ta-p/424422

 

Hope this helps : )

 

Labels
Top Solution Authors