<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Date difference issue in Alteryx Designer Desktop Discussions</title>
    <link>https://community.alteryx.com/t5/Alteryx-Designer-Desktop-Discussions/Date-difference-issue/m-p/73207#M25848</link>
    <description>&lt;P&gt;Can you calculate the difference in days instead of months, and round up/down based on the # of days?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Alternatively, if you converted PD date to the 1st of the month (DateTimeTrim formula should work), then you'd be able to compare 2017-07-01 to each of the SEDF dates, which might get you closer to the first option (0 and -1) that you were looking for... but it would change the last row to 2, which I'm not sure is correct either.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If either of these seem like options worth pursuing in more detail, let me know if you need some more tweaking!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;NJ&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 26 Jul 2017 15:04:43 GMT</pubDate>
    <dc:creator>NicoleJohnson</dc:creator>
    <dc:date>2017-07-26T15:04:43Z</dc:date>
    <item>
      <title>Date difference issue</title>
      <link>https://community.alteryx.com/t5/Alteryx-Designer-Desktop-Discussions/Date-difference-issue/m-p/73206#M25847</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to calculate a difference between two dates. Difference should be expressed in months. I would like to round it to full months (either up or down, I can adjust afterwards).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;At the moment I am using formula:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;DateTimeDiff([PD date],[SEDF date],"months")&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I am getting outputs with two differences the same as per below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;SPAN&gt;PD date&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD&gt;&lt;SPAN&gt;SEDF date&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD&gt;Month difference&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;SPAN&gt;2017-07-26&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD&gt;&lt;SPAN&gt;&amp;nbsp;2017-06-01&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;SPAN&gt;2017-07-26&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD&gt;&lt;SPAN&gt;2017-07-01&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;0&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Issue&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;SPAN&gt;2017-07-26&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD&gt;&lt;SPAN&gt;2017-08-01&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;0&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Issue&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;SPAN&gt;2017-07-26&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD&gt;&lt;SPAN&gt;2017-09-01&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD&gt;-1&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For some reason 26th Jul - 1st Jul = 0 and &lt;SPAN&gt;26th Jul - 1st Aug = 0. I need this to show 0 and -1 or 1 and 0.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Any ideas? Round and Ceil functions didn't work.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Viktor&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 24 May 2018 04:00:57 GMT</pubDate>
      <guid>https://community.alteryx.com/t5/Alteryx-Designer-Desktop-Discussions/Date-difference-issue/m-p/73206#M25847</guid>
      <dc:creator>Viktor1</dc:creator>
      <dc:date>2018-05-24T04:00:57Z</dc:date>
    </item>
    <item>
      <title>Re: Date difference issue</title>
      <link>https://community.alteryx.com/t5/Alteryx-Designer-Desktop-Discussions/Date-difference-issue/m-p/73207#M25848</link>
      <description>&lt;P&gt;Can you calculate the difference in days instead of months, and round up/down based on the # of days?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Alternatively, if you converted PD date to the 1st of the month (DateTimeTrim formula should work), then you'd be able to compare 2017-07-01 to each of the SEDF dates, which might get you closer to the first option (0 and -1) that you were looking for... but it would change the last row to 2, which I'm not sure is correct either.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If either of these seem like options worth pursuing in more detail, let me know if you need some more tweaking!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;NJ&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jul 2017 15:04:43 GMT</pubDate>
      <guid>https://community.alteryx.com/t5/Alteryx-Designer-Desktop-Discussions/Date-difference-issue/m-p/73207#M25848</guid>
      <dc:creator>NicoleJohnson</dc:creator>
      <dc:date>2017-07-26T15:04:43Z</dc:date>
    </item>
    <item>
      <title>Re: Date difference issue</title>
      <link>https://community.alteryx.com/t5/Alteryx-Designer-Desktop-Discussions/Date-difference-issue/m-p/73365#M25849</link>
      <description>&lt;P&gt;Thanks Nicole. Using days instead of months and then rounding after dividing by 30 worked great.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Viktor&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jul 2017 11:13:54 GMT</pubDate>
      <guid>https://community.alteryx.com/t5/Alteryx-Designer-Desktop-Discussions/Date-difference-issue/m-p/73365#M25849</guid>
      <dc:creator>Viktor1</dc:creator>
      <dc:date>2017-07-27T11:13:54Z</dc:date>
    </item>
    <item>
      <title>Re: Date difference issue</title>
      <link>https://community.alteryx.com/t5/Alteryx-Designer-Desktop-Discussions/Date-difference-issue/m-p/190491#M48725</link>
      <description>&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jul 2018 19:16:42 GMT</pubDate>
      <guid>https://community.alteryx.com/t5/Alteryx-Designer-Desktop-Discussions/Date-difference-issue/m-p/190491#M48725</guid>
      <dc:creator>MaverickVZ</dc:creator>
      <dc:date>2018-07-30T19:16:42Z</dc:date>
    </item>
    <item>
      <title>Re: Date difference issue</title>
      <link>https://community.alteryx.com/t5/Alteryx-Designer-Desktop-Discussions/Date-difference-issue/m-p/190494#M48727</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.alteryx.com/t5/user/viewprofilepage/user-id/15948"&gt;@Viktor1&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You might want to consider this solution too:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;DateTimeDiff(datetimetrim([SEDF date],"Month"),datetimetrim([PD date],"Month"),"Months")&lt;/PRE&gt;&lt;P&gt;The DateTimeTrim() function will cause the date to become the first of the month at 00:00:00 (a shortcut to the first of the month if you ever need it).&amp;nbsp; Then the DateTimeDiff() function will easily count the "Months" between the two dates.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Keep it simple.&amp;nbsp; (Simple is Hard podcast reference:&amp;nbsp;&lt;A href="https://community.alteryx.com/t5/Alter-Everything-Podcast/12-Simple-is-hard/ba-p/183130" target="_blank"&gt;Alter-Everything-Podcast/12-Simple-is-hard&lt;/A&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jul 2018 19:28:03 GMT</pubDate>
      <guid>https://community.alteryx.com/t5/Alteryx-Designer-Desktop-Discussions/Date-difference-issue/m-p/190494#M48727</guid>
      <dc:creator>MarqueeCrew</dc:creator>
      <dc:date>2018-07-30T19:28:03Z</dc:date>
    </item>
    <item>
      <title>Re: Date difference issue</title>
      <link>https://community.alteryx.com/t5/Alteryx-Designer-Desktop-Discussions/Date-difference-issue/m-p/191107#M48773</link>
      <description>&lt;P&gt;Mark,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for this. I was trying to get it to work by getting the month first using Datetimemonth and then using Datetimediff. That didn't work so I used the above solution but needed to add 1 to get the proper result. Both work, I think this is a bit cleaner. One of the things I love about Alteryx is there are many paths to the same solution. I had never used DateTimeTrim so now that's just another arrow in my quiver.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Pete&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jul 2018 11:48:37 GMT</pubDate>
      <guid>https://community.alteryx.com/t5/Alteryx-Designer-Desktop-Discussions/Date-difference-issue/m-p/191107#M48773</guid>
      <dc:creator>MaverickVZ</dc:creator>
      <dc:date>2018-07-31T11:48:37Z</dc:date>
    </item>
  </channel>
</rss>

