<?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: Categorical (DateTime) Format to Date Format in SAS Visual Analytics</title>
    <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Categorical-DateTime-Format-to-Date-Format/m-p/876435#M17228</link>
    <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/411017"&gt;@znhnm&lt;/a&gt;! The day of the week is what's causing your issue. anydtdte cannot parse that particular pattern, but it will parse the string if you remove the day of the week. You can fix this by removing the first word:&lt;/P&gt;
&lt;PRE&gt;parse(removeword('CatDateTime'n, 1), 'anydtdte32.')&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Stu_SAS_0-1684414590551.png" style="width: 315px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/84093i932E54A06FD04E79/image-dimensions/315x186?v=v2" width="315" height="186" role="button" title="Stu_SAS_0-1684414590551.png" alt="Stu_SAS_0-1684414590551.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that anydtdte returns a date while &lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/leforinforref/p1hsn1ji141r4zn0z3xm2dthop6a.htm" target="_self"&gt;anydtdtm&lt;/A&gt; returns a datetime. If you return a datetime, you can still format it as a month and retain the original datetime data by duplicating the column.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Stu_SAS_1-1684414790134.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/84096i34DF5DBA88B3626B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Stu_SAS_1-1684414790134.png" alt="Stu_SAS_1-1684414790134.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 18 May 2023 13:00:01 GMT</pubDate>
    <dc:creator>Stu_SAS</dc:creator>
    <dc:date>2023-05-18T13:00:01Z</dc:date>
    <item>
      <title>Categorical (DateTime) Format to Date Format</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Categorical-DateTime-Format-to-Date-Format/m-p/876381#M17225</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a categorical variable that looks like this.&amp;nbsp;&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="znhnm_0-1684390753091.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/84075i039CC97B3C5DB35C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="znhnm_0-1684390753091.png" alt="znhnm_0-1684390753091.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="znhnm_4-1684392012933.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/84081i5BF7ADF06A2D13F6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="znhnm_4-1684392012933.png" alt="znhnm_4-1684392012933.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would like to convert it to the date format so that I will create another variable to take the month and year part, looks like this:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="znhnm_2-1684391868241.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/84079i6D44CB15A0AEA05F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="znhnm_2-1684391868241.png" alt="znhnm_2-1684391868241.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="znhnm_5-1684392091041.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/84082i4FA148631E8B89A3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="znhnm_5-1684392091041.png" alt="znhnm_5-1684392091041.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV id="tinyMceEditorznhnm_3" class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried the parsing:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="znhnm_1-1684391661212.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/84078iB4B5A4643F4631C3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="znhnm_1-1684391661212.png" alt="znhnm_1-1684391661212.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="znhnm_6-1684392159186.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/84083i4F42E90361BC653C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="znhnm_6-1684392159186.png" alt="znhnm_6-1684392159186.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But I get missing values. What can I do in VA to solve this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 May 2023 06:43:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Categorical-DateTime-Format-to-Date-Format/m-p/876381#M17225</guid>
      <dc:creator>znhnm</dc:creator>
      <dc:date>2023-05-18T06:43:46Z</dc:date>
    </item>
    <item>
      <title>Categorical DateTime to Date</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Categorical-DateTime-Format-to-Date-Format/m-p/876387#M17227</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I had a cave a categorical variable that has date and time values, how can I remove the time part and have the date part only?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;e.g. From this:&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="znhnm_4-1684393336651.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/84088i18A8E9F7E618E90E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="znhnm_4-1684393336651.png" alt="znhnm_4-1684393336651.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To this:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="znhnm_3-1684393268255.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/84087i10CC277903C88510/image-size/medium?v=v2&amp;amp;px=400" role="button" title="znhnm_3-1684393268255.png" alt="znhnm_3-1684393268255.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 May 2023 07:04:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Categorical-DateTime-Format-to-Date-Format/m-p/876387#M17227</guid>
      <dc:creator>znhnm</dc:creator>
      <dc:date>2023-05-18T07:04:36Z</dc:date>
    </item>
    <item>
      <title>Re: Categorical (DateTime) Format to Date Format</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Categorical-DateTime-Format-to-Date-Format/m-p/876435#M17228</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/411017"&gt;@znhnm&lt;/a&gt;! The day of the week is what's causing your issue. anydtdte cannot parse that particular pattern, but it will parse the string if you remove the day of the week. You can fix this by removing the first word:&lt;/P&gt;
