<?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: Measure to Category conversion in SAS VA in SAS Visual Analytics</title>
    <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Measure-to-Category-conversion-in-SAS-VA/m-p/453239#M9883</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the same dataset is used in multiple reports, and a certain numeric column is always used as a category, it might be a good idea to give the column a format. That will make the column a category in&amp;nbsp;SASVisualAnalyticsDesigner by default.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;* Format must be stored where Visual Analytics can find it     ;
libname formats "/opt/sas/config/Lev1/SASApp_VA/SASEnvironment/SASFormats/";

* Generic format that can be used for (m)any numeric variable(s)    ;
proc format library=formats.formats;
&amp;nbsp;&amp;nbsp; &amp;nbsp;value category
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;.="Unknown age";
quit;

* Apply format to variables who are to be used as categories. Can be difficult to achieve in the databuilder.
* Do in dataintegration layer if possible.      ;
proc sql noprint;
&amp;nbsp;&amp;nbsp; &amp;nbsp;create view TEMP_LASR_VIEW_16353 as 
&amp;nbsp;&amp;nbsp;&amp;nbsp; SELECT
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CLASS.Name length=8 AS Name,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CLASS.Sex length=1 AS Sex,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CLASS.Age format=category. length=8 AS Age,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CLASS.Height length=8 AS Height,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CLASS.Weight length=8 AS Weight 
&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sashelp.CLASS CLASS;
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 25 Apr 2018 11:20:06 GMT</pubDate>
    <dc:creator>Fredrik_Hansson</dc:creator>
    <dc:date>2018-04-25T11:20:06Z</dc:date>
    <item>
      <title>Measure to Category conversion in SAS VA</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Measure-to-Category-conversion-in-SAS-VA/m-p/390110#M7979</link>
      <description>&lt;P&gt;&lt;BR /&gt;Hi Experts,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I using variables Sr No, Emp Code as category that contains all numeric values(like 0001-9999 and 40000-70000) so converted before bringing into LASR and its showing under Category also. But when I am using these variable in calculated column or filter expression its coming as Measure.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Actually I want parameterise my report search using these variables so using these variable in filter expression with parameter like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(Emp ID) Contains (Parameter Emp ID)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;but its coming as measure so not able to use Contain function.&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;Couldn't figure out the problem.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;-Rahul&lt;/P&gt;</description>
      <pubDate>Wed, 23 Aug 2017 05:10:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Measure-to-Category-conversion-in-SAS-VA/m-p/390110#M7979</guid>
      <dc:creator>Rahul_SAS</dc:creator>
      <dc:date>2017-08-23T05:10:22Z</dc:date>
    </item>
    <item>
      <title>Measure to Category conversion in SAS VA</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Measure-to-Category-conversion-in-SAS-VA/m-p/390109#M7986</link>
      <description>&lt;P&gt;Hi Experts,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I using variables Sr No, Emp Code as category that contains all numeric values(like 0001-9999 and 40000-70000) so converted before bringing into LASR and its showing under Category also. But when I am using these variable in calculated column or filter expression its coming as Measure.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Actually I want parameterise my report search using these variables so&amp;nbsp;using these variable in filter expression with parameter like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(Emp ID) Contains (Parameter Emp ID)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;but its coming as measure so not able to use Contain function.&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;Couldn't figure out the problem.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;-Rahul&lt;/P&gt;</description>
      <pubDate>Wed, 23 Aug 2017 05:08:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Measure-to-Category-conversion-in-SAS-VA/m-p/390109#M7986</guid>
      <dc:creator>Rahul_SAS</dc:creator>
      <dc:date>2017-08-23T05:08:06Z</dc:date>
    </item>
    <item>
      <title>Re: Measure to Category conversion in SAS VA</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Measure-to-Category-conversion-in-SAS-VA/m-p/390114#M7982</link>
      <description>&lt;P&gt;Hi Rahul&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You'll be pleased to find this is very quick to fix.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you've found, when a numeric variable comes into VA it defaults to being a measure.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you want it to be a category, you can easily change it to that.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Click on the data item in the left pane&lt;/P&gt;&lt;P&gt;&amp;gt; See properties of that data item at the bottom, with "Classification" shown as "Measure"&lt;/P&gt;&lt;P&gt;&amp;gt; Click on&amp;nbsp;&lt;SPAN&gt;"Measure", and select "Category" from drop down&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Or can "Right-mouse" click on data item in left pane, and choose&amp;nbsp;"Category"&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Done! It now can be used as a category. Of course you can't do calcuations on it now.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If you need to use it in both ways, that is as&amp;nbsp;"Category"&amp;nbsp;and&amp;nbsp;"Measure", you can duplicate the data item, call it a different name, and change that one to a&amp;nbsp;"Category".&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;A classic for this is age. You may want age as a&amp;nbsp;"Measure", to get average or max age. And also want age as a "Category", to have certain age groups, so can show bars for each age group.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Hope that helps,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Aug 2017 05:33:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Measure-to-Category-conversion-in-SAS-VA/m-p/390114#M7982</guid>
      <dc:creator>Kiwi_Colin</dc:creator>
      <dc:date>2017-08-23T05:33:45Z</dc:date>
    </item>
    <item>
      <title>Re: Measure to Category conversion in SAS VA</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Measure-to-Category-conversion-in-SAS-VA/m-p/390116#M7983</link>
      <description>&lt;P&gt;Thank you sooo much kiwi_colin for your prompt reply.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have already used the solution you have mentioned above.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The problem persist even after converting that variable into category as I mentioned in my post that its showing in Category segment only.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am not able to use that converted categorical variable as categorical variable its still coming as Measure when I try to use that in a Calculated column or Filter Expression.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;-thanks&lt;/P&gt;</description>
      <pubDate>Wed, 23 Aug 2017 05:43:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Measure-to-Category-conversion-in-SAS-VA/m-p/390116#M7983</guid>
      <dc:creator>Rahul_SAS</dc:creator>
      <dc:date>2017-08-23T05:43:16Z</dc:date>
    </item>
    <item>
      <title>Re: Measure to Category conversion in SAS VA</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Measure-to-Category-conversion-in-SAS-VA/m-p/405074#M8430</link>
      <description>&lt;P&gt;Hi Colin,&lt;/P&gt;&lt;P&gt;I have a numeric measure "year" and to convert it into category variable "Year" do i need to duplicate the numeric measure and name it with category variable name&lt;/P&gt;</description>
      <pubDate>Wed, 18 Oct 2017 01:21:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Measure-to-Category-conversion-in-SAS-VA/m-p/405074#M8430</guid>
      <dc:creator>sas_viclearner</dc:creator>
      <dc:date>2017-10-18T01:21:11Z</dc:date>
    </item>
    <item>
      <title>Re: Measure to Category conversion in SAS VA</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Measure-to-Category-conversion-in-SAS-VA/m-p/405085#M8433</link>
      <description>&lt;P&gt;Hi &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/172341"&gt;@sas_viclearner&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You would only need to duplicate Year if you need to have both a measure type and a category type for your analysis.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've replied to the question you posted at &lt;A href="https://communities.sas.com/t5/SAS-Visual-Analytics/convert-numeric-measure-year-to-category-variable-year/m-p/405078" target="_blank"&gt;https://communities.sas.com/t5/SAS-Visual-Analytics/convert-numeric-measure-year-to-category-variable-year/m-p/405078&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kind Regards,&lt;/P&gt;
