<?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: Aggr Sales Problem in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Aggr-Sales-Problem/m-p/745936#M266272</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;sum(total aggr(fabs(sum(Sales)-sum(Cost)),Region))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 18 Mar 2015 22:02:20 GMT</pubDate>
    <dc:creator>maxgro</dc:creator>
    <dc:date>2015-03-18T22:02:20Z</dc:date>
    <item>
      <title>Aggr Sales Problem</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-Sales-Problem/m-p/745934#M266270</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Qlik Community,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a unique use case, where I need to take the Aggregate of Margin. Below is the example&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 195pt;" width="259"&gt;&lt;TBODY&gt;&lt;TR style="height: 12.75pt;"&gt;&lt;TD class="xl65" height="17" style="height: 12.75pt; width: 74pt;" width="98"&gt;Region&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none; width: 47pt;" width="63"&gt;Margin&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none; width: 74pt;" width="98"&gt;Aggr Margin&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 12.75pt;"&gt;&lt;TD class="xl66" height="17" style="height: 12.75pt; border-top: none;"&gt;A&lt;/TD&gt;&lt;TD align="right" class="xl67" style="border-top: none; border-left: none;"&gt;-20&lt;/TD&gt;&lt;TD align="right" class="xl67" style="border-top: none; border-left: none;"&gt;65&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 12.75pt;"&gt;&lt;TD class="xl66" height="17" style="height: 12.75pt; border-top: none;"&gt;B&lt;/TD&gt;&lt;TD align="right" class="xl67" style="border-top: none; border-left: none;"&gt;15&lt;/TD&gt;&lt;TD align="right" class="xl67" style="border-top: none; border-left: none;"&gt;65&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 12.75pt;"&gt;&lt;TD class="xl66" height="17" style="height: 12.75pt; border-top: none;"&gt;C&lt;/TD&gt;&lt;TD align="right" class="xl67" style="border-top: none; border-left: none;"&gt;-30&lt;/TD&gt;&lt;TD align="right" class="xl67" style="border-top: none; border-left: none;"&gt;65&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the example, Margin is simply taking Sum of sales - sum of costs. We want to create another column called aggr margin, which takes the absolute value of Margin and adds them up. In our example the correct # is 65 because (20+15+30).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've attached the sample app. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this made sense.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Vishal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Mar 2015 18:28:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-Sales-Problem/m-p/745934#M266270</guid>
      <dc:creator />
      <dc:date>2015-03-18T18:28:53Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr Sales Problem</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-Sales-Problem/m-p/745935#M266271</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ex: LOAD * INLINE&lt;/P&gt;&lt;P&gt;[&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Region, Sales, Cost&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; A, 100, 120&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; B, 40, 25&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; C, 300, 330 ]; &lt;/P&gt;&lt;P&gt;Ex1:&lt;/P&gt;&lt;P&gt;Load Region ,&lt;/P&gt;&lt;P&gt;Sales ,&lt;/P&gt;&lt;P&gt;Cost,&lt;/P&gt;&lt;P&gt;Sales - Cost as Margin&lt;/P&gt;&lt;P&gt;Resident Ex; &lt;/P&gt;&lt;P&gt;DROP Table Ex;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;join(Ex1)&lt;/P&gt;&lt;P&gt;Load sum(fAbs(Margin)) as aggrmargin &lt;/P&gt;&lt;P&gt;Resident Ex1;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Mar 2015 18:58:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-Sales-Problem/m-p/745935#M266271</guid>
      <dc:creator />
      <dc:date>2015-03-18T18:58:06Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr Sales Problem</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-Sales-Problem/m-p/745936#M266272</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;sum(total aggr(fabs(sum(Sales)-sum(Cost)),Region))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Mar 2015 22:02:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-Sales-Problem/m-p/745936#M266272</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2015-03-18T22:02:20Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr Sales Problem</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-Sales-Problem/m-p/745937#M266273</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Somehow you both helped me find what i was looking for. Thanks Santosh and Massimo.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Mar 2015 17:03:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-Sales-Problem/m-p/745937#M266273</guid>
      <dc:creator />
      <dc:date>2015-03-20T17:03:01Z</dc:date>
    </item>
  </channel>
</rss>