&lt;PRE&gt;parse(removeword('CatDateTime'n, 1), 'anydtdte32.')&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Stu_SAS_0-1684414590551.png" style="width: 315px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/84093i932E54A06FD04E79/image-dimensions/315x186?v=v2" width="315" height="186" role="button" title="Stu_SAS_0-1684414590551.png" alt="Stu_SAS_0-1684414590551.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that anydtdte returns a date while &lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/leforinforref/p1hsn1ji141r4zn0z3xm2dthop6a.htm" target="_self"&gt;anydtdtm&lt;/A&gt; returns a datetime. If you return a datetime, you can still format it as a month and retain the original datetime data by duplicating the column.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Stu_SAS_1-1684414790134.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/84096i34DF5DBA88B3626B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Stu_SAS_1-1684414790134.png" alt="Stu_SAS_1-1684414790134.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 May 2023 13:00:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Categorical-DateTime-Format-to-Date-Format/m-p/876435#M17228</guid>
      <dc:creator>Stu_SAS</dc:creator>
      <dc:date>2023-05-18T13:00:01Z</dc:date>
    </item>
    <item>
      <title>Re: Categorical (DateTime) Format to Date Format</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Categorical-DateTime-Format-to-Date-Format/m-p/876440#M17229</link>
      <description>&lt;P&gt;Another option would be to use the&amp;nbsp;&lt;A href="https://documentation.sas.com/doc/en/vdmmlcdc/8.11/nlsref/p1rnbf09nw40frn1pe8wvi2w6oep.htm" target="_self"&gt;NLDATMWw informat&lt;/A&gt;&amp;nbsp;&amp;nbsp;as part of your data preparation to read in the values as SAS datetime values. After that you can apply formats in VA.&lt;/P&gt;</description>
      <pubDate>Thu, 18 May 2023 13:00:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Categorical-DateTime-Format-to-Date-Format/m-p/876440#M17229</guid>
      <dc:creator>Sam_SAS</dc:creator>
      <dc:date>2023-05-18T13:00:53Z</dc:date>
    </item>
    <item>
      <title>Re: Categorical (DateTime) Format to Date Format</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Categorical-DateTime-Format-to-Date-Format/m-p/876452#M17230</link>
      <description>&lt;P&gt;Thank you so much for the reply. I tried the RemoveWord but I get missing values so apllying Parsing afterwards is not giving the result I wanted.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="znhnm_0-1684416616095.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/84097iDFD490DE0092FE22/image-size/medium?v=v2&amp;amp;px=400" role="button" title="znhnm_0-1684416616095.png" alt="znhnm_0-1684416616095.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="znhnm_1-1684416634144.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/84098i7DFC073A4E48F8A0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="znhnm_1-1684416634144.png" alt="znhnm_1-1684416634144.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 May 2023 13:30:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Categorical-DateTime-Format-to-Date-Format/m-p/876452#M17230</guid>
      <dc:creator>znhnm</dc:creator>
      <dc:date>2023-05-18T13:30:47Z</dc:date>
    </item>
    <item>
      <title>Re: Categorical (DateTime) Format to Date Format</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Categorical-DateTime-Format-to-Date-Format/m-p/876462#M17231</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;Feeding RemoveWord() into Parse() should work. Can you show us the entire expression editor dialog? I am interested in the Result Type and Format fields at the top.</description>
      <pubDate>Thu, 18 May 2023 14:12:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Categorical-DateTime-Format-to-Date-Format/m-p/876462#M17231</guid>
      <dc:creator>Sam_SAS</dc:creator>
      <dc:date>2023-05-18T14:12:46Z</dc:date>
    </item>
    <item>
      <title>Re: Categorical (DateTime) Format to Date Format</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Categorical-DateTime-Format-to-Date-Format/m-p/876466#M17232</link>
      <description>&lt;P&gt;Here it is:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="znhnm_1-1684419571997.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/84100i89320C55DCA01BA3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="znhnm_1-1684419571997.png" alt="znhnm_1-1684419571997.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 18 May 2023 14:19:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Categorical-DateTime-Format-to-Date-Format/m-p/876466#M17232</guid>
      <dc:creator>znhnm</dc:creator>
      <dc:date>2023-05-18T14:19:52Z</dc:date>
    </item>
    <item>
      <title>Re: Categorical (DateTime) Format to Date Format</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Categorical-DateTime-Format-to-Date-Format/m-p/876468#M17233</link>
      <description>&lt;P&gt;And that expression is giving you a missing value for every row? It looks like it should work. But what if you change the Result Type to DateTime? Even though your desired result is a date, you might need to make a DateTime value and the apply a Date format to it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If that doesn't help, what happens if you substitute a single value for the CatDateTime variable?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Like so:&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;'Wednesday, 29 September 2022 13:44:00'&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 18 May 2023 14:31:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Categorical-DateTime-Format-to-Date-Format/m-p/876468#M17233</guid>
      <dc:creator>Sam_SAS</dc:creator>
      <dc:date>2023-05-18T14:31:58Z</dc:date>
    </item>
    <item>
      <title>Re: Categorical (DateTime) Format to Date Format</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Categorical-DateTime-Format-to-Date-Format/m-p/876474#M17234</link>
      <description>Hi, again thanks but still I have missing values for all the rows, when changing the result type. However, what do you mean by `what happens if you substitute a single value for the CatDateTime variable?`</description>
      <pubDate>Thu, 18 May 2023 14:45:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Categorical-DateTime-Format-to-Date-Format/m-p/876474#M17234</guid>
      <dc:creator>znhnm</dc:creator>
      <dc:date>2023-05-18T14:45:44Z</dc:date>
    </item>
    <item>
      <title>Re: Categorical (DateTime) Format to Date Format</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Categorical-DateTime-Format-to-Date-Format/m-p/876480#M17235</link>
      <description>Click the button at the top right to view the expression as text code, then replace the reference to CatDateTime with just the character value 'Wednesday, 29 September 2022 13:44:00'</description>
      <pubDate>Thu, 18 May 2023 15:01:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Categorical-DateTime-Format-to-Date-Format/m-p/876480#M17235</guid>
      <dc:creator>Sam_SAS</dc:creator>
      <dc:date>2023-05-18T15:01:04Z</dc:date>
    </item>
    <item>
      <title>Re: Categorical (DateTime) Format to Date Format</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Categorical-DateTime-Format-to-Date-Format/m-p/876489#M17236</link>
      <description>Hi, thank you so much for the help. There is an unexpected thing happened. I just refreshed the SAS session and the categorical turned to be a Date, Time format automatically. So this is now in the format that I wanted it to be but I don't have an explanation why it was not in this format in the first place. Thank you for the support!!</description>
      <pubDate>Thu, 18 May 2023 15:17:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Categorical-DateTime-Format-to-Date-Format/m-p/876489#M17236</guid>
      <dc:creator>znhnm</dc:creator>
      <dc:date>2023-05-18T15:17:56Z</dc:date>
    </item>
    <item>
      <title>Re: Categorical (DateTime) Format to Date Format</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Categorical-DateTime-Format-to-Date-Format/m-p/876496#M17237</link>
      <description>&lt;P&gt;Thanks so much for letting us know, glad to hear this is working like you want it to now.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have had odd things happen in my report state sometimes. If a calculated item is used in anything (calculations, report objects, etc) generally you can't change the data type or format, but I'm not sure if that could have been the case here.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;BR /&gt;Sam&lt;/P&gt;</description>
      <pubDate>Thu, 18 May 2023 15:39:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Categorical-DateTime-Format-to-Date-Format/m-p/876496#M17237</guid>
      <dc:creator>Sam_SAS</dc:creator>
      <dc:date>2023-05-18T15:39:47Z</dc:date>
    </item>
  </channel>
</rss>

