<?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: How to format a data value as QX-YY? in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-format-a-data-value-as-QX-YY/m-p/560654#M33744</link>
    <description>&lt;P&gt;I am using this data to upload to one of our data source, and then we will use it for creating charts, so I think a custom format is what I am looking for.&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
    <pubDate>Tue, 21 May 2019 20:30:37 GMT</pubDate>
    <dc:creator>MelissaN</dc:creator>
    <dc:date>2019-05-21T20:30:37Z</dc:date>
    <item>
      <title>How to format a data value as QX-YY?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-format-a-data-value-as-QX-YY/m-p/560636#M33740</link>
      <description>&lt;P&gt;I would like to format a datetime value as QX-YY, for example, Q1-19, Q2-19,...&lt;/P&gt;&lt;P&gt;Any help is much appreciated.&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2019 20:02:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-format-a-data-value-as-QX-YY/m-p/560636#M33740</guid>
      <dc:creator>MelissaN</dc:creator>
      <dc:date>2019-05-21T20:02:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to format a data value as QX-YY?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-format-a-data-value-as-QX-YY/m-p/560642#M33741</link>
      <description>&lt;P&gt;As far as I know, there is no format QX-YY.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are formats YY/X or YY-X or YYQX. So unless you have some very picky and precise requirements, I wouldn't bother trying to get QX-YY. If you absolutely have to have QX-YY, then you probably need to create a new characater variable to match this exact appearance.&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2019 20:17:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-format-a-data-value-as-QX-YY/m-p/560642#M33741</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-05-21T20:17:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to format a data value as QX-YY?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-format-a-data-value-as-QX-YY/m-p/560645#M33742</link>
      <description>&lt;P&gt;If year followed by quarter is acceptable, you might consider using the YYQ format.&lt;/P&gt;
&lt;P&gt;A custom format can create that though.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Proc format library=work;
picture qyy
low-high ='Q%q-%0y' (datatype=date)
;
run;

data example;
   input date date9.;
datalines;
01Jan1960
23Feb2001
18Dec1901
;
proc print data=example;
   format date qyy.;
run;&lt;/PRE&gt;
&lt;P&gt;Notice that I intentionally picked example dates that might bring the year value into question as I hate two-digit years as almost anyone who worked on Y2K data issues likely does.&lt;/P&gt;
&lt;P&gt;You will need to make sure the format is available whenever you need it.&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2019 20:18:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-format-a-data-value-as-QX-YY/m-p/560645#M33742</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-05-21T20:18:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to format a data value as QX-YY?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-format-a-data-value-as-QX-YY/m-p/560652#M33743</link>
      <description>How are you planning to use this data? You could take two approaches, create a custom picture format or create a custom format. The custom picture format will not be honoured on graphs, but a custom format will be honoured on graphs.</description>
      <pubDate>Tue, 21 May 2019 20:28:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-format-a-data-value-as-QX-YY/m-p/560652#M33743</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-05-21T20:28:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to format a data value as QX-YY?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-format-a-data-value-as-QX-YY/m-p/560654#M33744</link>
      <description>&lt;P&gt;I am using this data to upload to one of our data source, and then we will use it for creating charts, so I think a custom format is what I am looking for.&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2019 20:30:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-format-a-data-value-as-QX-YY/m-p/560654#M33744</guid>
      <dc:creator>MelissaN</dc:creator>
      <dc:date>2019-05-21T20:30:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to format a data value as QX-YY?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-format-a-data-value-as-QX-YY/m-p/560659#M33745</link>
      <description>Creating charts in VA? or a different tool? Custom formats may not work in VA (unsure). If it's a different system entirely (Tableau, PowerBI) its different. The problem with creating a text variable is that it won't sort well. If you had 2018-Q1 that would sort fine, but since alphabetical sort is pretty much the default, you'd have all Q1s then Q2s then Q3s and Q4s order by year within each quarter.</description>
      <pubDate>Tue, 21 May 2019 20:37:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-format-a-data-value-as-QX-YY/m-p/560659#M33745</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-05-21T20:37:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to format a data value as QX-YY?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-format-a-data-value-as-QX-YY/m-p/560747#M33748</link>
      <description>&lt;P&gt;A format like this is sub-optimal in two ways:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;It uses a two-digit year. After the Y2K scare, it should be obvious that 2-digit years are a VERY BAD THING.&lt;/LI&gt;
&lt;LI&gt;It does not sort well on its own. Date/time values should always go from most significant to least significant. Using otherwise structured values will have hilarious results when used in eg graphs (I speak from experience).&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;So you should go for YYYY-Qx, which is best solved by creating this custom format:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
picture myquarter
  low-high ='%Y-Q%q' (datatype=date)
;
run;

data test;
x1 = put(today(),myquarter7.);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 22 May 2019 09:42:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-format-a-data-value-as-QX-YY/m-p/560747#M33748</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-05-22T09:42:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to format a data value as QX-YY?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-format-a-data-value-as-QX-YY/m-p/560855#M33757</link>
      <description>No, my team members use a different system to create chart. I may check with them to see if they could change the way they format the quarter to make it more efficient.</description>
      <pubDate>Wed, 22 May 2019 14:26:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-format-a-data-value-as-QX-YY/m-p/560855#M33757</guid>
      <dc:creator>MelissaN</dc:creator>
      <dc:date>2019-05-22T14:26:13Z</dc:date>
    </item>
  </channel>
</rss>

