<?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 Convert daily Dates to Australian Financial Year quarters (July - Sept, Oct - Dec etc) in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Convert-daily-Dates-to-Australian-Financial-Year-quarters-July/m-p/397693#M25569</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to create (or change) the 'event_dt' variable to match the relevant Australian Financial year quarters by several years;&lt;/P&gt;&lt;P&gt;qtr 1 = Jul - Sep&lt;/P&gt;&lt;P&gt;Qtr 2 = Oct - Dec&lt;/P&gt;&lt;P&gt;Qtr 3 = Jan - Mar&lt;/P&gt;&lt;P&gt;Qtr 4 = Apr - Jun&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried several methods however the results still returns a date value which then doesn't allow me to Summarize by the quarter/year.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this makes sense.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regrads&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dean&lt;/P&gt;</description>
    <pubDate>Thu, 21 Sep 2017 06:05:43 GMT</pubDate>
    <dc:creator>DME790</dc:creator>
    <dc:date>2017-09-21T06:05:43Z</dc:date>
    <item>
      <title>Convert daily Dates to Australian Financial Year quarters (July - Sept, Oct - Dec etc)</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Convert-daily-Dates-to-Australian-Financial-Year-quarters-July/m-p/397693#M25569</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to create (or change) the 'event_dt' variable to match the relevant Australian Financial year quarters by several years;&lt;/P&gt;&lt;P&gt;qtr 1 = Jul - Sep&lt;/P&gt;&lt;P&gt;Qtr 2 = Oct - Dec&lt;/P&gt;&lt;P&gt;Qtr 3 = Jan - Mar&lt;/P&gt;&lt;P&gt;Qtr 4 = Apr - Jun&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried several methods however the results still returns a date value which then doesn't allow me to Summarize by the quarter/year.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this makes sense.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regrads&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dean&lt;/P&gt;</description>
      <pubDate>Thu, 21 Sep 2017 06:05:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Convert-daily-Dates-to-Australian-Financial-Year-quarters-July/m-p/397693#M25569</guid>
      <dc:creator>DME790</dc:creator>
      <dc:date>2017-09-21T06:05:43Z</dc:date>
    </item>
    <item>
      <title>Re: Convert daily Dates to Australian Financial Year quarters (July - Sept, Oct - Dec etc)</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Convert-daily-Dates-to-Australian-Financial-Year-quarters-July/m-p/397703#M25570</link>
      <description>&lt;P&gt;Can you show us what your data looks like by creating a simple data step to import it into SAS along with your desired output?&lt;/P&gt;</description>
      <pubDate>Thu, 21 Sep 2017 07:42:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Convert-daily-Dates-to-Australian-Financial-Year-quarters-July/m-p/397703#M25570</guid>
      <dc:creator>ChrisBrooks</dc:creator>
      <dc:date>2017-09-21T07:42:12Z</dc:date>
    </item>
    <item>
      <title>Re: Convert daily Dates to Australian Financial Year quarters (July - Sept, Oct - Dec etc)</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Convert-daily-Dates-to-Australian-Financial-Year-quarters-July/m-p/397730#M25572</link>
      <description>&lt;P&gt;Not really shure what you want, but this might help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; test;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt; event_dt = &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;'21feb2017:13:52:50'dt&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;year = year(datepart(event_dt));&lt;/P&gt;
&lt;P&gt;qtr = qtr(datepart(event_dt));&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;select&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; (qtr);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;when&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; (&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;) qtrA = &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;3&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;when&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; (&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;2&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;) qtrA = &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;4&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;when&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; (&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;3&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;) qtrA = &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;when&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; (&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;4&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;) qtrA = &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;2&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;otherwise&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;end&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Sep 2017 10:46:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Convert-daily-Dates-to-Australian-Financial-Year-quarters-July/m-p/397730#M25572</guid>
      <dc:creator>FredrikE</dc:creator>
      <dc:date>2017-09-21T10:46:06Z</dc:date>
    </item>
    <item>
      <title>Re: Convert daily Dates to Australian Financial Year quarters (July - Sept, Oct - Dec etc)</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Convert-daily-Dates-to-Australian-Financial-Year-quarters-July/m-p/397798#M25573</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/75899"&gt;@DME790&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have tried several methods however the results still returns a date value which then doesn't allow me to Summarize by the quarter/year.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Please include what you've tried in the future.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You don't need to make a conversion to summarize by quarter/year, you need to apply the correct format and SAS summarizes using the formatted value. See the PROC FREQ example below which uses the SAS date to do the counts.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;*Create a sample data set;
data have;
    do i=1 to 12;
        sas_date = mdy(i, 15, 2017);
        output;
    end;
run;

*create the quarter variable as a SAS date or a number;
data want;
    set have;
&lt;BR /&gt;    *since your quarters are 6 months off the standard def, move date back 6 months;
    quarter_date = intnx('month', sas_date, -6, 's');
    quarter_number=qtr(quarter_date);

    format sas_date date9. quarter_date qtr4.;

run;

*count # / quarter using SAS date;
proc freq data=want order=freq;
table quarter_date;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 21 Sep 2017 15:23:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Convert-daily-Dates-to-Australian-Financial-Year-quarters-July/m-p/397798#M25573</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-09-21T15:23:49Z</dc:date>
    </item>
    <item>
      <title>Re: Convert daily Dates to Australian Financial Year quarters (July - Sept, Oct - Dec etc)</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Convert-daily-Dates-to-Australian-Financial-Year-quarters-July/m-p/398981#M25641</link>
      <description>Thanks Reeza - can you let me know what the 'S' does in the quarter_date = intnx('month', sas_date, -6, 's');&lt;BR /&gt;Cheers&lt;BR /&gt;Dean</description>
      <pubDate>Wed, 27 Sep 2017 00:00:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Convert-daily-Dates-to-Australian-Financial-Year-quarters-July/m-p/398981#M25641</guid>
      <dc:creator>DME790</dc:creator>
      <dc:date>2017-09-27T00:00:34Z</dc:date>
    </item>
    <item>
      <title>Re: Convert daily Dates to Australian Financial Year quarters (July - Sept, Oct - Dec etc)</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Convert-daily-Dates-to-Australian-Financial-Year-quarters-July/m-p/399012#M25648</link>
      <description>The fourth parameter is alignment option. In this case I've used 15 as the date and set it to the same since all months have a 15. Other options are beginning, end, middle. See the docs for more details.</description>
      <pubDate>Wed, 27 Sep 2017 03:26:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Convert-daily-Dates-to-Australian-Financial-Year-quarters-July/m-p/399012#M25648</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-09-27T03:26:03Z</dc:date>
    </item>
  </channel>
</rss>

