<?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 Help needed with Nested SetAnalysis in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Help-needed-with-Nested-SetAnalysis/m-p/348873#M129232</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need some help with a nested SetAnalysis that I work on. For this discussion I made a simplified example of my problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My source data&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" cellpadding="3" cellspacing="0" class="jiveBorder" style="width: 100%; border: 1px solid #000000;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;YearMonth&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;myDate&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Sales&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;numDate&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;SPAN style="text-align: -webkit-right;"&gt;201101&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD&gt;1-1-2011&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;40544&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;SPAN style="text-align: -webkit-right;"&gt;201101&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD&gt;2-1-2011&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;40545&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;SPAN style="text-align: -webkit-right;"&gt;201102&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD&gt;1-2-2011&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;40575&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;SPAN style="text-align: -webkit-right;"&gt;201102&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD&gt;2-2-2011&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;40576&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I want to achieve is to show, per YearMonth the sales where myDate is greater than the minimum of myDate in that YearMonth.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So the result should be this:&lt;/P&gt;&lt;P&gt;201101 &amp;gt;&amp;gt;&amp;gt; 2&lt;/P&gt;&lt;P&gt;201102 &amp;gt;&amp;gt;&amp;gt; 4&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Attached I have a QVW of this example but after a lot of trying I don't get it working. Which set expression do I need?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I thought I needed this: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;=sum( {$&amp;lt;myDate={'&amp;gt;$(=min(myDate))'}&amp;gt;} Sales)&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but that only produces the expected value for 201101 and not for 201102&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance for the help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 13 May 2012 10:54:33 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-05-13T10:54:33Z</dc:date>
    <item>
      <title>Help needed with Nested SetAnalysis</title>
      <link>https://community.qlik.com/t5/QlikView/Help-needed-with-Nested-SetAnalysis/m-p/348873#M129232</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need some help with a nested SetAnalysis that I work on. For this discussion I made a simplified example of my problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My source data&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" cellpadding="3" cellspacing="0" class="jiveBorder" style="width: 100%; border: 1px solid #000000;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;YearMonth&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;myDate&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Sales&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;numDate&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;SPAN style="text-align: -webkit-right;"&gt;201101&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD&gt;1-1-2011&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;40544&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;SPAN style="text-align: -webkit-right;"&gt;201101&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD&gt;2-1-2011&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;40545&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;SPAN style="text-align: -webkit-right;"&gt;201102&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD&gt;1-2-2011&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;40575&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;SPAN style="text-align: -webkit-right;"&gt;201102&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD&gt;2-2-2011&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;40576&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I want to achieve is to show, per YearMonth the sales where myDate is greater than the minimum of myDate in that YearMonth.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So the result should be this:&lt;/P&gt;&lt;P&gt;201101 &amp;gt;&amp;gt;&amp;gt; 2&lt;/P&gt;&lt;P&gt;201102 &amp;gt;&amp;gt;&amp;gt; 4&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Attached I have a QVW of this example but after a lot of trying I don't get it working. Which set expression do I need?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I thought I needed this: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;=sum( {$&amp;lt;myDate={'&amp;gt;$(=min(myDate))'}&amp;gt;} Sales)&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but that only produces the expected value for 201101 and not for 201102&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance for the help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 13 May 2012 10:54:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-needed-with-Nested-SetAnalysis/m-p/348873#M129232</guid>
      <dc:creator />
      <dc:date>2012-05-13T10:54:33Z</dc:date>
    </item>
    <item>
      <title>Help needed with Nested SetAnalysis</title>
      <link>https://community.qlik.com/t5/QlikView/Help-needed-with-Nested-SetAnalysis/m-p/348874#M129233</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Set analysis will be evaluated once per chart and will therefore not take the current dimension values into account (like looking at the current YearMonth and calculating the min(myDate) per YearMonth. So, if you want to use set analysis, you probably need to add a search expression with an aggregation function to select the correct myDate values per YearMonth:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;=sum(total&amp;lt;YearMonth&amp;gt; {$&amp;lt;myDate={"=myDate&amp;gt;aggr(min(total&amp;lt;YearMonth&amp;gt; myDate),YearMonth,myDate)"}&amp;gt;} Sales)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 13 May 2012 12:53:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-needed-with-Nested-SetAnalysis/m-p/348874#M129233</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-05-13T12:53:38Z</dc:date>
    </item>
    <item>
      <title>Help needed with Nested SetAnalysis</title>
      <link>https://community.qlik.com/t5/QlikView/Help-needed-with-Nested-SetAnalysis/m-p/348875#M129234</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks! That indeed gives the correct outcomes!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not 100% sure if this solves my bigger problem as well, but I hope so...&lt;/P&gt;&lt;P&gt;I'll dive more into usage of total&amp;lt; &amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Based on your expression, I found info in the help with this topic: Nested aggregations with total qualifier. I'll study on this further this week!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 13 May 2012 13:57:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-needed-with-Nested-SetAnalysis/m-p/348875#M129234</guid>
      <dc:creator />
      <dc:date>2012-05-13T13:57:04Z</dc:date>
    </item>
    <item>
      <title>Re: Help needed with Nested SetAnalysis</title>
      <link>https://community.qlik.com/t5/QlikView/Help-needed-with-Nested-SetAnalysis/m-p/348876#M129235</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I now get the idea... One related question after my investigation of this...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; color: #636363; font-family: Arial;"&gt;Your expression (again stated below) works perfectly, and after investigation (with your explanation in mind) I know why...&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;=sum(total&amp;lt;YearMonth&amp;gt; {$&amp;lt;myDate={"=myDate&amp;gt;aggr(min(total&amp;lt;YearMonth&amp;gt; myDate),YearMonth,myDate)"}&amp;gt;} Sales)&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was a bit surprised about your expression, and to better understand things, I'd like to know why the 2 slightly different expressions don't work...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;[1] expressions without dollarsign expansion?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;- I thought that when functions need to be used in a set (like {"min(myDate)"}, this can only be done using a dollar sign expansion (like&amp;nbsp; {"$(=min(myDate))"}&amp;nbsp; )&lt;/P&gt;&lt;P&gt;- according to your expression, this is not true: a part of your set expression is "=mydDate&amp;gt;aggr(.........)" (not using $(=.......)&lt;/P&gt;&lt;P&gt;- To be more precise, the expression below doesn't even work correctly (returns 0 and 0)... Could you explain why?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;//without dollar sign expansion&lt;/P&gt;&lt;P&gt;=sum(total&amp;lt;YearMonth&amp;gt; {$&amp;lt;myDate={"=myDate&amp;gt;$(=aggr(min(total&amp;lt;YearMonth&amp;gt; myDate),YearMonth,myDate))"}&amp;gt;} Sales)&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;[2] expressions without dollarsign expansion?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;- I was a bit surprised about the {$&amp;lt;myDate={"&lt;STRONG&gt;=myDate&lt;/STRONG&gt;&amp;gt;aggr( part and thought &lt;STRONG&gt;=myDate &lt;/STRONG&gt;could be omitted&lt;/P&gt;&lt;P&gt;- But that is not the case, since the expression below doesn't work (returns 0 and 0)&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;//[1]without =myDate&lt;/P&gt;&lt;P&gt;//=sum(total&amp;lt;YearMonth&amp;gt; {$&amp;lt;myDate={"&amp;gt;aggr(min(total&amp;lt;YearMonth&amp;gt; myDate),YearMonth,myDate)"}&amp;gt;} Sales)&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;[3] how to check your setexpression easily&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;- When building more complex expressions, I often don't know why the value is incorrect (0 or null). &lt;/P&gt;&lt;P&gt;- How can I best check my set expression? &lt;/P&gt;&lt;P&gt;- Can I for example print the filter as string as an additional column?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A lot of questions, I hope someone can shed some additional light and/or refer me to handy references!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Know that I appreciate your help a lot!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 May 2012 09:11:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-needed-with-Nested-SetAnalysis/m-p/348876#M129235</guid>
      <dc:creator />
      <dc:date>2012-05-14T09:11:41Z</dc:date>
    </item>
  </channel>
</rss>