&lt;P&gt;Michelle&lt;/P&gt;</description>
      <pubDate>Wed, 18 Oct 2017 02:13:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Measure-to-Category-conversion-in-SAS-VA/m-p/405085#M8433</guid>
      <dc:creator>MichelleHomes</dc:creator>
      <dc:date>2017-10-18T02:13:28Z</dc:date>
    </item>
    <item>
      <title>Re: Measure to Category conversion in SAS VA</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Measure-to-Category-conversion-in-SAS-VA/m-p/453239#M9883</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the same dataset is used in multiple reports, and a certain numeric column is always used as a category, it might be a good idea to give the column a format. That will make the column a category in&amp;nbsp;SASVisualAnalyticsDesigner by default.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;* Format must be stored where Visual Analytics can find it     ;
libname formats "/opt/sas/config/Lev1/SASApp_VA/SASEnvironment/SASFormats/";

* Generic format that can be used for (m)any numeric variable(s)    ;
proc format library=formats.formats;
&amp;nbsp;&amp;nbsp; &amp;nbsp;value category
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;.="Unknown age";
quit;

* Apply format to variables who are to be used as categories. Can be difficult to achieve in the databuilder.
* Do in dataintegration layer if possible.      ;
proc sql noprint;
&amp;nbsp;&amp;nbsp; &amp;nbsp;create view TEMP_LASR_VIEW_16353 as 
&amp;nbsp;&amp;nbsp;&amp;nbsp; SELECT
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CLASS.Name length=8 AS Name,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CLASS.Sex length=1 AS Sex,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CLASS.Age format=category. length=8 AS Age,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CLASS.Height length=8 AS Height,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CLASS.Weight length=8 AS Weight 
&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sashelp.CLASS CLASS;
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Apr 2018 11:20:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Measure-to-Category-conversion-in-SAS-VA/m-p/453239#M9883</guid>
      <dc:creator>Fredrik_Hansson</dc:creator>
      <dc:date>2018-04-25T11:20:06Z</dc:date>
    </item>
  </channel>
</rss>

