<?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: Set Analysis in Pivot Table in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-Analysis-in-Pivot-Table/m-p/1593773#M738017</link>
    <description>&lt;P&gt;&lt;EM&gt;Great, Sunny_talwar.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;the solution is good.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;I 'll try to use your solution to my most complex expression.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Thank very much.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 19 Jun 2019 17:32:08 GMT</pubDate>
    <dc:creator>fineasfalco</dc:creator>
    <dc:date>2019-06-19T17:32:08Z</dc:date>
    <item>
      <title>Set Analysis in Pivot Table</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-in-Pivot-Table/m-p/1593754#M738014</link>
      <description>&lt;P&gt;Hi Qlik community,&lt;/P&gt;&lt;P&gt;I have a problem with a complex set analysis expression within a pivot table.&lt;/P&gt;&lt;P&gt;To better describe my problem, I have created an example.&lt;/P&gt;&lt;P&gt;I have the following test data:&lt;/P&gt;&lt;P&gt;TEST:&lt;BR /&gt;LOAD * INLINE [&lt;EM&gt;MyPeriod, MyReferencePeriod, MyProduct, MyQty&lt;/EM&gt;&lt;BR /&gt;"2019'Q1", "2018'Q1", "A1", 100&lt;BR /&gt;"2019'Q1", "2018'Q1", "A2", 100&lt;BR /&gt;"2019'Q1", "2017'Q1", "A3", 100&lt;BR /&gt;"2018'Q4", "2017'Q1", "A1", 100&lt;BR /&gt;"2018'Q4", "2016'Q1", "A2", 100&lt;BR /&gt;"2018'Q4", "2016'Q4", "A3", 100&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;I added this data to a pivot chart where the &lt;STRONG&gt;&lt;EM&gt;MyPeriod&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp; dimension is a column field,&lt;/P&gt;&lt;P&gt;I have created a simple espression&lt;STRONG&gt; sumQty&lt;/STRONG&gt; =&lt;EM&gt; sum(myQty)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="pivot table img.png" style="width: 554px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/14026iBFA4621AB67F7BEC/image-size/large?v=v2&amp;amp;px=999" role="button" title="pivot table img.png" alt="pivot table img.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I want to define a new expression &lt;STRONG&gt;NewSumQty&lt;/STRONG&gt; that calculates the sum of&amp;nbsp; quantity&amp;nbsp; for each product in which &lt;EM&gt;MyReferencePeriod&lt;/EM&gt; is maximum for rolling period (&lt;EM&gt;&lt;STRONG&gt;MyPeriod&lt;/STRONG&gt;&lt;/EM&gt;).&lt;/P&gt;&lt;P&gt;That is&lt;/P&gt;&lt;P&gt;NewSumQty&amp;nbsp; = A1 Qty + A2 Qty&amp;nbsp; (200pcs)&amp;nbsp;&amp;nbsp; with &lt;EM&gt;MyPeriod&lt;/EM&gt; = 2019'Q1&amp;nbsp; (Max of &lt;EM&gt;MyReferencePeriod&lt;/EM&gt; is equal to&amp;nbsp;&amp;nbsp; 2018'Q1)&lt;/P&gt;&lt;P&gt;NewSumQty&amp;nbsp; = A1 Qty&amp;nbsp; (100 pcs)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; with &lt;EM&gt;MyPeriod&lt;/EM&gt; = 2018'Q4 (Max of &lt;EM&gt;MyReferencePeriod&lt;/EM&gt; is equal to 2017'Q1)&lt;/P&gt;&lt;P&gt;To implement this I must use the set analysis features.&lt;/P&gt;&lt;P&gt;I tried to implement it but the expression is not performed correctly.&lt;/P&gt;&lt;P&gt;i.e&amp;nbsp; &lt;STRONG&gt;NewSumQty&lt;/STRONG&gt; = &lt;STRONG&gt;sum&lt;/STRONG&gt;({$&amp;lt;[&lt;EM&gt;MyReferencePeriod&lt;/EM&gt;] = {"$(=&lt;STRONG&gt;'Aggr&lt;/STRONG&gt;(&lt;STRONG&gt;Maxstring&lt;/STRONG&gt;([&lt;EM&gt;MyReferencePeriod&lt;/EM&gt;]),[MyPeriod])')"}&amp;gt;} [MyQty])&lt;/P&gt;&lt;P&gt;Could you help me to implement this expression?&lt;/P&gt;&lt;P&gt;Thank you very much for your support.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;fineas&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-in-Pivot-Table/m-p/1593754#M738014</guid>
      <dc:creator>fineasfalco</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis in Pivot Table</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-in-Pivot-Table/m-p/1593767#M738015</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Sum(Aggr(
If(MyReferencePeriod = MaxString(TOTAL &amp;lt;MyPeriod&amp;gt; MyReferencePeriod), Sum(myQty))
, MyPeriod, MyReferencePeriod))&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 19 Jun 2019 17:11:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-in-Pivot-Table/m-p/1593767#M738015</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-06-19T17:11:45Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis in Pivot Table</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-in-Pivot-Table/m-p/1593773#M738017</link>
      <description>&lt;P&gt;&lt;EM&gt;Great, Sunny_talwar.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;the solution is good.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;I 'll try to use your solution to my most complex expression.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Thank very much.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jun 2019 17:32:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-in-Pivot-Table/m-p/1593773#M738017</guid>
      <dc:creator>fineasfalco</dc:creator>
      <dc:date>2019-06-19T17:32:08Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis in Pivot Table</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-in-Pivot-Table/m-p/1594067#M738019</link>
      <description>&lt;P&gt;Thank you for your prompt reply.&lt;/P&gt;&lt;P&gt;The proposed solution allows to achieve the result in a different way, but It 's possible get the same result with set analysis approach.&lt;/P&gt;&lt;P&gt;My problem showed is a simplification . I use a more complex set analysis expression.&lt;/P&gt;&lt;P&gt;I hope that exist a set analysis method, in this case the Max of MyReferencePeriod is a parameter of my&amp;nbsp;set analysis espression.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jun 2019 10:30:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-in-Pivot-Table/m-p/1594067#M738019</guid>
      <dc:creator>fineasfalco</dc:creator>
      <dc:date>2019-06-20T10:30:29Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis in Pivot Table</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-in-Pivot-Table/m-p/1594072#M738020</link>
      <description>&lt;P&gt;You can create a flag in the script to do this using set analysis, but without further manipulation in the script... this isn't possible&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jun 2019 10:39:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-in-Pivot-Table/m-p/1594072#M738020</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-06-20T10:39:26Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis in Pivot Table</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-in-Pivot-Table/m-p/1594098#M738021</link>
      <description>&lt;P&gt;my doubt is how to do it, because I don't&amp;nbsp; want to precalculate the maximum and put it in a variable so I can use the value as a static parameter in my set analsysis espression, in fact I want the maximum of MyReferencePeriod to be contextual to MyPeriod, I want the parameter to change when MyPeriod changes, MyPeriod is a field column in a pivot table. My goal that the parameter maximum of MyReferencePeriod is calculated within my espression.&lt;/P&gt;&lt;P&gt;I hope I was clear.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jun 2019 11:15:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-in-Pivot-Table/m-p/1594098#M738021</guid>
      <dc:creator>fineasfalco</dc:creator>
      <dc:date>2019-06-20T11:15:25Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis in Pivot Table</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-in-Pivot-Table/m-p/1594104#M738022</link>
      <description>&lt;P&gt;Then you have to use Aggr()&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jun 2019 11:29:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-in-Pivot-Table/m-p/1594104#M738022</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-06-20T11:29:01Z</dc:date>
    </item>
  </channel>
</rss>

