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 time function

phemala1
6 - Meteoroid

Hi - I need a help in formulating difference between two dates in Alteryx.

 

I have the formula : =MONTH($AB$1)-MONTH(AB23006)+(YEAR($AB$1)-YEAR(AB23006))*12 in excel, this formula will give difference between two dates in a number format.

 

could anyone help how can i formulate this in Alteryx. 

4 REPLIES 4
afv2688
16 - Nebula
16 - Nebula

Hi @phemala1 ,

 

You can use the ' DateTimeDiff(dt1,dt2,u) ' formula for that.

 

Just set   DateTimeDiff([DateEND],[DateSTART],"months")

 

cheers

phemala1
6 - Meteoroid

Thanks a lot. Yes i used the same formula only and tried in alteryx.

I'm comparing a constant date 04/30/2019 with different dates like 05/15/2019, 06/01/2019 i should get a result of 1 , 2 respectively. But when use the formula  DateTimeDiff([DateEND],[DateSTART],"months") all I'm getting in one month lag.

 

i have attached the excel out of the formula used which does not gives the proper result with that of expected result.

Kindly do the needful. 

afv2688
16 - Nebula
16 - Nebula

Hi @phemala1 ,

 

Use this then:

 

DateTimeMonth([Period])-DateTimeMonth([Aging from])+(DateTimeYear([Period])-DateTimeYear([Aging from]))*12+1

 

cheers

phemala1
6 - Meteoroid

Thanks a lot for your swift responses. It works. :) Cheers.

Labels