Alteryx Designer Desktop Discussions

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

Date Comparisons

nervo1234
6 - Meteoroid

Hi,

 

I would like to create an Alteryx module to identify how many days since last login.  For example, if a user logs in on 1st January 2016, I would like to create a manipulated date of 1st January 2015 to get the figure of 365 days.

 

Currently doing this in Excel through the following formula: =IFERROR(DATE(2015,1,1)-DATEVALUE(TEXT(R3544,"dd/mm/yyyy")),"")

 

Hope this makes sense and would really appreciate any feedback

 

Thanks

7 REPLIES 7
hda_wesleyjwk
7 - Meteor

Hi Nervo,

 

I'm trying to understand your question.

 

Do you simply want the days since last login (i.e. if your last login is January 1st 2016, you could add a formula that specifies "DateTimeDiff(DateTimeToday(),login_date,'days')" ). This would return the number of days since last login relative to today.

 

 

nervo1234
6 - Meteoroid

Correct, but I would also like to manipulate today's date to my own preset date. 

 

So for example, rather than using today's date (3rd February), I may want to define today's date as 1st February which you can do in Excel using the =DATE function

 

Thank you.

RodL
Alteryx Alumni (Retired)

One thought would be to create a Constant (under the Workflow Configuration tab) that you can then reference through the workflow.

hda_wesleyjwk
7 - Meteor

Indeed, or you could hardcode it into your formula:

 

DateTimeDiff("2015-01-01",login_date,'days')

nervo1234
6 - Meteoroid
Thank you, that's really helpful

DateTimeDiff (<date/time1>, <date/time2>, <units>)

So if hardcode the date into <date/time1>, is it possible to use the <date/time2> to lookup a date field within my original data set and performance the variance between the two days?
hda_wesleyjwk
7 - Meteor

Hi nervo,

 

Indeed. See below picture for an example. The text input could be replaced by an Excel or Database, wherever you store your data.

 

Showcase Date Alteryx.jpg

nervo1234
6 - Meteoroid

Thank you for the help, much appreciated.

Labels