<?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: Neseted aggregation in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Neseted-aggregation/m-p/1671884#M727425</link>
    <description>&lt;P&gt;The label in the table-chart for the expression:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff"&gt;=Sum( {$&amp;lt;[Reporting Year]={'=max(CurrentYear)'},Month={'=Max(Month)'}&amp;gt;} Numerator )&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;and it is showing the same incorrect answer.&amp;nbsp;&lt;/P&gt;&lt;P&gt;After removing the equal sign, it result in 0.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 03 Feb 2020 19:13:03 GMT</pubDate>
    <dc:creator>ethanch</dc:creator>
    <dc:date>2020-02-03T19:13:03Z</dc:date>
    <item>
      <title>Neseted aggregation</title>
      <link>https://community.qlik.com/t5/QlikView/Neseted-aggregation/m-p/1671080#M727419</link>
      <description>&lt;P&gt;Hi all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am having trouble working with aggregation, please help me out here.&lt;/P&gt;&lt;P&gt;What I want to achieve:&amp;nbsp;&lt;FONT color="#0000ff"&gt;sum(if([Reporting Year]=(CurrentYear) and Month=max(Month) ,Numerator))&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;I want the sum of Numerator in the newest month. And =CurrentYear which is a custom field to set the year.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;I tried&lt;FONT color="#3366ff"&gt; sum(if([Reporting Year]=(CurrentYear) and Month=&lt;FONT color="#ff0000"&gt;&lt;SPAN&gt;Aggr(max(Month),[Reporting Year],Measure)&lt;/SPAN&gt; &lt;/FONT&gt;,Numerator)),&lt;/FONT&gt; but it is giving me unstable performance.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am very new with Aggr(), I am not sure if I am doing it right.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any input and advise is appreciated.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 19:12:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Neseted-aggregation/m-p/1671080#M727419</guid>
      <dc:creator>ethanch</dc:creator>
      <dc:date>2024-11-16T19:12:17Z</dc:date>
    </item>
    <item>
      <title>Re: Neseted aggregation</title>
      <link>https://community.qlik.com/t5/QlikView/Neseted-aggregation/m-p/1671083#M727420</link>
      <description>&lt;P&gt;I think you could do this:&lt;/P&gt;&lt;P&gt;Sum( {&amp;lt;[Reporting Year]={$(=Year(Today()))},Month={'$(=Max(Month)')}&amp;gt;} Numerator )&lt;/P&gt;&lt;P&gt;You could also set the CurrentYear in a variable and use that instead of Today():&lt;/P&gt;&lt;P&gt;vCurrentYear = Max(Year(TransDate))&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;vMaxMonth = Max(Month)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sum( {&amp;lt;[Reporting Year]={$(vCurrentYear)},Month={'$(vMaxMonth)'}&amp;gt;} Numerator )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jan 2020 22:01:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Neseted-aggregation/m-p/1671083#M727420</guid>
      <dc:creator>petter</dc:creator>
      <dc:date>2020-01-30T22:01:52Z</dc:date>
    </item>
    <item>
      <title>Re: Neseted aggregation</title>
      <link>https://community.qlik.com/t5/QlikView/Neseted-aggregation/m-p/1671091#M727421</link>
      <description>&lt;P&gt;thanks for your response, but I am got 0 from&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff"&gt;Sum( {$&amp;lt;[Reporting Year]={'$(vCurrentYear)'},Month={'$(vMaxMonth)'}&amp;gt;} Numerator )&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;The Correct result should be 7.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I used&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff"&gt;Sum( {$&amp;lt;[Reporting Year]={'=$(vCurrentYear)'},Month={'=$(vMaxMonth)'}&amp;gt;} Numerator )&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;but that is equal sum({$}Numerator).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jan 2020 23:20:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Neseted-aggregation/m-p/1671091#M727421</guid>
      <dc:creator>ethanch</dc:creator>
      <dc:date>2020-01-30T23:20:17Z</dc:date>
    </item>
    <item>
      <title>Re: Neseted aggregation</title>
      <link>https://community.qlik.com/t5/QlikView/Neseted-aggregation/m-p/1671283#M727422</link>
      <description>&lt;P&gt;If your field Month is created from a date-field and has values like 'Jan', 'Feb', ... then would the call of:&lt;/P&gt;&lt;P&gt;Max(Month)&lt;/P&gt;&lt;P&gt;return 1, 2, ...&lt;/P&gt;&lt;P&gt;and both won't match. In this case I would recommend to add an appropriate field - num(month(DATE)) as MonthNum - within the master-calendar and then using this for the comparing.&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jan 2020 12:19:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Neseted-aggregation/m-p/1671283#M727422</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2020-01-31T12:19:57Z</dc:date>
    </item>
    <item>
      <title>Re: Neseted aggregation</title>
      <link>https://community.qlik.com/t5/QlikView/Neseted-aggregation/m-p/1671471#M727423</link>
      <description>&lt;P&gt;I tested both variable in a textbox and they show correct value,&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff"&gt;=$(vCurrentYear)&lt;/FONT&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; Show 2019&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff"&gt;=$(vMaxMonth)&lt;/FONT&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Show 11&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff"&gt;=Sum( {$&amp;lt;[Reporting Year]={'2019'},Month={'11'}&amp;gt;} Numerator )&lt;/FONT&gt; &amp;nbsp; Show 958, the correct sum&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff"&gt;=Sum( {$&amp;lt;[Reporting Year]={'=$(vCurrentYear)'},Month={'=$(vMaxMonth)'}&amp;gt;} Numerator )&lt;/FONT&gt; &amp;nbsp;&amp;nbsp; Show 9796&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff"&gt;=Sum( {$} Numerator )&lt;/FONT&gt; &amp;nbsp; Show 9796&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff"&gt;=Sum( {$&amp;lt;[Reporting Year]={'=$(vCurrentYear)'}&amp;gt;} Numerator )&lt;/FONT&gt; &amp;nbsp; Also Show 9796, it is not just the problem with Month&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jan 2020 21:01:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Neseted-aggregation/m-p/1671471#M727423</guid>
      <dc:creator>ethanch</dc:creator>
      <dc:date>2020-01-31T21:01:39Z</dc:date>
    </item>
    <item>
      <title>Re: Neseted aggregation</title>
      <link>https://community.qlik.com/t5/QlikView/Neseted-aggregation/m-p/1671653#M727424</link>
      <description>&lt;P&gt;Use the following of your trials within a table-chart without using a label for the expression:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff"&gt;=Sum( {$&amp;lt;[Reporting Year]={'=$(vCurrentYear)'},Month={'=$(vMaxMonth)'}&amp;gt;} Numerator )&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;If you now hover on the label you could see how Qlik interprets your expression and the variables inside. I could imagine that the equal-sign within the set analysis condition caused your issue - therefore remove it and try it again, means:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff"&gt;=Sum( {$&amp;lt;[Reporting Year]={'=$(vCurrentYear)'},Month={'$(vMaxMonth)'}&amp;gt;} Numerator )&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Mon, 03 Feb 2020 08:16:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Neseted-aggregation/m-p/1671653#M727424</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2020-02-03T08:16:50Z</dc:date>
    </item>
    <item>
      <title>Re: Neseted aggregation</title>
      <link>https://community.qlik.com/t5/QlikView/Neseted-aggregation/m-p/1671884#M727425</link>
      <description>&lt;P&gt;The label in the table-chart for the expression:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff"&gt;=Sum( {$&amp;lt;[Reporting Year]={'=max(CurrentYear)'},Month={'=Max(Month)'}&amp;gt;} Numerator )&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;and it is showing the same incorrect answer.&amp;nbsp;&lt;/P&gt;&lt;P&gt;After removing the equal sign, it result in 0.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Feb 2020 19:13:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Neseted-aggregation/m-p/1671884#M727425</guid>
      <dc:creator>ethanch</dc:creator>
      <dc:date>2020-02-03T19:13:03Z</dc:date>
    </item>
    <item>
      <title>Re: Neseted aggregation</title>
      <link>https://community.qlik.com/t5/QlikView/Neseted-aggregation/m-p/1671892#M727426</link>
      <description>&lt;P&gt;Hi Ethanch,&lt;/P&gt;&lt;P&gt;If you define below variables from the front end, please check if there is an equal sign in front of them.&lt;/P&gt;&lt;P&gt;If there isn't, could you try again Peter's and Marcus' offers after adding&amp;nbsp; equal sign in front of the variables expressions.&lt;/P&gt;&lt;P&gt;vCurrentYear&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;=&lt;/STRONG&gt; &lt;/FONT&gt;Max(Year(TransDate))&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;vMaxMonth&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;=&lt;/STRONG&gt; &lt;/FONT&gt;Max(Month)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Feb 2020 20:23:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Neseted-aggregation/m-p/1671892#M727426</guid>
      <dc:creator>cengizeralp</dc:creator>
      <dc:date>2020-02-03T20:23:22Z</dc:date>
    </item>
    <item>
      <title>Re: Neseted aggregation</title>
      <link>https://community.qlik.com/t5/QlikView/Neseted-aggregation/m-p/1671894#M727427</link>
      <description>&lt;P&gt;Thank you for the answer, that is what I am missing.&amp;nbsp;&lt;/P&gt;&lt;P&gt;My final expression with correct result:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff"&gt;=Sum( {$&amp;lt;[Reporting Year]={'$(vCurrentYear)'},Month={'$(vMaxMonth)'}&amp;gt;} Numerator )&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks everyone for the help.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Feb 2020 20:33:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Neseted-aggregation/m-p/1671894#M727427</guid>
      <dc:creator>ethanch</dc:creator>
      <dc:date>2020-02-03T20:33:19Z</dc:date>
    </item>
  </channel>
</rss>

