<?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 divide a row with another and display in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-divide-a-row-with-another-and-display/m-p/1545642#M744484</link>
    <description>Hi,&lt;BR /&gt;I have a question, why is there no "201802 b2 120" in "Result should be"?&lt;BR /&gt;Aiolos</description>
    <pubDate>Mon, 18 Feb 2019 07:35:02 GMT</pubDate>
    <dc:creator>uacg0009</dc:creator>
    <dc:date>2019-02-18T07:35:02Z</dc:date>
    <item>
      <title>How to divide a row with another and display</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-divide-a-row-with-another-and-display/m-p/1545636#M744483</link>
      <description>Hi All,&lt;BR /&gt;&lt;BR /&gt;I have a table with different metrics. In a chart I would like to get data by dividing one row by another based on the data from a single column and show the aggregate as a row.&lt;BR /&gt;&lt;BR /&gt;Actual table:&lt;BR /&gt;Col A Col B Col C&lt;BR /&gt;201801 b1 100&lt;BR /&gt;201801 b2 60&lt;BR /&gt;201801 max 30&lt;BR /&gt;201802 b1 160&lt;BR /&gt;201802 b2 120&lt;BR /&gt;201802 max 40&lt;BR /&gt;&lt;BR /&gt;Result should be&lt;BR /&gt;Col A Col B Col c&lt;BR /&gt;201801 b1/max 3&lt;BR /&gt;201801 b1 90&lt;BR /&gt;201801 b2/max 2&lt;BR /&gt;201801 b2 60&lt;BR /&gt;201801 max 30&lt;BR /&gt;201802 b1/max 4&lt;BR /&gt;201802 b1 160&lt;BR /&gt;201802 b2/max 3&lt;BR /&gt;201802 b2 120&lt;BR /&gt;201802 max 40&lt;BR /&gt;&lt;BR /&gt;I want to divide b1/max in the column B and get aggregate sum from column c as a new row with Column B value as maxB1.&lt;BR /&gt;&lt;BR /&gt;I need to do it as an expression.&lt;BR /&gt;&lt;BR /&gt;Thank you</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-divide-a-row-with-another-and-display/m-p/1545636#M744483</guid>
      <dc:creator>Uday</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to divide a row with another and display</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-divide-a-row-with-another-and-display/m-p/1545642#M744484</link>
      <description>Hi,&lt;BR /&gt;I have a question, why is there no "201802 b2 120" in "Result should be"?&lt;BR /&gt;Aiolos</description>
      <pubDate>Mon, 18 Feb 2019 07:35:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-divide-a-row-with-another-and-display/m-p/1545642#M744484</guid>
      <dc:creator>uacg0009</dc:creator>
      <dc:date>2019-02-18T07:35:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to divide a row with another and display</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-divide-a-row-with-another-and-display/m-p/1545643#M744485</link>
      <description>It should be I missed mentioning it</description>
      <pubDate>Mon, 18 Feb 2019 07:37:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-divide-a-row-with-another-and-display/m-p/1545643#M744485</guid>
      <dc:creator>Uday</dc:creator>
      <dc:date>2019-02-18T07:37:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to divide a row with another and display</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-divide-a-row-with-another-and-display/m-p/1545657#M744486</link>
      <description>&lt;P&gt;I think below row is also wrong in your "Result should be":&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;201801 b1 90&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;it should be :&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;201801 b1 100&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;And there is an easy way to solve that, or you can use loop.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Easy way:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;t1:
LOAD * INLINE [
    Col A, Col B, Col C
    201801, b1, 100
    201801, b2, 60
    201801, max, 30
    201802, b1, 160
    201802, b2, 120
    201802, max, 40
];

Left Join
LOAD [Col A],
	 [Col C] as [max Col C]
Resident t1
Where [Col B] = 'max';

Concatenate
LOAD [Col A],
	 [Col B] &amp;amp; '/max' as [Col B],
	 Div([Col C],[max Col C]) as [Col C]
Resident t1
Where [Col B] &amp;lt;&amp;gt; 'max';

DROP Field [max Col C];&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;Please try, it works in my desktop.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Aiolos Zhao&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Feb 2019 08:08:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-divide-a-row-with-another-and-display/m-p/1545657#M744486</guid>
      <dc:creator>uacg0009</dc:creator>
      <dc:date>2019-02-18T08:08:09Z</dc:date>
    </item>
  </channel>
</rss>

