<?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 add set analysis to this expression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-add-set-analysis-to-this-expression/m-p/1373154#M613314</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If(&lt;SPAN style="color: #ff0000;"&gt;Only({&amp;lt;[FIN JAAR] = {$(y_previous_year)}&amp;gt;}&lt;/SPAN&gt; [FIN JAAR]&lt;SPAN style="color: #ff0000;"&gt;)&lt;/SPAN&gt; = $(_previous_year), Sum(&lt;SPAN style="color: #ff0000;"&gt;{&amp;lt;[FIN JAAR] = {$(y_previous_year)}&amp;gt;}&lt;/SPAN&gt; If(Aggr(Sum({&amp;lt;[FIN JAAR] = {$(y_previous_year)}&amp;gt;&lt;SPAN style="color: #ff0000;"&gt;}&lt;/SPAN&gt; TOTAL &amp;lt;PLU&amp;gt; BW),PLU) &amp;lt; 0, Aggr(Sum({&amp;lt;[FIN JAAR] = {$(y_previous_year)}&amp;gt;} TOTAL &amp;lt;PLU&amp;gt; BW), PLU))))&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 19 Sep 2017 12:09:00 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2017-09-19T12:09:00Z</dc:date>
    <item>
      <title>How add set analysis to this expression</title>
      <link>https://community.qlik.com/t5/QlikView/How-add-set-analysis-to-this-expression/m-p/1373151#M613311</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The expression below works correctly and displays the data for the selected year by the user correctly&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[FIN JAAR]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;=&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;$(MAKS_JAAR)&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Aggr&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;( &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;TOTAL&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;PLU&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;BW&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;),&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;PLU&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)&amp;lt;0,&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Aggr&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;TOTAL&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;PLU&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;BW&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;),&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;PLU&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;))))&lt;BR /&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;How do i add another expression to show the same data as above for the &lt;SPAN style="font-size: 12pt;"&gt;&lt;STRONG&gt;previous year&lt;/STRONG&gt;&lt;/SPAN&gt; , i tried this but it doesnt work &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Aggr&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;({&amp;lt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[FIN JAAR]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;={&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;$(y_previous_year)&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;}&amp;gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;TOTAL&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;PLU&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;BW&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;),&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;PLU&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)&amp;lt;0,&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Aggr&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;({&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[FIN JAAR]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;={&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;$(y_previous_year)&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;}&amp;gt;} &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;TOTAL&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;PLU&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;BW&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;),&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;PLU&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)))&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;also &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[FIN JAAR]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;=&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;$(&lt;STRONG&gt;&lt;EM style="color: #808080;"&gt;_previous_year&lt;/EM&gt;&lt;/STRONG&gt;)..... ect wont work , because the year the user selects is the maximim year , i think you have to add it into set analsysis for the previous year&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Sep 2017 09:01:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-add-set-analysis-to-this-expression/m-p/1373151#M613311</guid>
      <dc:creator>vvvvvvizard</dc:creator>
      <dc:date>2017-09-19T09:01:48Z</dc:date>
    </item>
    <item>
      <title>Re: How add set analysis to this expression</title>
      <link>https://community.qlik.com/t5/QlikView/How-add-set-analysis-to-this-expression/m-p/1373152#M613312</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I suspect you are over-complicating the expression. Why do you need an Aggr()? I would try&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the current year:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;=Sum({&amp;lt;[FIN JAAR]={$(MAKS_JAAR)}&amp;gt;} TOTAL &amp;lt;PLU&amp;gt; BW) &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the previous year&lt;/P&gt;&lt;P&gt;&lt;EM&gt;=Sum({&amp;lt;[FIN JAAR]={$(=MAKS_JAAR - 1)}&amp;gt;} TOTAL &amp;lt;PLU&amp;gt; BW) &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Assumes that MAK_JAAR is a variable containing a year (like 2017) and that the users are making a selection on FIN_JAAR (and the a selection in FIN_JAAR modifies the value of MAKS_JAAR).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Sep 2017 09:19:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-add-set-analysis-to-this-expression/m-p/1373152#M613312</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2017-09-19T09:19:34Z</dc:date>
    </item>
    <item>
      <title>Re: How add set analysis to this expression</title>
      <link>https://community.qlik.com/t5/QlikView/How-add-set-analysis-to-this-expression/m-p/1373153#M613313</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The reason for the Aggr() is that in the granular data people scan the barcode in the price column by mistake, and they cancel it out with a -price equal to the barcode = -1626236363563653 +1626236363563653 +300&lt;/P&gt;&lt;P&gt;so the 1626236363563653 pair is the illegitime numbers and the +300 is the right number ,sometimes there are legitimate negitive numbers .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I aggr the sum per invoice to avoid the illiegitimate pair , but know i only want to show legitimate&amp;nbsp; negitive numbers . &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Sep 2017 10:01:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-add-set-analysis-to-this-expression/m-p/1373153#M613313</guid>
      <dc:creator>vvvvvvizard</dc:creator>
      <dc:date>2017-09-19T10:01:44Z</dc:date>
    </item>
    <item>
      <title>Re: How add set analysis to this expression</title>
      <link>https://community.qlik.com/t5/QlikView/How-add-set-analysis-to-this-expression/m-p/1373154#M613314</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If(&lt;SPAN style="color: #ff0000;"&gt;Only({&amp;lt;[FIN JAAR] = {$(y_previous_year)}&amp;gt;}&lt;/SPAN&gt; [FIN JAAR]&lt;SPAN style="color: #ff0000;"&gt;)&lt;/SPAN&gt; = $(_previous_year), Sum(&lt;SPAN style="color: #ff0000;"&gt;{&amp;lt;[FIN JAAR] = {$(y_previous_year)}&amp;gt;}&lt;/SPAN&gt; If(Aggr(Sum({&amp;lt;[FIN JAAR] = {$(y_previous_year)}&amp;gt;&lt;SPAN style="color: #ff0000;"&gt;}&lt;/SPAN&gt; TOTAL &amp;lt;PLU&amp;gt; BW),PLU) &amp;lt; 0, Aggr(Sum({&amp;lt;[FIN JAAR] = {$(y_previous_year)}&amp;gt;} TOTAL &amp;lt;PLU&amp;gt; BW), PLU))))&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Sep 2017 12:09:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-add-set-analysis-to-this-expression/m-p/1373154#M613314</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-09-19T12:09:00Z</dc:date>
    </item>
    <item>
      <title>Re: How add set analysis to this expression</title>
      <link>https://community.qlik.com/t5/QlikView/How-add-set-analysis-to-this-expression/m-p/1373155#M613315</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Its not clear to me how the Aggr() helps you. Simply summing the values would cause the invalid entry to be cancelled by its reversal. Perhaps it would be clearer if you posted a small sample qvw. It does not have to have real data, but the sample data should illustrate the structure of the real data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that an Aggr() respects the current set and is affected by user selections and set expressions. If you want previous year's data you will need to set the year override on the outer sum (like Sum({&lt;EM style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;lt;[FIN JAAR]={$(MAKS_JAAR)}&amp;gt;&lt;/EM&gt;} ... ) as well as the inner ones.Something along these lines&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Sum({&lt;/SPAN&gt;&lt;EM style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;lt;[FIN JAAR]={$(MAKS_JAAR)}&amp;gt;&lt;/EM&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;} Aggr(Sum({&lt;EM style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;lt;[FIN JAAR]={$(MAKS_JAAR)}&amp;gt;}&lt;/EM&gt; ... )....) &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Sep 2017 12:51:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-add-set-analysis-to-this-expression/m-p/1373155#M613315</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2017-09-19T12:51:21Z</dc:date>
    </item>
  </channel>
</rss>

