<?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: Why is there a need to specify the same set expression twice? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Why-is-there-a-need-to-specify-the-same-set-expression-twice/m-p/906369#M533124</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Each aggregation function can leverage a unique set statement whether or not its inclusive of the inner set or not. This is for maximum flexbility&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below for example, the inner set is on AccountID=1 , but the outer set is on AccountID=2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so what happens ? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the outer is what is used on where to render the values, but the inner set&amp;nbsp; is being used for the subtotalling .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;pretty flexible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/83656_Capture.PNG" style="height: 175px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 14 Apr 2015 16:58:28 GMT</pubDate>
    <dc:creator>JonnyPoole</dc:creator>
    <dc:date>2015-04-14T16:58:28Z</dc:date>
    <item>
      <title>Why is there a need to specify the same set expression twice?</title>
      <link>https://community.qlik.com/t5/QlikView/Why-is-there-a-need-to-specify-the-same-set-expression-twice/m-p/906366#M533121</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #3d3c40; font-family: Lato, appleLogo, sans-serif; font-size: 15px;"&gt;Why do I have to specify the same set expression (&lt;SPAN style="color: #3d3c40; font-family: Lato, appleLogo, sans-serif; font-size: 15px;"&gt; {&amp;lt;Year={2012}&amp;gt;} &lt;/SPAN&gt;) twice? First time for sum() and second for max().&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3c40; font-family: Lato, appleLogo, sans-serif; font-size: 15px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3c40; font-size: 15px; font-family: Lato, appleLogo, sans-serif;"&gt;=Max({&amp;lt;Year={2012}&amp;gt;} aggr (sum( {&amp;lt;Year={2012}&amp;gt;} Sale),Company_Name,Product))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3c40; font-family: Lato, appleLogo, sans-serif; font-size: 15px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3c40; font-family: Lato, appleLogo, sans-serif; font-size: 15px;"&gt;Initially I though there would be enough to state it for sum, so that only the rows for 2012 would be passed on to the max().&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3c40; font-family: Lato, appleLogo, sans-serif; font-size: 15px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3c40; font-family: Lato, appleLogo, sans-serif; font-size: 15px;"&gt;I have taken the example from:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3c40; font-family: Lato, appleLogo, sans-serif; font-size: 15px;"&gt;&lt;A href="http://www.analyticsvidhya.com/blog/2014/02/aggr/" title="http://www.analyticsvidhya.com/blog/2014/02/aggr/"&gt;http://www.analyticsvidhya.com/blog/2014/02/aggr/&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3c40; font-family: Lato, appleLogo, sans-serif; font-size: 15px;"&gt;The blogger states that the expression is needed twice, but unfortunately not why.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3c40; font-family: Lato, appleLogo, sans-serif; font-size: 15px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Apr 2015 08:33:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Why-is-there-a-need-to-specify-the-same-set-expression-twice/m-p/906366#M533121</guid>
      <dc:creator />
      <dc:date>2015-04-14T08:33:06Z</dc:date>
    </item>
    <item>
      <title>Re: Why is there a need to specify the same set expression twice?</title>
      <link>https://community.qlik.com/t5/QlikView/Why-is-there-a-need-to-specify-the-same-set-expression-twice/m-p/906367#M533122</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I believe it is only a waste of processing &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;The Set Expression with the definition only in the sum statement works perfectly!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3c40; font-family: Lato, appleLogo, sans-serif; font-size: 15px;"&gt;=Max( aggr (sum( {&amp;lt;Year={2012}&amp;gt;} Sale),Company_Name,Product))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3c40; font-family: Lato, appleLogo, sans-serif; font-size: 15px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3c40; font-family: Lato, appleLogo, sans-serif; font-size: 15px;"&gt;A "set statement" creates a static set of data, should be included only in the part that defines the value&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Apr 2015 15:24:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Why-is-there-a-need-to-specify-the-same-set-expression-twice/m-p/906367#M533122</guid>
      <dc:creator />
      <dc:date>2015-04-14T15:24:05Z</dc:date>
    </item>
    <item>
      <title>Re: Why is there a need to specify the same set expression twice?</title>
      <link>https://community.qlik.com/t5/QlikView/Why-is-there-a-need-to-specify-the-same-set-expression-twice/m-p/906368#M533123</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As I stated in my initial post and stated by the original blogger, both are needed to get correct result.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Apr 2015 16:29:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Why-is-there-a-need-to-specify-the-same-set-expression-twice/m-p/906368#M533123</guid>
      <dc:creator />
      <dc:date>2015-04-14T16:29:58Z</dc:date>
    </item>
    <item>
      <title>Re: Why is there a need to specify the same set expression twice?</title>
      <link>https://community.qlik.com/t5/QlikView/Why-is-there-a-need-to-specify-the-same-set-expression-twice/m-p/906369#M533124</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Each aggregation function can leverage a unique set statement whether or not its inclusive of the inner set or not. This is for maximum flexbility&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below for example, the inner set is on AccountID=1 , but the outer set is on AccountID=2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so what happens ? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the outer is what is used on where to render the values, but the inner set&amp;nbsp; is being used for the subtotalling .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;pretty flexible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/83656_Capture.PNG" style="height: 175px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Apr 2015 16:58:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Why-is-there-a-need-to-specify-the-same-set-expression-twice/m-p/906369#M533124</guid>
      <dc:creator>JonnyPoole</dc:creator>
      <dc:date>2015-04-14T16:58:28Z</dc:date>
    </item>
  </channel>
</rss>

