<?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: Quarter formula in Workato Pros Discussion Board</title>
    <link>https://systematic.workato.com/t5/workato-pros-discussion-board/quarter-formula/m-p/2360#M1005</link>
    <description>&lt;P&gt;You could also divide the month by 3 and add 1 instead of using a map or lookup table. I think you'd have to convert the output from strftime to an integer with to_i and then convert back, so the formula may get complicated, but could save building a lookup.&lt;/P&gt;</description>
    <pubDate>Thu, 10 Feb 2022 22:07:06 GMT</pubDate>
    <dc:creator>jonathan-wood</dc:creator>
    <dc:date>2022-02-10T22:07:06Z</dc:date>
    <item>
      <title>Quarter formula</title>
      <link>https://systematic.workato.com/t5/workato-pros-discussion-board/quarter-formula/m-p/2357#M1002</link>
      <description>&lt;P&gt;How to get which quarter from the date format 2022-01-31&lt;BR /&gt;Is there any formula to get, quarters ( Q1, Q2, Q3,Q4)  from the date &lt;/P&gt;</description>
      <pubDate>Thu, 10 Feb 2022 21:08:44 GMT</pubDate>
      <guid>https://systematic.workato.com/t5/workato-pros-discussion-board/quarter-formula/m-p/2357#M1002</guid>
      <dc:creator>nvinay091</dc:creator>
      <dc:date>2022-02-10T21:08:44Z</dc:date>
    </item>
    <item>
      <title>Re: Quarter formula</title>
      <link>https://systematic.workato.com/t5/workato-pros-discussion-board/quarter-formula/m-p/2358#M1003</link>
      <description>&lt;P&gt;I never found a great way to do this. Best options I found were using strftime to get month from date then using a hash mapping to get quarter (then append year). Lookup table is an option as well. If you are working with a system that has a table of fiscal quarters already with start/end dates, you can search that system with date parameters (e.g. NetSuite).&lt;/P&gt;</description>
      <pubDate>Thu, 10 Feb 2022 21:48:01 GMT</pubDate>
      <guid>https://systematic.workato.com/t5/workato-pros-discussion-board/quarter-formula/m-p/2358#M1003</guid>
      <dc:creator>jblanchett</dc:creator>
      <dc:date>2022-02-10T21:48:01Z</dc:date>
    </item>
    <item>
      <title>Re: Quarter formula</title>
      <link>https://systematic.workato.com/t5/workato-pros-discussion-board/quarter-formula/m-p/2359#M1004</link>
      <description>&lt;P&gt;Hey there!&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;One way to do this would be to create a lookup table mapping months to quarters. This works even if you have a non-standard financial year. Here's an example table:&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;You can then use the lookup table action to get the quarter from a date. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that to do this, i've used formulas to:&lt;/P&gt;&lt;P&gt;* change the date to a string format&lt;/P&gt;&lt;P&gt;* split it by the "-" character to give a list that will look like ["2021", "04", "12"]&lt;/P&gt;&lt;P&gt;* selected the second element of the list, which will be the month.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;The returned quarter value is will now be available in the recipe data widget and I can map it wherever I need.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Feb 2022 22:04:28 GMT</pubDate>
      <guid>https://systematic.workato.com/t5/workato-pros-discussion-board/quarter-formula/m-p/2359#M1004</guid>
      <dc:creator>kale-bogdanovs</dc:creator>
      <dc:date>2022-02-10T22:04:28Z</dc:date>
    </item>
    <item>
      <title>Re: Quarter formula</title>
      <link>https://systematic.workato.com/t5/workato-pros-discussion-board/quarter-formula/m-p/2360#M1005</link>
      <description>&lt;P&gt;You could also divide the month by 3 and add 1 instead of using a map or lookup table. I think you'd have to convert the output from strftime to an integer with to_i and then convert back, so the formula may get complicated, but could save building a lookup.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Feb 2022 22:07:06 GMT</pubDate>
      <guid>https://systematic.workato.com/t5/workato-pros-discussion-board/quarter-formula/m-p/2360#M1005</guid>
      <dc:creator>jonathan-wood</dc:creator>
      <dc:date>2022-02-10T22:07:06Z</dc:date>
    </item>
    <item>
      <title>Re: Quarter formula</title>
      <link>https://systematic.workato.com/t5/workato-pros-discussion-board/quarter-formula/m-p/2361#M1006</link>
      <description>&lt;P&gt;You can consider using a Formula that uses conditions based on the Month value of the date. It is possible to string Ternary logic together to get the quarter output from a formula.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Feb 2022 23:57:12 GMT</pubDate>
      <guid>https://systematic.workato.com/t5/workato-pros-discussion-board/quarter-formula/m-p/2361#M1006</guid>
      <dc:creator>jeff-allen</dc:creator>
      <dc:date>2022-02-10T23:57:12Z</dc:date>
    </item>
    <item>
      <title>Re: Quarter formula</title>
      <link>https://systematic.workato.com/t5/workato-pros-discussion-board/quarter-formula/m-p/2362#M1007</link>
      <description>&lt;DIV dir="ltr"&gt;Not that I am aware of. Though you may consider using a function to calculate it. Use logger to test and replace "date" with whatever variable you want to use to determine the quarter. You may use now for that as well... see below. If your quarters line up&amp;nbsp;differently to months, edit the below however you see fit.&lt;DIV&gt;&lt;BR /&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT&gt;date.strftime("%mm").match?(01|02|03) ? "q1" :&lt;BR /&gt;date.strftime("%mm").match?(04|05|06) ? "q2" :&lt;BR /&gt;date.strftime("%mm").match?(07|08|09) ? "q3" :&lt;BR /&gt;date.strftime("%mm").match?(10|11|12) ? "q4" :&lt;BR /&gt;""&lt;/FONT&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;BR /&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;BR clear="all" /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 15 Feb 2022 03:19:25 GMT</pubDate>
      <guid>https://systematic.workato.com/t5/workato-pros-discussion-board/quarter-formula/m-p/2362#M1007</guid>
      <dc:creator>vinny-sosa</dc:creator>
      <dc:date>2022-02-15T03:19:25Z</dc:date>
    </item>
    <item>
      <title>Re: Quarter formula</title>
      <link>https://systematic.workato.com/t5/workato-pros-discussion-board/quarter-formula/m-p/2363#M1008</link>
      <description>&lt;P&gt;Looks like the quarter is not a Ruby default method, so the way we can do this is use one of the code connectors like JavaScript. Here is an example how it will look like. Given the input_date is the date you want to calculate quarter for (or you can just type today in formula. We return quarter as output.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;A href="https://d3evbfoo20rmgo.cloudfront.net/uploads/posts/images/1644910345bf1845b1-07a1-4839-ac73-e2d75aceeb6a.png" target="_blank" rel="noreferrer noopener"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;1. add JavaScript connector&lt;/P&gt;&lt;P&gt;2. Create input called input_date with type date&lt;/P&gt;&lt;P&gt;3. create output quarter of type integer&lt;/P&gt;&lt;P&gt;4. add this code snippet: &lt;/P&gt;&lt;P&gt;exports.main = ({input_date}) =&amp;gt; {&lt;/P&gt;&lt;P&gt;  var today = new Date(input_date)&lt;/P&gt;&lt;P&gt;  var quarter = Math.floor((today.getMonth() + 3) / 3);&lt;/P&gt;&lt;P&gt;  return { quarter };&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;</description>
      <pubDate>Tue, 15 Feb 2022 15:32:30 GMT</pubDate>
      <guid>https://systematic.workato.com/t5/workato-pros-discussion-board/quarter-formula/m-p/2363#M1008</guid>
      <dc:creator>max-knutsson</dc:creator>
      <dc:date>2022-02-15T15:32:30Z</dc:date>
    </item>
  </channel>
</rss>

