<?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 Query in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Aggregation-Query/m-p/836157#M294124</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14354368004962992" jivemacro_uid="_14354368004962992"&gt;
&lt;P&gt;=If(Min(TOTAL&amp;lt;Student&amp;gt; Subject like 'Main*'),'Yes','No')&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 27 Jun 2015 20:27:12 GMT</pubDate>
    <dc:creator>MarcoWedel</dc:creator>
    <dc:date>2015-06-27T20:27:12Z</dc:date>
    <item>
      <title>Aggregation Query</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregation-Query/m-p/836152#M294119</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am trying to Aggregate a sample set of data. It looks something like;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="240"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl63" height="17" width="48"&gt;Marks&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="57"&gt;Semester&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="66"&gt;Student&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="69"&gt;Subject&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17" style="border-top: none;"&gt;80&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;B&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;Eco&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17" style="border-top: none;"&gt;80&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;B&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;English&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17" style="border-top: none;"&gt;80&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;A&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;Eco&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17" style="border-top: none;"&gt;80&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;A&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;English&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17" style="border-top: none;"&gt;80&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;A&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;Maths&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17" style="border-top: none;"&gt;100&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;A&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;Main_Eco&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17" style="border-top: none;"&gt;100&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;A&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;Main_English&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17" style="border-top: none;"&gt;100&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;A&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;Main_Maths&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Requirement is to aggregate the set by Student such that any student ,if has &lt;STRONG&gt;at least one subject starting with'Main'&lt;/STRONG&gt; , then the result should be Yes, else No, .Hence Student 'A' should be "Yes' and B be 'No'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried with the below expression, but the problem is it gives 'No' for Student 'A' with Non-Main subject row,&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if((Left(Subject,4)='Main')&amp;nbsp; ,If(Aggr(Sum(Marks), Student)&amp;gt;0,'Yes'),'No')&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The result should look something like :&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="392"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl63" height="17" width="98"&gt;Student&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="98"&gt;Subject&lt;/TD&gt;&lt;TD class="xl64" style="border-left: none;" width="98"&gt;Semester&lt;/TD&gt;&lt;TD class="xl65" width="98"&gt;Aggr&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="17" style="border-top: none;"&gt;B&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;Eco&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;No&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="17" style="border-top: none;"&gt;B&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;English&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;No&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="17" style="border-top: none;"&gt;A&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;Eco&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;Yes&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="17" style="border-top: none;"&gt;A&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;English&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;Yes&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="17" style="border-top: none;"&gt;A&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;Main_Maths&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;Yes&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="17" style="border-top: none;"&gt;A&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;Maths&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;Yes&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Appreciate any help ! &lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 27 Jun 2015 12:34:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregation-Query/m-p/836152#M294119</guid>
      <dc:creator />
      <dc:date>2015-06-27T12:34:36Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregation Query</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregation-Query/m-p/836153#M294120</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If(WildMatch(Aggr(NODISTINCT Concat(DISTINCT Subject), Student), '*Main*'), 'Yes', 'No')&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Output:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/91083_Capture.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 27 Jun 2015 12:46:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregation-Query/m-p/836153#M294120</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-06-27T12:46:57Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregation Query</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregation-Query/m-p/836154#M294121</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure if you need the second condition for any reason, you can add that in there too:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If(WildMatch(Aggr(NODISTINCT Concat(DISTINCT Subject), Student), '*Main*') and Aggr(NODISTINCT Sum(Marks), Student) &amp;gt; 0, 'Yes', 'No')&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 27 Jun 2015 12:49:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregation-Query/m-p/836154#M294121</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-06-27T12:49:55Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregation Query</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregation-Query/m-p/836155#M294122</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if(max(TOTAL &amp;lt;Student&amp;gt; aggr(count({$ &amp;lt;Subject={"Main*"}&amp;gt;} Subject), Student, Subject, Semester))&amp;gt;0, 'yes', 'no')&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 27 Jun 2015 13:23:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregation-Query/m-p/836155#M294122</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2015-06-27T13:23:02Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregation Query</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregation-Query/m-p/836156#M294123</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;another solution could be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14354365068094011" jivemacro_uid="_14354365068094011"&gt;
&lt;P&gt;=If(Max(TOTAL&amp;lt;Student&amp;gt; WildMatch(Subject,'Main*')),'Yes','No')&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="QlikCommunity_Thread_170286_Pic1.JPG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/91044_QlikCommunity_Thread_170286_Pic1.JPG" style="height: 176px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 27 Jun 2015 20:22:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregation-Query/m-p/836156#M294123</guid>
      <dc:creator>MarcoWedel</dc:creator>
      <dc:date>2015-06-27T20:22:39Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregation Query</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregation-Query/m-p/836157#M294124</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14354368004962992" jivemacro_uid="_14354368004962992"&gt;
&lt;P&gt;=If(Min(TOTAL&amp;lt;Student&amp;gt; Subject like 'Main*'),'Yes','No')&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 27 Jun 2015 20:27:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregation-Query/m-p/836157#M294124</guid>
      <dc:creator>MarcoWedel</dc:creator>
      <dc:date>2015-06-27T20:27:12Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregation Query</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregation-Query/m-p/836158#M294125</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Marco ! &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jun 2015 11:11:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregation-Query/m-p/836158#M294125</guid>
      <dc:creator />
      <dc:date>2015-06-29T11:11:25Z</dc:date>
    </item>
  </channel>
</rss>

