Date Comparisons
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
Solved! Go to Solution.
- Labels:
- Common Use Cases
- Date Time
- Workflow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
One thought would be to create a Constant (under the Workflow Configuration tab) that you can then reference through the workflow.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Indeed, or you could hardcode it into your formula:
DateTimeDiff("2015-01-01",login_date,'days')
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thank you for the help, much appreciated.