<?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: Aggregation problem using variable in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Aggregation-problem-using-variable/m-p/380018#M491596</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Florian&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is in vSales? Have you tested that &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum($(vSales)) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;works.This is just to test that vSales is not the problem&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 23 Aug 2012 08:58:10 GMT</pubDate>
    <dc:creator>jonathandienst</dc:creator>
    <dc:date>2012-08-23T08:58:10Z</dc:date>
    <item>
      <title>Aggregation problem using variable</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregation-problem-using-variable/m-p/380015#M491593</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using a variable &lt;EM&gt;&lt;STRONG&gt;vCurrentSales&lt;/STRONG&gt;&lt;/EM&gt; in several charts:&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13456456408439955" jivemacro_uid="_13456456408439955"&gt;&lt;SPAN&gt;sum&lt;/SPAN&gt;({&amp;lt;Year={$(vCurrentYear)} &amp;gt;} $(vSales))&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="20494" class="jive-image" alt="1.jpg" src="https://community.qlik.com/legacyfs/online/20494_1.jpg" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, for one specific chart I would like to add another set analysis condition.&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_1345646283624882" jivemacro_uid="_1345646283624882"&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum({&amp;lt;Month = {1} &amp;gt;} $(vCurrentSales))&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The result of this expression is just NULL ... Does anybody have an idea?&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Aug 2012 14:41:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregation-problem-using-variable/m-p/380015#M491593</guid>
      <dc:creator>pennetzdorfer</dc:creator>
      <dc:date>2012-08-22T14:41:08Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregation problem using variable</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregation-problem-using-variable/m-p/380016#M491594</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Florain:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you try using: &lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13456532799201467" jivemacro_uid="_13456532799201467"&gt;&lt;P&gt;$(Replace(vCurrentSales,'&amp;gt;}',',Month = {1}&amp;gt;}'))&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kiran.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Aug 2012 16:32:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregation-problem-using-variable/m-p/380016#M491594</guid>
      <dc:creator />
      <dc:date>2012-08-22T16:32:56Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregation problem using variable</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregation-problem-using-variable/m-p/380017#M491595</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Kiran,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thank you very much! I like your suggestion, but for some reason the formula still shows NULLs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I omit the Dollar-function $(...) I get the following string:&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13457039593662192" jivemacro_uid="_13457039593662192"&gt;&lt;P&gt; &lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;sum({&amp;lt;Year={$(vCurrentYear)}, &lt;SPAN class="jive-sql-object"&gt;Month&lt;/SPAN&gt; = {1}&amp;gt;} $(vSales))&lt;/SPAN&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;which seems okay actually.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There must be a litte thing that I miss ...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Aug 2012 07:11:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregation-problem-using-variable/m-p/380017#M491595</guid>
      <dc:creator>pennetzdorfer</dc:creator>
      <dc:date>2012-08-23T07:11:03Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregation problem using variable</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregation-problem-using-variable/m-p/380018#M491596</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Florian&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is in vSales? Have you tested that &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum($(vSales)) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;works.This is just to test that vSales is not the problem&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Aug 2012 08:58:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregation-problem-using-variable/m-p/380018#M491596</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2012-08-23T08:58:10Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregation problem using variable</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregation-problem-using-variable/m-p/380019#M491597</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jonathan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've just tested it and you're right: Sum($(vSales)) doesn't work either.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Variable &lt;EM&gt;&lt;STRONG&gt;vSales&lt;/STRONG&gt;&lt;/EM&gt; contains:&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13457147168109721" jivemacro_uid="_13457147168109721"&gt;sum({&amp;lt; FlagInnovation = {1} &amp;gt;} Sales)&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can't see the problem ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regard,&lt;/P&gt;&lt;P&gt;Florian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Aug 2012 09:43:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregation-problem-using-variable/m-p/380019#M491597</guid>
      <dc:creator>pennetzdorfer</dc:creator>
      <dc:date>2012-08-23T09:43:22Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregation problem using variable</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregation-problem-using-variable/m-p/380020#M491598</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Florain,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you post a sample of your application with just relavant data and variables created?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kiran.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Aug 2012 09:49:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregation-problem-using-variable/m-p/380020#M491598</guid>
      <dc:creator />
      <dc:date>2012-08-23T09:49:11Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregation problem using variable</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregation-problem-using-variable/m-p/380021#M491599</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Florian&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You cant nest aggregation functions. Sum(Sum(....)) is not allowed. First see if you can do this another way, but if you must nest them, you will need to use Aggr().&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum(Aggr(Sum({&amp;lt; FlagInnovation = {1} &amp;gt;} Sales), &lt;EM&gt;some dimension(s)&lt;/EM&gt;))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The dimensions must be a comma separated list of one or more field names for which the inner sum is being evaluated, and must include the chart dimensions if inside a chart.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Aug 2012 14:02:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregation-problem-using-variable/m-p/380021#M491599</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2012-08-23T14:02:44Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregation problem using variable</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregation-problem-using-variable/m-p/380022#M491600</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kiran/Jonathan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thank you very much for your help! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Nested aggregation &lt;/EM&gt;seems to be the problem. I've attached a sample file now. &lt;/P&gt;&lt;P&gt;To simplify matters I modified my example a little bit (other variables) - but I think, it still illustrates my problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Florian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Aug 2012 09:03:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregation-problem-using-variable/m-p/380022#M491600</guid>
      <dc:creator>pennetzdorfer</dc:creator>
      <dc:date>2012-08-24T09:03:00Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregation problem using variable</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregation-problem-using-variable/m-p/380023#M491601</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Florian&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The set analysis does not apply into the aggregation function, so you need to re-apply the expression inside the aggregation. In your example, I think you get the correct results if you change vSalesInnovation to:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;sum({&amp;lt;FlagInnovation = {1}, Year = {'2012'}&amp;gt;} Sales)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in fact, you can remove the Year condition in the chart expression as it is redundant, so:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;sum(aggr($(vSalesInnovation),Country))&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Aug 2012 09:14:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregation-problem-using-variable/m-p/380023#M491601</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2012-08-24T09:14:06Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregation problem using variable</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregation-problem-using-variable/m-p/380024#M491602</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Possibly better, add Year to the Aggr dimensions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum({&amp;lt;Year = {"2012"}&amp;gt;}aggr($(vSalesInnovation),Country, Year))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and leave vSalesInnovation unchanged. That also works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Aug 2012 09:16:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregation-problem-using-variable/m-p/380024#M491602</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2012-08-24T09:16:59Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregation problem using variable</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregation-problem-using-variable/m-p/380025#M491603</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is this what you are looking for?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kiran.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Aug 2012 09:18:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregation-problem-using-variable/m-p/380025#M491603</guid>
      <dc:creator />
      <dc:date>2012-08-24T09:18:31Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregation problem using variable</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregation-problem-using-variable/m-p/380026#M491604</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Kiran,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;that's exactly what I need ... THANKS a lot!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That's a handy way of re-using an existing variable for a specific case with small modifications ... Great &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Florian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Aug 2012 09:36:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregation-problem-using-variable/m-p/380026#M491604</guid>
      <dc:creator>pennetzdorfer</dc:creator>
      <dc:date>2012-08-24T09:36:08Z</dc:date>
    </item>
  </channel>
</rss>

