<?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 Set Expression not working with aggregation function in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Set-Expression-not-working-with-aggregation-function/m-p/1755706#M58271</link>
    <description>&lt;P&gt;I have two tables- Master and Study Table. In master table, there are two columns (MasterID and a MeasureColumn. In StudyTable, there are 4 columns-MasterID, StudyID, Site and Month. Two tables are linked with MasterID. One MasterID can have multiple StudyID in study Table. so the requirement is to aggregate the count with MasterID.&lt;/P&gt;&lt;P&gt;The below expression is working fine as expected&lt;/P&gt;&lt;DIV&gt;= sum(aggr(sum(MeasureColumn),MasterID))&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;But when I tried along with a set expression as below it is not working as expected. I wanted to exclude the Month selection in the expression. In&amp;nbsp; my chart, the dimension is Site and the measure is the below.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;sum(aggr(sum( {&amp;lt;Month=&amp;gt;} MeasureColumn),MasterID))&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;sum(aggr({&amp;lt;Month=&amp;gt;}sum(MeasureColumn),MasterID))&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Sun, 25 Oct 2020 11:43:17 GMT</pubDate>
    <dc:creator>dr_suresh_baabu</dc:creator>
    <dc:date>2020-10-25T11:43:17Z</dc:date>
    <item>
      <title>Set Expression not working with aggregation function</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Expression-not-working-with-aggregation-function/m-p/1755706#M58271</link>
      <description>&lt;P&gt;I have two tables- Master and Study Table. In master table, there are two columns (MasterID and a MeasureColumn. In StudyTable, there are 4 columns-MasterID, StudyID, Site and Month. Two tables are linked with MasterID. One MasterID can have multiple StudyID in study Table. so the requirement is to aggregate the count with MasterID.&lt;/P&gt;&lt;P&gt;The below expression is working fine as expected&lt;/P&gt;&lt;DIV&gt;= sum(aggr(sum(MeasureColumn),MasterID))&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;But when I tried along with a set expression as below it is not working as expected. I wanted to exclude the Month selection in the expression. In&amp;nbsp; my chart, the dimension is Site and the measure is the below.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;sum(aggr(sum( {&amp;lt;Month=&amp;gt;} MeasureColumn),MasterID))&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;sum(aggr({&amp;lt;Month=&amp;gt;}sum(MeasureColumn),MasterID))&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sun, 25 Oct 2020 11:43:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Expression-not-working-with-aggregation-function/m-p/1755706#M58271</guid>
      <dc:creator>dr_suresh_baabu</dc:creator>
      <dc:date>2020-10-25T11:43:17Z</dc:date>
    </item>
    <item>
      <title>Re: Set Expression not working with aggregation function</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Expression-not-working-with-aggregation-function/m-p/1755707#M58272</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/2176"&gt;@dr_suresh_baabu&lt;/a&gt;&amp;nbsp; you should exclude the selection in outer aggregation as well&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;sum({&amp;lt;Month=&amp;gt;} aggr(sum( {&amp;lt;Month=&amp;gt;} MeasureColumn),MasterID))&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 25 Oct 2020 11:53:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Expression-not-working-with-aggregation-function/m-p/1755707#M58272</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2020-10-25T11:53:46Z</dc:date>
    </item>
    <item>
      <title>Re: Set Expression not working with aggregation function</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Expression-not-working-with-aggregation-function/m-p/1755708#M58273</link>
      <description>&lt;P&gt;Thank you! That worked for exclusion of field.&lt;/P&gt;&lt;P&gt;I also need to pass a dynamic Month range based on a selection on a month. Surprisingly, both the expressions&amp;nbsp; worked&lt;/P&gt;&lt;P&gt;1. = sum( {&amp;lt;Monthnum={"&amp;gt;=$(=(vStart))&amp;lt;=$(=(vEnd))"}, Month=&amp;gt;} aggr( {&amp;lt;Month=&amp;gt;} sum(&lt;SPAN&gt;MeasureColumn&lt;/SPAN&gt;),&lt;SPAN&gt;MasterID&lt;/SPAN&gt;))&lt;/P&gt;&lt;P&gt;2.&amp;nbsp;= sum( {&amp;lt;Monthnum={"&amp;gt;=$(=(vStart))&amp;lt;=$(=(vEnd))"}, Month=&amp;gt;} aggr( {&amp;lt;Monthnum={"&amp;gt;=$(=(vStart))&amp;lt;=$(=(vEnd))"},Month=&amp;gt;} sum(&lt;SPAN&gt;MeasureColumn&lt;/SPAN&gt;),&lt;SPAN&gt;MasterID&lt;/SPAN&gt;))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 25 Oct 2020 12:09:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Expression-not-working-with-aggregation-function/m-p/1755708#M58273</guid>
      <dc:creator>dr_suresh_baabu</dc:creator>
      <dc:date>2020-10-25T12:09:32Z</dc:date>
    </item>
  </channel>
</rss>

