<?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: formula to find first day of the last month in Alteryx Designer Desktop Discussions</title>
    <link>https://community.alteryx.com/t5/Alteryx-Designer-Desktop-Discussions/formula-to-find-first-day-of-the-last-month/m-p/446514#M85583</link>
    <description>Thank you. I will give a try. This is the query i have built. As i mentionned before it works perfectly during current month. My issue is - i would like it to bring back data for previous month when current day is 1st of any month. I have attached my Workflow. time range in SQL Query is looking at c.GREGORIAN_DATE Between Date '2019-01-01' And Date - 1</description>
    <pubDate>Thu, 01 Aug 2019 14:00:39 GMT</pubDate>
    <dc:creator>novice1</dc:creator>
    <dc:date>2019-08-01T14:00:39Z</dc:date>
    <item>
      <title>formula to find first day of the last month</title>
      <link>https://community.alteryx.com/t5/Alteryx-Designer-Desktop-Discussions/formula-to-find-first-day-of-the-last-month/m-p/446447#M85555</link>
      <description>hello, My Alteryx workflow shows daily activity for the current month. However on the first of the month it shows a blank data since my data is always day behind. I would like it to show everyday of the previous month on day 1 of the current month. I have the formula to only show the month up to previous day, but my issue is on the 1st of the month. Since I have a relative date set to current month it does not show the previous months data. I either need some way to set the relative date dynamically by looking to see if today is the first and set to previous month or be able to set a relative date to yesterday. This issue is only on the first day of the month. Every other day is fine since the previous day and current month are within the same month. here is the formulas i am using for current month this year and current month last year. how does these need to modified to get me desired results? DateTimeAdd(DateTimeToday(),(DateTimeDay(DateTimeToday())-1)*-1,"days") DateTimeAdd(DateTimeTrim(DateTimeToday(),"firstofmonth"),-1,"years") any help would be much appreciated. thank you</description>
      <pubDate>Thu, 01 Aug 2019 11:11:07 GMT</pubDate>
      <guid>https://community.alteryx.com/t5/Alteryx-Designer-Desktop-Discussions/formula-to-find-first-day-of-the-last-month/m-p/446447#M85555</guid>
      <dc:creator>novice1</dc:creator>
      <dc:date>2019-08-01T11:11:07Z</dc:date>
    </item>
    <item>
      <title>Re: formula to find first day of the last month</title>
      <link>https://community.alteryx.com/t5/Alteryx-Designer-Desktop-Discussions/formula-to-find-first-day-of-the-last-month/m-p/446452#M85557</link>
      <description>IF Datetimetoday() = datetimefirstofmonth() then datetimeadd(datetimetoday(),-1,days) else datetimetoday() endif&lt;BR /&gt;&lt;BR /&gt;This will provide you with yesterdays date if it's the 1st of the month, otherwise it will return the date today.&lt;BR /&gt;&lt;BR /&gt;Ben</description>
      <pubDate>Thu, 01 Aug 2019 11:34:26 GMT</pubDate>
      <guid>https://community.alteryx.com/t5/Alteryx-Designer-Desktop-Discussions/formula-to-find-first-day-of-the-last-month/m-p/446452#M85557</guid>
      <dc:creator>BenMoss</dc:creator>
      <dc:date>2019-08-01T11:34:26Z</dc:date>
    </item>
    <item>
      <title>Re: formula to find first day of the last month</title>
      <link>https://community.alteryx.com/t5/Alteryx-Designer-Desktop-Discussions/formula-to-find-first-day-of-the-last-month/m-p/446466#M85564</link>
      <description>thank you. but this still brings me back 01/08/2019. this would work through the month, but not on the 1st day of current month i need to see result for the first day of the previous month if today is 1st of the month so the result i am looking for today is 01/07/2019</description>
      <pubDate>Thu, 01 Aug 2019 11:53:32 GMT</pubDate>
      <guid>https://community.alteryx.com/t5/Alteryx-Designer-Desktop-Discussions/formula-to-find-first-day-of-the-last-month/m-p/446466#M85564</guid>
      <dc:creator>novice1</dc:creator>
      <dc:date>2019-08-01T11:53:32Z</dc:date>
    </item>
    <item>
      <title>Re: formula to find first day of the last month</title>
      <link>https://community.alteryx.com/t5/Alteryx-Designer-Desktop-Discussions/formula-to-find-first-day-of-the-last-month/m-p/446496#M85575</link>
      <description>&lt;P&gt;Is this what you're looking for?&amp;nbsp; If not, can you provide some examples?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Start Date:&lt;/P&gt;&lt;P&gt;IF DateTimeDay(Datetimetoday()) = 1 then&lt;BR /&gt;datetimeadd(datetimetoday(),-1,"months")&lt;BR /&gt;else&lt;BR /&gt;datetimefirstofmonth()&lt;BR /&gt;endif&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;End Date:&lt;/P&gt;&lt;P&gt;IF DateTimeDay(Datetimetoday()) = 1 then&lt;BR /&gt;datetimeadd(DateTimeLastOfMonth(),-1,"months")&lt;BR /&gt;else&lt;BR /&gt;DateTimeLastOfMonth()&lt;BR /&gt;endif&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.JPG" style="width: 513px;"&gt;&lt;img src="https://community.alteryx.com/t5/image/serverpage/image-id/72137i8DE2D35B73735E9B/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.JPG" alt="Capture.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Aug 2019 13:36:14 GMT</pubDate>
      <guid>https://community.alteryx.com/t5/Alteryx-Designer-Desktop-Discussions/formula-to-find-first-day-of-the-last-month/m-p/446496#M85575</guid>
      <dc:creator>ChrisTX</dc:creator>
      <dc:date>2019-08-01T13:36:14Z</dc:date>
    </item>
    <item>
      <title>Re: formula to find first day of the last month</title>
      <link>https://community.alteryx.com/t5/Alteryx-Designer-Desktop-Discussions/formula-to-find-first-day-of-the-last-month/m-p/446514#M85583</link>
      <description>Thank you. I will give a try. This is the query i have built. As i mentionned before it works perfectly during current month. My issue is - i would like it to bring back data for previous month when current day is 1st of any month. I have attached my Workflow. time range in SQL Query is looking at c.GREGORIAN_DATE Between Date '2019-01-01' And Date - 1</description>
      <pubDate>Thu, 01 Aug 2019 14:00:39 GMT</pubDate>
      <guid>https://community.alteryx.com/t5/Alteryx-Designer-Desktop-Discussions/formula-to-find-first-day-of-the-last-month/m-p/446514#M85583</guid>
      <dc:creator>novice1</dc:creator>
      <dc:date>2019-08-01T14:00:39Z</dc:date>
    </item>
    <item>
      <title>Re: formula to find first day of the last month</title>
      <link>https://community.alteryx.com/t5/Alteryx-Designer-Desktop-Discussions/formula-to-find-first-day-of-the-last-month/m-p/446519#M85587</link>
      <description>I will try to work around it. i think i need to modify my SQL query. Open to suggestions. Thank you.</description>
      <pubDate>Thu, 01 Aug 2019 14:05:26 GMT</pubDate>
      <guid>https://community.alteryx.com/t5/Alteryx-Designer-Desktop-Discussions/formula-to-find-first-day-of-the-last-month/m-p/446519#M85587</guid>
      <dc:creator>novice1</dc:creator>
      <dc:date>2019-08-01T14:05:26Z</dc:date>
    </item>
    <item>
      <title>Re: formula to find first day of the last month</title>
      <link>https://community.alteryx.com/t5/Alteryx-Designer-Desktop-Discussions/formula-to-find-first-day-of-the-last-month/m-p/1097202#M272046</link>
      <description>&lt;P&gt;I know this post was a few years ago now but figured I would offer a solution in case anybody else comes across this issue. You already have the logic in place to determine if it is the first of the month.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you are looking to get the date for the first of the previous month it can be accomplished with this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DateTimeAdd(DateTimeFirstOfMonth(), -1, 'months')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Apologies if it has since been solved&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Mar 2023 18:11:12 GMT</pubDate>
      <guid>https://community.alteryx.com/t5/Alteryx-Designer-Desktop-Discussions/formula-to-find-first-day-of-the-last-month/m-p/1097202#M272046</guid>
      <dc:creator>Goldrickd</dc:creator>
      <dc:date>2023-03-15T18:11:12Z</dc:date>
    </item>
  </channel>
</rss>

