<?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 Expression question in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Expression-question/m-p/594128#M220128</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;My report got an Amount column which has the following&amp;nbsp; expression&lt;/P&gt;&lt;P&gt;&lt;IMG alt="4-1-2014 11-15-15 PM.png" class="jive-image" src="/legacyfs/online/56447_4-1-2014 11-15-15 PM.png" style="width: 620px; height: 132px;" /&gt;&lt;/P&gt;&lt;P style="color: #000000; font-family: Tahoma;"&gt;&lt;/P&gt;&lt;DIV&gt;&lt;SPAN style="color: #ff0000;"&gt;if (Match(AccountType, 'Income'), Sum(AmountWithSign),&lt;/SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;if (Match(AccountType, 'Cost of Goods Sold'), Sum(AmountWithSign),&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;if (Match(Transactions.GrsPrft, 'GrsPrft'), Sum(if (Match(AccountType, 'Income'), AmountWithSign, 0)) - Sum(if (Match(AccountType, 'Cost of Goods Sold'), AmountWithSign, 0)), &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;if (Match(AccountType, 'Expense'), Sum(AmountWithSign),&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;if (Match(AccountType, 'Other Income'), Sum(AmountWithSign),&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;if (Match(AccountType, 'Other Expense'), Sum(AmountWithSign),&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #008000;"&gt;if (Match(Transactions.IncExp, 'Net Ordinary Income'), &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #008000;"&gt;(Sum(if (Match(AccountType, 'Income'), AmountWithSign, 0)) - Sum(if (Match(AccountType, 'Cost of Goods Sold'), AmountWithSign, 0))) - (Sum(if (Match(AccountType, 'Expense'), AmountWithSign, 0))),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;if (Match(Transactions.IncExp, 'Net Other Income'),Sum(if (Match(AccountType, 'Other Income'), AmountWithSign, 0))-Sum(if (Match(AccountType, 'Other Expense'), AmountWithSign, 0)), &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;if (Match(Transactions.NetIncome, 'Net Income'), &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;(((Sum(if (Match(AccountType, 'Income'), AmountWithSign, 0)) - Sum(if (Match(AccountType, 'Cost of Goods Sold'), AmountWithSign, 0))) - (Sum(if (Match(AccountType, 'Expense'), AmountWithSign, 0)))) + &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;(Sum(if (Match(AccountType, 'Other Income'), AmountWithSign, 0))-Sum(if (Match(AccountType, 'Other Expense'), AmountWithSign, 0)))),0)))))))))&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;P style="color: #000000; font-family: Tahoma;"&gt;&lt;/P&gt;&lt;P style="color: #000000; font-family: Tahoma;"&gt;If you look the green text....it says that "Net Ordinary Income" should be " (Income - COGS) - (Expense).&lt;/P&gt;&lt;P style="color: #000000; font-family: Tahoma;"&gt;&lt;/P&gt;&lt;P style="color: #000000; font-family: Tahoma;"&gt;Now if you look at the picture above....you will find that Income and COGS are missing....they are missing because there is no transaction for Customer C1 which impacts Income and Expense account. So it is correct to not show Income and COGS amount in the report.&lt;/P&gt;&lt;P style="color: #000000; font-family: Tahoma;"&gt;Here is the question....&lt;/P&gt;&lt;P style="color: #000000; font-family: Tahoma;"&gt;I want Income and COGS to be treated as "0" for this calculation when they are missing for any customer....so the net impact would be &lt;/P&gt;&lt;P style="color: #000000; font-family: Tahoma;"&gt;(0-0)-100 = -100....i.e. s&lt;SPAN style="font-size: 10pt;"&gt;o Net Ordinary income and Net Income would be -100.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #000000; font-family: Tahoma;"&gt;&lt;/P&gt;&lt;P style="color: #000000; font-family: Tahoma;"&gt;Can you please help me with it?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 02 Apr 2014 18:59:46 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-04-02T18:59:46Z</dc:date>
    <item>
      <title>Expression question</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-question/m-p/594128#M220128</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;My report got an Amount column which has the following&amp;nbsp; expression&lt;/P&gt;&lt;P&gt;&lt;IMG alt="4-1-2014 11-15-15 PM.png" class="jive-image" src="/legacyfs/online/56447_4-1-2014 11-15-15 PM.png" style="width: 620px; height: 132px;" /&gt;&lt;/P&gt;&lt;P style="color: #000000; font-family: Tahoma;"&gt;&lt;/P&gt;&lt;DIV&gt;&lt;SPAN style="color: #ff0000;"&gt;if (Match(AccountType, 'Income'), Sum(AmountWithSign),&lt;/SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;if (Match(AccountType, 'Cost of Goods Sold'), Sum(AmountWithSign),&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;if (Match(Transactions.GrsPrft, 'GrsPrft'), Sum(if (Match(AccountType, 'Income'), AmountWithSign, 0)) - Sum(if (Match(AccountType, 'Cost of Goods Sold'), AmountWithSign, 0)), &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;if (Match(AccountType, 'Expense'), Sum(AmountWithSign),&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;if (Match(AccountType, 'Other Income'), Sum(AmountWithSign),&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;if (Match(AccountType, 'Other Expense'), Sum(AmountWithSign),&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #008000;"&gt;if (Match(Transactions.IncExp, 'Net Ordinary Income'), &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #008000;"&gt;(Sum(if (Match(AccountType, 'Income'), AmountWithSign, 0)) - Sum(if (Match(AccountType, 'Cost of Goods Sold'), AmountWithSign, 0))) - (Sum(if (Match(AccountType, 'Expense'), AmountWithSign, 0))),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;if (Match(Transactions.IncExp, 'Net Other Income'),Sum(if (Match(AccountType, 'Other Income'), AmountWithSign, 0))-Sum(if (Match(AccountType, 'Other Expense'), AmountWithSign, 0)), &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;if (Match(Transactions.NetIncome, 'Net Income'), &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;(((Sum(if (Match(AccountType, 'Income'), AmountWithSign, 0)) - Sum(if (Match(AccountType, 'Cost of Goods Sold'), AmountWithSign, 0))) - (Sum(if (Match(AccountType, 'Expense'), AmountWithSign, 0)))) + &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;(Sum(if (Match(AccountType, 'Other Income'), AmountWithSign, 0))-Sum(if (Match(AccountType, 'Other Expense'), AmountWithSign, 0)))),0)))))))))&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;P style="color: #000000; font-family: Tahoma;"&gt;&lt;/P&gt;&lt;P style="color: #000000; font-family: Tahoma;"&gt;If you look the green text....it says that "Net Ordinary Income" should be " (Income - COGS) - (Expense).&lt;/P&gt;&lt;P style="color: #000000; font-family: Tahoma;"&gt;&lt;/P&gt;&lt;P style="color: #000000; font-family: Tahoma;"&gt;Now if you look at the picture above....you will find that Income and COGS are missing....they are missing because there is no transaction for Customer C1 which impacts Income and Expense account. So it is correct to not show Income and COGS amount in the report.&lt;/P&gt;&lt;P style="color: #000000; font-family: Tahoma;"&gt;Here is the question....&lt;/P&gt;&lt;P style="color: #000000; font-family: Tahoma;"&gt;I want Income and COGS to be treated as "0" for this calculation when they are missing for any customer....so the net impact would be &lt;/P&gt;&lt;P style="color: #000000; font-family: Tahoma;"&gt;(0-0)-100 = -100....i.e. s&lt;SPAN style="font-size: 10pt;"&gt;o Net Ordinary income and Net Income would be -100.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #000000; font-family: Tahoma;"&gt;&lt;/P&gt;&lt;P style="color: #000000; font-family: Tahoma;"&gt;Can you please help me with it?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Apr 2014 18:59:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-question/m-p/594128#M220128</guid>
      <dc:creator />
      <dc:date>2014-04-02T18:59:46Z</dc:date>
    </item>
    <item>
      <title>Re: Expression question</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-question/m-p/594129#M220129</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use the rangesum function instead of the - sign: rangesum(sum(A), -sum(B), -sum(C)). The rangesum function can deal with null values because it will simply sum all the non-null values.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Apr 2014 19:33:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-question/m-p/594129#M220129</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2014-04-02T19:33:26Z</dc:date>
    </item>
    <item>
      <title>Re: Expression question</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-question/m-p/594130#M220130</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I changed the &lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit; color: #008000;"&gt;if (Match(Transactions.IncExp, 'Net Ordinary Income'),&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit; color: #008000;"&gt;(Sum(if (Match(AccountType, 'Income'), AmountWithSign, 0)) - Sum(if (Match(AccountType, 'Cost of Goods Sold'), AmountWithSign, 0))) - (Sum(if (Match(AccountType, 'Expense'), AmountWithSign, 0))) &lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit; color: #008000;"&gt;to&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;if (Match(Transactions.IncExp, 'Net Ordinary Income'), &lt;/P&gt;&lt;P&gt; rangesum(&lt;/P&gt;&lt;P&gt;(Sum(if (Match(AccountType, 'Income'), AmountWithSign, 0))),&lt;/P&gt;&lt;P&gt;- Sum(if (Match(AccountType, 'Cost of Goods Sold'), AmountWithSign, 0)),&lt;/P&gt;&lt;P&gt;- (Sum(if (Match(AccountType, 'Expense'), AmountWithSign, 0)))&lt;/P&gt;&lt;P&gt;),&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but it is still not working.&lt;/P&gt;&lt;P&gt;Do you see any obvious mistakes here?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Apr 2014 20:40:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-question/m-p/594130#M220130</guid>
      <dc:creator />
      <dc:date>2014-04-02T20:40:14Z</dc:date>
    </item>
  </channel>
</rss>

