<?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: set analysis in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/set-analysis/m-p/492873#M184357</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=sum({&amp;lt;type = {Recovery}&amp;gt;} spamount) - sum({&amp;lt;type = {Invoice}&amp;gt;} spamount)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But why not store the data accordingly when loading in:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(type = 'Invoice', -1 * spamount, spamount) as spamount,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 17 Jul 2013 20:43:44 GMT</pubDate>
    <dc:creator>swuehl</dc:creator>
    <dc:date>2013-07-17T20:43:44Z</dc:date>
    <item>
      <title>set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/set-analysis/m-p/492871#M184355</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the pulled the below information from my database. The below have 2 types Invoce and recovery . Currently the database saves both as +ve. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="569"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl63" height="17" width="119"&gt;provider&lt;/TD&gt;&lt;TD class="xl63" style="border-left: medium none;" width="98"&gt;account&lt;/TD&gt;&lt;TD class="xl63" style="border-left: medium none;" width="98"&gt;sp&lt;/TD&gt;&lt;TD class="xl64" style="border-left: medium none;" width="98"&gt;type&lt;/TD&gt;&lt;TD class="xl65" width="156"&gt;sum(spamount)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="17" style="border-top: medium none;"&gt;abc&lt;/TD&gt;&lt;TD class="xl65" style="border-left: medium none; border-top: medium none;"&gt;pqe&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-left: medium none; border-top: medium none;"&gt;201110&lt;/TD&gt;&lt;TD class="xl65" style="border-left: medium none; border-top: medium none;"&gt;Invoice&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-left: medium none; border-top: medium none;"&gt;1143.8132&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="17" style="border-top: medium none;"&gt;abc&lt;/TD&gt;&lt;TD class="xl65" style="border-left: medium none; border-top: medium none;"&gt;pqe&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-left: medium none; border-top: medium none;"&gt;201111&lt;/TD&gt;&lt;TD class="xl65" style="border-left: medium none; border-top: medium none;"&gt;Invoice&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-left: medium none; border-top: medium none;"&gt;1143.8132&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="17" style="border-top: medium none;"&gt;abc&lt;/TD&gt;&lt;TD class="xl65" style="border-left: medium none; border-top: medium none;"&gt;pqe&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-left: medium none; border-top: medium none;"&gt;201112&lt;/TD&gt;&lt;TD class="xl65" style="border-left: medium none; border-top: medium none;"&gt;Recovery&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-left: medium none; border-top: medium none;"&gt;1143.8132&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="17" style="border-top: medium none;"&gt;abc&lt;/TD&gt;&lt;TD class="xl65" style="border-left: medium none; border-top: medium none;"&gt;pqe&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-left: medium none; border-top: medium none;"&gt;201112&lt;/TD&gt;&lt;TD class="xl65" style="border-left: medium none; border-top: medium none;"&gt;Recovery&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-left: medium none; border-top: medium none;"&gt;946.118&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to have an expression which can save the recovery as positive value and invoice as negative. Can any one please help me with the expression using set analysis. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Appreciate your time for reading the question and thanks in advance for helping. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Viral &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Jul 2013 20:34:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/set-analysis/m-p/492871#M184355</guid>
      <dc:creator />
      <dc:date>2013-07-17T20:34:29Z</dc:date>
    </item>
    <item>
      <title>Re: set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/set-analysis/m-p/492872#M184356</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would use an if statement instead of set analysis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If(Type = 'Invoice', Sum(spamount) * -1, Sum(spamount))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alternativley you could also in the load script do the same thing. &lt;/P&gt;&lt;P&gt;If(Type = 'Invoice', spamount * -1, spamount) as NewAmountName&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Jul 2013 20:39:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/set-analysis/m-p/492872#M184356</guid>
      <dc:creator>jpapador</dc:creator>
      <dc:date>2013-07-17T20:39:42Z</dc:date>
    </item>
    <item>
      <title>Re: set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/set-analysis/m-p/492873#M184357</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=sum({&amp;lt;type = {Recovery}&amp;gt;} spamount) - sum({&amp;lt;type = {Invoice}&amp;gt;} spamount)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But why not store the data accordingly when loading in:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(type = 'Invoice', -1 * spamount, spamount) as spamount,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Jul 2013 20:43:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/set-analysis/m-p/492873#M184357</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2013-07-17T20:43:44Z</dc:date>
    </item>
  </channel>
</rss>

