<?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: Extract from a code in a field the last only three characters in SAS Visual Analytics</title>
    <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Extract-from-a-code-in-a-field-the-last-only-three-characters/m-p/749900#M15043</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can do this directly in VA by creating a calculated item with the Substring() operator. If the length of the value is not always the same, you can use GetLength() to determine the length of the value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Those operators are documented here:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://go.documentation.sas.com/doc/en/vacdc/v_008/vareportdata/p0dovqqp325peyn1dpijpxxmwj83.htm#n1x1svvabdfnrdn1cwiiwbx86l4l" target="_blank" rel="noopener"&gt;https://go.documentation.sas.com/doc/en/vacdc/v_008/vareportdata/p0dovqqp325peyn1dpijpxxmwj83.htm#n1x1svvabdfnrdn1cwiiwbx86l4l&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So to get the last three characters from the "Name" column you would do something like,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Substring('Name'n, ( GetLength('Name'n) - 2 ), 3)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm sure this can also be done in Data Studio, but I can't tell you offhand how to do it.&lt;/P&gt;</description>
    <pubDate>Wed, 23 Jun 2021 15:59:11 GMT</pubDate>
    <dc:creator>Sam_SAS</dc:creator>
    <dc:date>2021-06-23T15:59:11Z</dc:date>
    <item>
      <title>Extract from a code in a field the last only three characters</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Extract-from-a-code-in-a-field-the-last-only-three-characters/m-p/749890#M15042</link>
      <description>&lt;P&gt;&lt;BR /&gt;I am looking&amp;nbsp; to extract from a code in a field the last only three characters - am trying to do this in&amp;nbsp;SAS® Data Studio - Prepare Data.&lt;/P&gt;&lt;P&gt;Using data prep from SAS Viya 3.5&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Code in the field can look something like this&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;STRONG&gt;265265414TGA&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;And I want to extract/include only the last 3 characters &lt;STRONG&gt;TGA&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I dont want to code this in if possible rather use the options available&lt;BR /&gt;&lt;BR /&gt;Any suggestions - thanks&lt;/P&gt;</description>
      <pubDate>Wed, 23 Jun 2021 15:42:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Extract-from-a-code-in-a-field-the-last-only-three-characters/m-p/749890#M15042</guid>
      <dc:creator>PaulTHR</dc:creator>
      <dc:date>2021-06-23T15:42:04Z</dc:date>
    </item>
    <item>
      <title>Re: Extract from a code in a field the last only three characters</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Extract-from-a-code-in-a-field-the-last-only-three-characters/m-p/749900#M15043</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can do this directly in VA by creating a calculated item with the Substring() operator. If the length of the value is not always the same, you can use GetLength() to determine the length of the value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Those operators are documented here:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://go.documentation.sas.com/doc/en/vacdc/v_008/vareportdata/p0dovqqp325peyn1dpijpxxmwj83.htm#n1x1svvabdfnrdn1cwiiwbx86l4l" target="_blank" rel="noopener"&gt;https://go.documentation.sas.com/doc/en/vacdc/v_008/vareportdata/p0dovqqp325peyn1dpijpxxmwj83.htm#n1x1svvabdfnrdn1cwiiwbx86l4l&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So to get the last three characters from the "Name" column you would do something like,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Substring('Name'n, ( GetLength('Name'n) - 2 ), 3)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm sure this can also be done in Data Studio, but I can't tell you offhand how to do it.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Jun 2021 15:59:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Extract-from-a-code-in-a-field-the-last-only-three-characters/m-p/749900#M15043</guid>
      <dc:creator>Sam_SAS</dc:creator>
      <dc:date>2021-06-23T15:59:11Z</dc:date>
    </item>
    <item>
      <title>Re: Extract from a code in a field the last only three characters</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Extract-from-a-code-in-a-field-the-last-only-three-characters/m-p/750159#M15044</link>
      <description>Thanks very much - that will do for me.&lt;BR /&gt;&lt;BR /&gt;Thanks</description>
      <pubDate>Thu, 24 Jun 2021 11:37:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Extract-from-a-code-in-a-field-the-last-only-three-characters/m-p/750159#M15044</guid>
      <dc:creator>PaulTHR</dc:creator>
      <dc:date>2021-06-24T11:37:20Z</dc:date>
    </item>
  </channel>
</rss>

