<?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 calculate ratio between two variables in SAS Visual Analytics</title>
    <link>https://communities.sas.com/t5/SAS-Visual-Analytics/How-to-calculate-ratio-between-two-variables/m-p/453235#M9882</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Try this code:&lt;BR /&gt;&lt;BR /&gt;proc sql;
create table want as
select distinct course, sum(seat_allocated) as seat_allocated, sum(enrollment) as enrollment,
       (calculated seat_allocated/calculated enrollment) as fill_ratio from have group by course;
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 11 Apr 2018 14:27:24 GMT</pubDate>
    <dc:creator>shantanupl1</dc:creator>
    <dc:date>2018-04-11T14:27:24Z</dc:date>
    <item>
      <title>How to calculate ratio between two variables</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/How-to-calculate-ratio-between-two-variables/m-p/453225#M9881</link>
      <description>&lt;P&gt;Greetings everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;OK, I need some help...again. I have a dataset that contains course enrollment information. The data has various attributes for a course, such as division, department, program, section, seats allocated, seats filled (enrollment), campus, etc. I would like to have the ratio of enrollment to seats filled done in VA due to the various selections&amp;nbsp;a user may require.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can calculate&amp;nbsp;the ratio of each course, which I have done in EG, to the level of the most attributes, i.e.&lt;/P&gt;&lt;P&gt;Division, Department, program, campus location, time of day, section, course.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem is when I need to display a more global summary, say only to the course by itself&lt;/P&gt;&lt;P&gt;(Division, Department, Program,&amp;nbsp;COURSE&lt;/P&gt;&lt;P&gt;I can only get the summation of the ratios in the data, not simply the ratio of the displayed values&amp;nbsp;of enrollment and seats allocated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I attached an image I hope helps clarify what I am trying to accomplish.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am thinking this isn't possible in SAS VA 7.3.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Gary&lt;/P&gt;</description>
      <pubDate>Wed, 11 Apr 2018 14:08:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/How-to-calculate-ratio-between-two-variables/m-p/453225#M9881</guid>
      <dc:creator>ghartge</dc:creator>
      <dc:date>2018-04-11T14:08:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate ratio between two variables</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/How-to-calculate-ratio-between-two-variables/m-p/453235#M9882</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Try this code:&lt;BR /&gt;&lt;BR /&gt;proc sql;
create table want as
select distinct course, sum(seat_allocated) as seat_allocated, sum(enrollment) as enrollment,
       (calculated seat_allocated/calculated enrollment) as fill_ratio from have group by course;
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Apr 2018 14:27:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/How-to-calculate-ratio-between-two-variables/m-p/453235#M9882</guid>
      <dc:creator>shantanupl1</dc:creator>
      <dc:date>2018-04-11T14:27:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate ratio between two variables</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/How-to-calculate-ratio-between-two-variables/m-p/453251#M9884</link>
      <description>&lt;P&gt;Thanks, shantanupl1,&lt;/P&gt;&lt;P&gt;Yes, I can do that (and have) in my EG program that generates the data for my&amp;nbsp;report. I am trying to accomplish the same inside of SAS VA using a Crosstab. I am unable to find a way to display a ratio as you described using VA when a user wishes to see the values at the course level only. VA will sum the ratio values and display a total&amp;nbsp;of those values so we have ratios of 13.69 instead of .933 (or 93.3%) for example.&lt;/P&gt;&lt;P&gt;Gary&lt;/P&gt;</description>
      <pubDate>Wed, 11 Apr 2018 14:53:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/How-to-calculate-ratio-between-two-variables/m-p/453251#M9884</guid>
      <dc:creator>ghartge</dc:creator>
      <dc:date>2018-04-11T14:53:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate ratio between two variables</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/How-to-calculate-ratio-between-two-variables/m-p/453312#M9886</link>
      <description>&lt;P&gt;I solved the issue. I know I attempted this prior to my question but perhaps I had focus on a different area than I needed to be. I don't know but you simply create an "Aggregated Measure"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sum [_ByGroup_] ('Enrollment'n) / Sum [_ByGroup_] ('Seats Allocated'n)&lt;/P&gt;&lt;P&gt;&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="Aggrgated_Measure.jpg" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/19729i9715B5AC8B339DB1/image-size/large?v=v2&amp;amp;px=999" role="button" title="Aggrgated_Measure.jpg" alt="Aggrgated_Measure.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Apr 2018 17:34:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/How-to-calculate-ratio-between-two-variables/m-p/453312#M9886</guid>
      <dc:creator>ghartge</dc:creator>
      <dc:date>2018-04-11T17:34:08Z</dc:date>
    </item>
  </channel>
</rss>

