Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
Alteryx is here to help you solve your biggest data challenges. Read about the new Virtual Solution Center here.
SOLVED

calculate previous date

Highlighted
6 - Meteoroid

hi,

i have DATE field MONTH_YEAR WITH THE FORMAT '2018-07-01'- YYYY-MM-DD, which is CURRENT MONTH of each Customer

I have calculated PREVIOUS MONTH for each customer, so i have to put the condition FILTER where 

MONTH _YEAR = PREVIOUS+1

OR

PREVIOUS_MONTH = MONTH_YEAR + 1 

 

I have used this filter but its not working

[MONTH_YEAR]=DateTimeAdd([Previous_Month],1,"months")

 

can i get some help?

 

 

thanks

Highlighted
14 - Magnetar

Can you share a workflow and example data?

Highlighted
Alteryx Certified Partner

Hi @nidah5,

 

Your formula [MONTH_YEAR]=DateTimeAdd([Previous_Month],1,"months") looks like it should work fine, however it may be worth checking data types. Are both [MONTH_YEAR] and [Previous_Month] fields stored as date data types? Otherwise a screenshot of the error would make it a lot easier to diagnose.

 

If this solves your issue pleas mark the answer as correct, if not let me know!

 

Regards,

Jonathan

Highlighted
6 - Meteoroid

nidah5_0-1581583898208.png

 

Highlighted
6 - Meteoroid

yes, they all are in DATE format. 

17 - Castor
17 - Castor

Hi @nidah5 

 

DateTimeAdd() returns a DateTime data type, i.e. 2018-09-01 00:00:00.  Even though this represents the same period as 2018-09-01, Alteryx sees them as different.  Use this formula in your Filter

 

[MONTH_YEAR]=ToDate(DateTimeAdd([PREVIOUS_MONTH],1,"months"))

 

Dan

Labels