Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Date conversion

RaviTeja_1001
7 - Meteor

Hi,

 

I'm trying to write a formula to check between supply date and Bill date. 

Lets assume we have supply date as 29th Feb 2020 and bill date as 15th Mar 2020.

 

If month and year in supply date (Feb 2020 in this case) = month and year in bill date (Mar 2020)

Then take month and year in Bill date (Mar 2020) if not then give "Prior to month and year in Bill date (Prior to Mar 2020).

 

Below is the formula that i have used. Can some please help me in this?

 

Also attached sample data.

 

If DateTimeFormat([SUPPLY_DT],'%MMM-%YYYY')=DateTimeFormat([BILL_DT],'%MMM-%YYYYY')
THEN DateTimeFormat([BILL_DT],'%MMM-%YYYYY')
ELSE "Prior to"+ DateTimeFormat([BILL_DT],'%MMM-%YYYYY')
ENDIF

 

Thanks 

4 REPLIES 4
atcodedog05
22 - Nova
22 - Nova

Hi @RaviTeja_1001 ,

 

You again missed out on the data file.

 

You need to save it as packaged workflow if the data needs to intact.

 

https://www.thedataschool.co.uk/stephanie-kearns/save-alteryx-workflow-packaged-file/

RaviTeja_1001
7 - Meteor

HI,

 

thanks for the link. 

 

Please Now i have savved the data as workflow. 

 

Please find the attached.

atcodedog05
22 - Nova
22 - Nova

Hi @RaviTeja_1001 ,

 

Here is an approach to achieve the purpose.

atcodedog05_0-1589624054727.png

IF DateTimeFormat(DateTimeParse([BILL_DT],"%d-%b-%y"),"%m-%y")=DateTimeFormat([SUPPLY_DT],"%m-%y")
THEN DateTimeFormat([SUPPLY_DT],"%b-%Y")
ELSE "Prior to"+ DateTimeFormat([SUPPLY_DT],"%b-%Y")
ENDIF

 

Hope this helps : )

 

RaviTeja_1001
7 - Meteor

Hi,

 

Thank you very much.

Labels