<?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: sum function not working on nested if statements in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/sum-function-not-working-on-nested-if-statements/m-p/788341#M472646</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;provide sample data please&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 25 Dec 2014 10:41:47 GMT</pubDate>
    <dc:creator>MK_QSL</dc:creator>
    <dc:date>2014-12-25T10:41:47Z</dc:date>
    <item>
      <title>sum function not working on nested if statements</title>
      <link>https://community.qlik.com/t5/QlikView/sum-function-not-working-on-nested-if-statements/m-p/788339#M472644</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hello all,&lt;/P&gt;&lt;P&gt;i have a nested if statement that works properly. i need to sum the result so that i can get the sum to show when i swich to pivot table view.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;((&lt;SPAN style="color: #0000ff;"&gt;AddMonths&lt;/SPAN&gt;((&lt;SPAN style="color: #0000ff;"&gt;date&lt;/SPAN&gt;(&lt;SPAN style="color: #0000ff;"&gt;today&lt;/SPAN&gt;())),-&lt;STRONG&gt;&lt;EM style="color: #808080;"&gt;v_mlai&lt;/EM&gt;&lt;/STRONG&gt;)&amp;gt;&lt;SPAN style="color: #0000ff;"&gt;date&lt;/SPAN&gt;(&lt;SPAN style="color: #0000ff;"&gt;max&lt;/SPAN&gt;({$&amp;lt;&lt;SPAN style="color: #800000;"&gt;m&lt;/SPAN&gt;=,&lt;SPAN style="color: #800000;"&gt;q&lt;/SPAN&gt;=,&lt;SPAN style="color: #800000;"&gt;y&lt;/SPAN&gt;=,&lt;SPAN style="color: #800000;"&gt;day&lt;/SPAN&gt;=&amp;gt;}&lt;SPAN style="color: #800000;"&gt;[sale date]&lt;/SPAN&gt;)))&lt;BR /&gt; ,&lt;SPAN style="color: #0000ff;"&gt;sum&lt;/SPAN&gt;({$&amp;lt;&lt;SPAN style="color: #800000;"&gt;m&lt;/SPAN&gt;=,&lt;SPAN style="color: #800000;"&gt;q&lt;/SPAN&gt;=,&lt;SPAN style="color: #800000;"&gt;y&lt;/SPAN&gt;=,&lt;SPAN style="color: #800000;"&gt;day&lt;/SPAN&gt;=&amp;gt;}&lt;SPAN style="color: #800000;"&gt;[&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;[items in inventory]&lt;/SPAN&gt;)&lt;/P&gt;&lt;P&gt;,&lt;SPAN style="color: #0000ff;"&gt;if&lt;/SPAN&gt;(&lt;SPAN style="color: #0000ff;"&gt;IsNull&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;[sale date]&lt;/SPAN&gt;)&lt;BR /&gt; ,&lt;SPAN style="color: #0000ff;"&gt;if&lt;/SPAN&gt;((&lt;SPAN style="color: #0000ff;"&gt;AddMonths&lt;/SPAN&gt;((&lt;SPAN style="color: #0000ff;"&gt;date&lt;/SPAN&gt;(&lt;SPAN style="color: #0000ff;"&gt;today&lt;/SPAN&gt;())),-&lt;STRONG&gt;&lt;EM style="color: #808080;"&gt;v_mlai&lt;/EM&gt;&lt;/STRONG&gt;)&amp;gt;&lt;SPAN style="color: #0000ff;"&gt;date&lt;/SPAN&gt;(&lt;SPAN style="color: #0000ff;"&gt;Max&lt;/SPAN&gt;({$&amp;lt;&lt;SPAN style="color: #800000;"&gt;m&lt;/SPAN&gt;=,&lt;SPAN style="color: #800000;"&gt;q&lt;/SPAN&gt;=,&lt;SPAN style="color: #800000;"&gt;y&lt;/SPAN&gt;=,&lt;SPAN style="color: #800000;"&gt;day&lt;/SPAN&gt;=&amp;gt;}&lt;SPAN style="color: #800000;"&gt;[inventory date]&lt;/SPAN&gt;)))&lt;BR /&gt; ,&lt;SPAN style="color: #0000ff;"&gt;sum&lt;/SPAN&gt;({$&amp;lt;&lt;SPAN style="color: #800000;"&gt;m&lt;/SPAN&gt;=,&lt;SPAN style="color: #800000;"&gt;q&lt;/SPAN&gt;=,&lt;SPAN style="color: #800000;"&gt;y&lt;/SPAN&gt;=,&lt;SPAN style="color: #800000;"&gt;day&lt;/SPAN&gt;=&amp;gt;}&lt;SPAN style="color: #800000;"&gt;[items in inventory]&lt;/SPAN&gt;)&lt;BR /&gt; ,0)&lt;BR /&gt; ,0)&lt;BR /&gt; )&lt;/P&gt;&lt;P&gt;i have tried puting the entire statement in a sum() function but that dosnt work (i get ' -'&amp;nbsp; value in all the cells). i also tried reconstracting the statement in severl different ways removing the set analysis and removing the sum() statements that are in the if() statments but i cant get it to wrok.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can someone pls tell me why dosnt puting the entire statement in a sum() function work?&lt;/P&gt;&lt;P&gt;also if you have any sugastions on how to reconstract the statment so that i get to sum to show on a pivot table, they will be greatly appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks in advance,&lt;/P&gt;&lt;P&gt;jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Dec 2014 10:10:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/sum-function-not-working-on-nested-if-statements/m-p/788339#M472644</guid>
      <dc:creator />
      <dc:date>2014-12-25T10:10:52Z</dc:date>
    </item>
    <item>
      <title>Re: sum function not working on nested if statements</title>
      <link>https://community.qlik.com/t5/QlikView/sum-function-not-working-on-nested-if-statements/m-p/788340#M472645</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You cannot directly use one aggregate function inside another aggregate function&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can try like Sum(Aggr(Your_expr,Dim1,Dim2..))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Dec 2014 10:17:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/sum-function-not-working-on-nested-if-statements/m-p/788340#M472645</guid>
      <dc:creator>anbu1984</dc:creator>
      <dc:date>2014-12-25T10:17:11Z</dc:date>
    </item>
    <item>
      <title>Re: sum function not working on nested if statements</title>
      <link>https://community.qlik.com/t5/QlikView/sum-function-not-working-on-nested-if-statements/m-p/788341#M472646</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;provide sample data please&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Dec 2014 10:41:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/sum-function-not-working-on-nested-if-statements/m-p/788341#M472646</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2014-12-25T10:41:47Z</dc:date>
    </item>
    <item>
      <title>Re: sum function not working on nested if statements</title>
      <link>https://community.qlik.com/t5/QlikView/sum-function-not-working-on-nested-if-statements/m-p/788342#M472647</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks for the help. i removed both the sum() and max() functions&amp;nbsp; and &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt; put the entire statement in a sum() function (moving the set analysis to the outer sum function only) and it works.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks again&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Dec 2014 15:12:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/sum-function-not-working-on-nested-if-statements/m-p/788342#M472647</guid>
      <dc:creator />
      <dc:date>2014-12-29T15:12:13Z</dc:date>
    </item>
  </channel>
</rss>

