<?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 can I calucalate ratio of two measures? in SAS Visual Analytics</title>
    <link>https://communities.sas.com/t5/SAS-Visual-Analytics/How-can-I-calucalate-ratio-of-two-measures/m-p/404615#M8391</link>
    <description>&lt;P&gt;For a quick fix I replaced all missing&amp;nbsp;values to 0 (zeros).&lt;/P&gt;&lt;P&gt;It worked for now.&lt;/P&gt;&lt;P&gt;But I'll be looking for a good solution of this problem.&lt;/P&gt;&lt;P&gt;I'm sure there should be some way to negate missing value effect.&lt;/P&gt;</description>
    <pubDate>Mon, 16 Oct 2017 22:12:54 GMT</pubDate>
    <dc:creator>Dreamer</dc:creator>
    <dc:date>2017-10-16T22:12:54Z</dc:date>
    <item>
      <title>How can I calucalate ratio of two measures?</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/How-can-I-calucalate-ratio-of-two-measures/m-p/403714#M8353</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm using SAS VA 7.3.&lt;/P&gt;&lt;P&gt;I have to show ratio of fields in a table.&lt;/P&gt;&lt;P&gt;For this I have created a new calculated measure with following formula:&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Calc_Field = Measure1 / (Measure1 + Measure2 + Measure3)&lt;BR /&gt;&lt;BR /&gt;&lt;/STRONG&gt;It works fine if I&amp;nbsp;add all categories&amp;nbsp;on the report&amp;nbsp;table.&lt;/P&gt;&lt;P&gt;But if I remove any category,&amp;nbsp;VA sums&amp;nbsp;the values of Calc_Field instead of recalculate the formula.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SAS VA Ratio Issue.JPG" style="width: 553px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/15839i505BB0F58B5622D1/image-size/large?v=v2&amp;amp;px=999" role="button" title="SAS VA Ratio Issue.JPG" alt="SAS VA Ratio Issue.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think in backend SAS groups by all category variables and based on this it sums up all measure variables.&lt;/P&gt;&lt;P&gt;So basically it is doing &lt;U&gt;sum(Measure1), sum(Measure2), sum(Measure3), sum(Calc_Field).&lt;/U&gt;&lt;/P&gt;&lt;P&gt;But I want&amp;nbsp;value of&amp;nbsp;Calc_Field to be calculated based on defined formula once other fields are grouped.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried both List table and CrossTab. I also tried different aggregation property of this calculated field but no luck.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help or suggestion will be much appreciated.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 12 Oct 2017 21:37:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/How-can-I-calucalate-ratio-of-two-measures/m-p/403714#M8353</guid>
      <dc:creator>Dreamer</dc:creator>
      <dc:date>2017-10-12T21:37:06Z</dc:date>
    </item>
    <item>
      <title>Re: How can I calucalate ratio of two measures?</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/How-can-I-calucalate-ratio-of-two-measures/m-p/403852#M8359</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Instead of Calculated Measure Please use Aggregated Measure.&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;Thanks,&lt;/P&gt;&lt;P&gt;Teja Surapaneni&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Oct 2017 09:49:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/How-can-I-calucalate-ratio-of-two-measures/m-p/403852#M8359</guid>
      <dc:creator>TejaSurapaneni</dc:creator>
      <dc:date>2017-10-13T09:49:02Z</dc:date>
    </item>
    <item>
      <title>Re: How can I calucalate ratio of two measures?</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/How-can-I-calucalate-ratio-of-two-measures/m-p/404031#M8368</link>
      <description>&lt;P&gt;Thanks a lot&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/6650"&gt;@TejaSurapaneni&lt;/a&gt;&amp;nbsp;it worked and I'm getting the expected result.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just one minor problem.&lt;/P&gt;&lt;P&gt;If one of my measure is missing then aggregated formula is also returning a missing value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In base SAS we can use Sum(var1,var2) function to avoid this problem.&lt;/P&gt;&lt;P&gt;But in VA it is&amp;nbsp;giving me syntax error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What should I modify in this formula to add numbers with missing value?&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Sum [_ByGroup_] ('M1'n) / ( Sum [_ByGroup_] ('M2'n) + Sum [_ByGroup_] ('M3'n) )&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any suggestion?&lt;/P&gt;</description>
      <pubDate>Fri, 13 Oct 2017 16:57:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/How-can-I-calucalate-ratio-of-two-measures/m-p/404031#M8368</guid>
      <dc:creator>Dreamer</dc:creator>
      <dc:date>2017-10-13T16:57:36Z</dc:date>
    </item>
    <item>
      <title>Re: How can I calucalate ratio of two measures?</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/How-can-I-calucalate-ratio-of-two-measures/m-p/404615#M8391</link>
      <description>&lt;P&gt;For a quick fix I replaced all missing&amp;nbsp;values to 0 (zeros).&lt;/P&gt;&lt;P&gt;It worked for now.&lt;/P&gt;&lt;P&gt;But I'll be looking for a good solution of this problem.&lt;/P&gt;&lt;P&gt;I'm sure there should be some way to negate missing value effect.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Oct 2017 22:12:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/How-can-I-calucalate-ratio-of-two-measures/m-p/404615#M8391</guid>
      <dc:creator>Dreamer</dc:creator>
      <dc:date>2017-10-16T22:12:54Z</dc:date>
    </item>
  </channel>
</rss>

