<?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 Divide Row 2 By Row 1 in a Straight Table in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Divide-Row-2-By-Row-1-in-a-Straight-Table/m-p/235711#M86964</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a list which contains regions and values. I would like to divide a value for each region by the value in region 1 (e.g., "US"). The only result I get is 100% for region 1 ("US") divided by region 1. All the other rows are null.&lt;/P&gt;&lt;P&gt;Region Data % of US&lt;/P&gt;&lt;P&gt;US 20 100%&lt;/P&gt;&lt;P&gt;EU 50&lt;/P&gt;&lt;P&gt;JP 10&lt;/P&gt;&lt;P&gt;Here is an example of the code I am using ...&lt;/P&gt;&lt;P&gt;(Sum (Data)) / (Sum ({$&amp;lt;region={'US'}&amp;gt;}Data))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help you can offer would be greatly appreciated. Thank you in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 29 Apr 2011 20:20:40 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-04-29T20:20:40Z</dc:date>
    <item>
      <title>Divide Row 2 By Row 1 in a Straight Table</title>
      <link>https://community.qlik.com/t5/QlikView/Divide-Row-2-By-Row-1-in-a-Straight-Table/m-p/235711#M86964</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a list which contains regions and values. I would like to divide a value for each region by the value in region 1 (e.g., "US"). The only result I get is 100% for region 1 ("US") divided by region 1. All the other rows are null.&lt;/P&gt;&lt;P&gt;Region Data % of US&lt;/P&gt;&lt;P&gt;US 20 100%&lt;/P&gt;&lt;P&gt;EU 50&lt;/P&gt;&lt;P&gt;JP 10&lt;/P&gt;&lt;P&gt;Here is an example of the code I am using ...&lt;/P&gt;&lt;P&gt;(Sum (Data)) / (Sum ({$&amp;lt;region={'US'}&amp;gt;}Data))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help you can offer would be greatly appreciated. Thank you in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Apr 2011 20:20:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Divide-Row-2-By-Row-1-in-a-Straight-Table/m-p/235711#M86964</guid>
      <dc:creator />
      <dc:date>2011-04-29T20:20:40Z</dc:date>
    </item>
    <item>
      <title>Divide Row 2 By Row 1 in a Straight Table</title>
      <link>https://community.qlik.com/t5/QlikView/Divide-Row-2-By-Row-1-in-a-Straight-Table/m-p/235712#M86965</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;IMG alt="Wink" src="http://community.qlik.com/emoticons/emotion-5.gif" /&gt;This is the same question I asked above. So I am following.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Apr 2011 21:05:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Divide-Row-2-By-Row-1-in-a-Straight-Table/m-p/235712#M86965</guid>
      <dc:creator>patrickanderson</dc:creator>
      <dc:date>2011-04-29T21:05:07Z</dc:date>
    </item>
    <item>
      <title>Divide Row 2 By Row 1 in a Straight Table</title>
      <link>https://community.qlik.com/t5/QlikView/Divide-Row-2-By-Row-1-in-a-Straight-Table/m-p/235713#M86966</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe this?&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;sum(Data)/sum(total {&amp;lt;Region={'US'}&amp;gt;} Data)&lt;/P&gt;&lt;P&gt;I &lt;EM&gt;think&lt;/EM&gt; the problem is that each row is taking the intersection of your set and that row's dimension values. For anything but US, that intersection is null, so the whole expression returns null. By using "total", you tell it to ignore the dimension values when calculating the number on the bottom. If you have other dimensions, though, it might be a little more complicated. Let's say you have a "Data Type" field in the chart. You might need this:&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;sum(Data)/sum(total &amp;lt;"Data Type"&amp;gt; {&amp;lt;Region={'US'}&amp;gt;} Data)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Apr 2011 21:22:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Divide-Row-2-By-Row-1-in-a-Straight-Table/m-p/235713#M86966</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2011-04-29T21:22:06Z</dc:date>
    </item>
    <item>
      <title>Divide Row 2 By Row 1 in a Straight Table</title>
      <link>https://community.qlik.com/t5/QlikView/Divide-Row-2-By-Row-1-in-a-Straight-Table/m-p/235714#M86967</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That worked perfectly! Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Apr 2011 21:35:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Divide-Row-2-By-Row-1-in-a-Straight-Table/m-p/235714#M86967</guid>
      <dc:creator />
      <dc:date>2011-04-29T21:35:09Z</dc:date>
    </item>
  </channel>
</rss>

