<?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 created item does not make the calculation correctly in SAS Visual Analytics</title>
    <link>https://communities.sas.com/t5/SAS-Visual-Analytics/created-item-does-not-make-the-calculation-correctly/m-p/886790#M17409</link>
    <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have 2 measure variables in my dataset. Lets call them var1 and var2. I would like to create a very simple calculated item: var1 / var2&lt;BR /&gt;&lt;BR /&gt;The problem is when I make this calculation, it gives me 0s for all te records, but both var1 and var2 variables having values greater than 0. So this calculation is obviously wrong.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Example: var1: $20,000.00, var2: $5,000.00&lt;BR /&gt;&lt;BR /&gt;ratio should be 400%, but it gives 0%&lt;BR /&gt;&lt;BR /&gt;To try to debug, I created a calculated item,&amp;nbsp; using only var1, and I was seeing the values of var1 correctly. Same for var2. The problem arises when I added / between two of them.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I have no idea why it could be happening, please let me know if you have any ideas how to fix that.&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;One point that might be relevant, the measure variables I am using, var1 and var2 are also calculated items I created on VA.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thank you!&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 28 Jul 2023 11:02:22 GMT</pubDate>
    <dc:creator>znhnm</dc:creator>
    <dc:date>2023-07-28T11:02:22Z</dc:date>
    <item>
      <title>created item does not make the calculation correctly</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/created-item-does-not-make-the-calculation-correctly/m-p/886790#M17409</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have 2 measure variables in my dataset. Lets call them var1 and var2. I would like to create a very simple calculated item: var1 / var2&lt;BR /&gt;&lt;BR /&gt;The problem is when I make this calculation, it gives me 0s for all te records, but both var1 and var2 variables having values greater than 0. So this calculation is obviously wrong.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Example: var1: $20,000.00, var2: $5,000.00&lt;BR /&gt;&lt;BR /&gt;ratio should be 400%, but it gives 0%&lt;BR /&gt;&lt;BR /&gt;To try to debug, I created a calculated item,&amp;nbsp; using only var1, and I was seeing the values of var1 correctly. Same for var2. The problem arises when I added / between two of them.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I have no idea why it could be happening, please let me know if you have any ideas how to fix that.&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;One point that might be relevant, the measure variables I am using, var1 and var2 are also calculated items I created on VA.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thank you!&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jul 2023 11:02:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/created-item-does-not-make-the-calculation-correctly/m-p/886790#M17409</guid>
      <dc:creator>znhnm</dc:creator>
      <dc:date>2023-07-28T11:02:22Z</dc:date>
    </item>
    <item>
      <title>Re: created item does not make the calculation correctly</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/created-item-does-not-make-the-calculation-correctly/m-p/886791#M17410</link>
      <description>&lt;P&gt;Show us your code. Show us the log. Show us a portion of the data.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jul 2023 11:31:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/created-item-does-not-make-the-calculation-correctly/m-p/886791#M17410</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-07-28T11:31:27Z</dc:date>
    </item>
    <item>
      <title>Re: created item does not make the calculation correctly</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/created-item-does-not-make-the-calculation-correctly/m-p/887248#M17414</link>
      <description>&lt;P&gt;You do not address correctly your problem.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here at SAS communities when you do not get an answer within a few hours, it's not the community's lack of willingness to help or knowledge, it's about how YOU frame the problem.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, in your case a screenshot of some rows of your table would be of great help.&lt;/P&gt;
&lt;P&gt;I suppose that var1 and var2 do not occur in the same row, therefore the division has to be done via aggregated measure.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the easiest case you could solve it by using the by_group sum operator within the division.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The magic of VA is its ease to summarize in a dynamic context.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When doing calculations you should always check first on detail level meaning that you need to go to row-level.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Aug 2023 07:55:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/created-item-does-not-make-the-calculation-correctly/m-p/887248#M17414</guid>
      <dc:creator>acordes</dc:creator>
      <dc:date>2023-08-01T07:55:29Z</dc:date>
    </item>
  </channel>
</rss>

