<?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: sum aggr in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-analysis-sum-aggr/m-p/137368#M20527</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;..just to add each city_map has a different %ge that it is multiplied by ie that's why I thought you would aggregate somehow&lt;/P&gt;&lt;P&gt;&lt;IMG class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/212267_pastedImage_0.png" style="max-height: 900px; max-width: 1200px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 30 Aug 2018 15:54:33 GMT</pubDate>
    <dc:creator>paul_ripley</dc:creator>
    <dc:date>2018-08-30T15:54:33Z</dc:date>
    <item>
      <title>Set analysis: sum aggr</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-sum-aggr/m-p/137365#M20524</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;I have a chart shown below. I would like to get some set analysis code that I can use in my N Printing report for the totals , eg 772,717 and 554,105 and 901,604&lt;/P&gt;&lt;P&gt;&lt;IMG class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/212250_pastedImage_0.png" style="max-height: 900px; max-width: 1200px;" /&gt;&lt;/P&gt;&lt;P&gt;The expression eg for the PE column is&lt;/P&gt;&lt;P&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;period&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = {&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;"&amp;gt;=$(vStartPeriod_CY)&amp;lt;=$(vEndPeriod_CY)"&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;},&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;costc&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = {681,685},&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;bud2_line&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = {&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;"OFFICE COSTS"&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;},&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Datasource&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = {'Actual'}&lt;BR /&gt; &amp;gt;} &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;$(vCurrency)&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;) * &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;PE% &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PE% is a percentage held in a spreadsheet that I load into QV&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I take this code and put it into a text box it doesn't work - it brings back zero, even though it works in the table.&lt;/P&gt;&lt;P&gt;I wondered if it is anything to do with aggregating by city_map&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried the below but this although it brings back a number it brings back the wrong number - can you suggest what I am doing wrong?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&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;Aggr&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;BR /&gt;&amp;nbsp; &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;period&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = {&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;"&amp;gt;=$(vStartPeriod_CY)&amp;lt;=$(vEndPeriod_CY)"&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;},&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;bud2&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = {&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;"200"&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;}, &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;costc&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = {681,685},&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;bud2_line&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = {&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;"OFFICE COSTS"&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;}, &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Datasource&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = {'Actual'}&lt;BR /&gt; &amp;gt;} &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;$(vCurrency)&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &lt;BR /&gt; * &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;PE%&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;BR /&gt; , &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;city_map&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;Many thanks&lt;/P&gt;&lt;P&gt;Paul&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Aug 2018 15:39:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-sum-aggr/m-p/137365#M20524</guid>
      <dc:creator>paul_ripley</dc:creator>
      <dc:date>2018-08-30T15:39:10Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis: sum aggr</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-sum-aggr/m-p/137366#M20525</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try by adding the inner aggregation's set analysis to the outer aggregation&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=Sum(&lt;SPAN style="color: #ff0000;"&gt;{$&amp;lt;period = {"&amp;gt;=$(vStartPeriod_CY)&amp;lt;=$(vEndPeriod_CY)"}, &lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;bud2 = {"200"}, &lt;/STRONG&gt;&lt;STRONG&gt;costc = {681,685}, &lt;/STRONG&gt;&lt;STRONG&gt;bud2_line = {"OFFICE COSTS"}, &lt;/STRONG&gt;&lt;STRONG&gt;Datasource = {'Actual'}&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN style="color: #ff0000;"&gt;&amp;gt;}&lt;/SPAN&gt; Aggr(S&lt;/STRONG&gt;&lt;STRONG&gt;um({$&amp;lt;period = {"&amp;gt;=$(vStartPeriod_CY)&amp;lt;=$(vEndPeriod_CY)"}, &lt;/STRONG&gt;&lt;STRONG&gt;bud2 = {"200"}, &lt;/STRONG&gt;&lt;STRONG&gt;costc = {681,685}, &lt;/STRONG&gt;&lt;STRONG&gt;bud2_line = {"OFFICE COSTS"}, &lt;/STRONG&gt;&lt;STRONG&gt;Datasource = {'Actual'}&lt;/STRONG&gt;&lt;STRONG&gt;&amp;gt;} $(vCurrency)) &lt;/STRONG&gt;&lt;STRONG&gt;* PE%&lt;/STRONG&gt;&lt;STRONG&gt;, city_map))&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Aug 2018 15:41:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-sum-aggr/m-p/137366#M20525</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-08-30T15:41:52Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis: sum aggr</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-sum-aggr/m-p/137367#M20526</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Sunny&lt;/P&gt;&lt;P&gt;That gave me the same answer as I was getting.&lt;/P&gt;&lt;P&gt;If I use this code, ie take off the final *PE%&amp;nbsp; (and for the other columns it was *INF% and *PC% then I get the total of the 3 columns, which would be correct&lt;/P&gt;&lt;P&gt;But when I use the *PE% in a text field I get the wrong result in the PE column (and the Infra/PC columns)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&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;period&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = {&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;"&amp;gt;=$(vStartPeriod_CY)&amp;lt;=$(vEndPeriod_CY)"&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;},&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;costc&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = {681,685},&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;bud2_line&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = {&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;"OFFICE COSTS"&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;},&lt;BR /&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Datasource&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = {'Actual'}&lt;BR /&gt; &amp;gt;} &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;$(vCurrency)&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;)&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Aug 2018 15:51:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-sum-aggr/m-p/137367#M20526</guid>
      <dc:creator>paul_ripley</dc:creator>
      <dc:date>2018-08-30T15:51:02Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis: sum aggr</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-sum-aggr/m-p/137368#M20527</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;..just to add each city_map has a different %ge that it is multiplied by ie that's why I thought you would aggregate somehow&lt;/P&gt;&lt;P&gt;&lt;IMG class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/212267_pastedImage_0.png" style="max-height: 900px; max-width: 1200px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Aug 2018 15:54:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-sum-aggr/m-p/137368#M20527</guid>
      <dc:creator>paul_ripley</dc:creator>
      <dc:date>2018-08-30T15:54:33Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis: sum aggr</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-sum-aggr/m-p/137369#M20528</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There are two dimensions in the chart? Add both to your Aggr() function&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Aug 2018 16:14:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-sum-aggr/m-p/137369#M20528</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-08-30T16:14:35Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis: sum aggr</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-sum-aggr/m-p/137370#M20529</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Sunny&lt;/P&gt;&lt;P&gt;Not sure why this now works but this worked for me&lt;/P&gt;&lt;P&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;Aggr&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;( &lt;BR /&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;period&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = {&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;"&amp;gt;=$(vStartPeriod_CY)&amp;lt;=$(vEndPeriod_CY)"&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;},&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;costc&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = {681,685},&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;bud2_line&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = {&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;"OFFICE COSTS"&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;},&lt;BR /&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Datasource&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = {'Actual'}&lt;BR /&gt; &amp;gt;} &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;$(vCurrency)&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;) * &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;PE%&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&amp;nbsp; ,&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;PE%&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)) &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Aug 2018 16:25:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-sum-aggr/m-p/137370#M20529</guid>
      <dc:creator>paul_ripley</dc:creator>
      <dc:date>2018-08-30T16:25:38Z</dc:date>
    </item>
  </channel>
</rss>

