<?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 with aggr fuction in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-analysis-with-aggr-fuction/m-p/657213#M1070438</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;Try like this in script&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;*,&lt;/P&gt;&lt;P&gt;If(Previous(MetricID) = MetricID, Previous(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;MetricValue&lt;/SPAN&gt;)) AS PreviousValue;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;FROM DataSource&lt;/P&gt;&lt;P&gt;ORDER BY MetricID, &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;COMPARE_BD&lt;/SPAN&gt;; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now use PreviousValue in your set analysis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jagan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 27 Aug 2014 01:49:33 GMT</pubDate>
    <dc:creator>jagan</dc:creator>
    <dc:date>2014-08-27T01:49:33Z</dc:date>
    <item>
      <title>Set analysis with aggr fuction</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-with-aggr-fuction/m-p/657212#M1070436</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello there,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am struggling to get this set analysis right to get the previous compare date value against the current selected business date.&lt;/P&gt;&lt;P&gt;Please, find the below sample data and will appreciate your help and quick response.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 387px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD height="20" width="64"&gt;Metric ID&lt;/TD&gt;&lt;TD width="73"&gt;LBD&lt;/TD&gt;&lt;TD width="73"&gt;BD&lt;/TD&gt;&lt;TD width="94"&gt;COMPARE_BD&lt;/TD&gt;&lt;TD width="83"&gt;MetricValue&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="20"&gt;1&lt;/TD&gt;&lt;TD align="right" class="xl63"&gt;2014-08-23&lt;/TD&gt;&lt;TD align="right" class="xl63"&gt;2014-08-25&lt;/TD&gt;&lt;TD align="right" class="xl63"&gt;2014-08-20&lt;/TD&gt;&lt;TD align="right"&gt;100&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="20"&gt;2&lt;/TD&gt;&lt;TD align="right" class="xl63"&gt;2014-08-24&lt;/TD&gt;&lt;TD align="right" class="xl63"&gt;2014-08-25&lt;/TD&gt;&lt;TD align="right" class="xl63"&gt;2014-08-21&lt;/TD&gt;&lt;TD align="right"&gt;200&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="20"&gt;3&lt;/TD&gt;&lt;TD align="right" class="xl63"&gt;2014-08-25&lt;/TD&gt;&lt;TD align="right" class="xl63"&gt;2014-08-25&lt;/TD&gt;&lt;TD align="right" class="xl63"&gt;2014-08-22&lt;/TD&gt;&lt;TD align="right"&gt;300&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="20"&gt;1&lt;/TD&gt;&lt;TD align="right" class="xl63"&gt;2014-08-26&lt;/TD&gt;&lt;TD align="right" class="xl63"&gt;2014-08-28&lt;/TD&gt;&lt;TD align="right" class="xl63"&gt;2014-08-23&lt;/TD&gt;&lt;TD align="right"&gt;1000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="20"&gt;2&lt;/TD&gt;&lt;TD align="right" class="xl63"&gt;2014-08-27&lt;/TD&gt;&lt;TD align="right" class="xl63"&gt;2014-08-28&lt;/TD&gt;&lt;TD align="right" class="xl63"&gt;2014-08-24&lt;/TD&gt;&lt;TD align="right"&gt;1500&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="20"&gt;3&lt;/TD&gt;&lt;TD align="right" class="xl63"&gt;2014-08-28&lt;/TD&gt;&lt;TD align="right" class="xl63"&gt;2014-08-28&lt;/TD&gt;&lt;TD align="right" class="xl63"&gt;2014-08-25&lt;/TD&gt;&lt;TD align="right"&gt;600&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The out required as below for the selection BD = '&lt;SPAN style="text-align: -webkit-right;"&gt;2014-08-28&lt;/SPAN&gt;'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 392px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl63" height="17" width="98"&gt;Metric ID&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="98"&gt;Value&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="98"&gt;Compare BD&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="98"&gt;Previous Value&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17" style="border-top: none;"&gt; Total&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none;"&gt;3100&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;-&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;600&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl67" height="17" style="border-top: none;"&gt;1&lt;/TD&gt;&lt;TD align="right" class="xl67" style="border-top: none; border-left: none;"&gt;1000&lt;/TD&gt;&lt;TD class="xl68" style="border-top: none; border-left: none;"&gt;2014-08-23&lt;/TD&gt;&lt;TD align="right"&gt;100&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl67" height="17" style="border-top: none;"&gt;2&lt;/TD&gt;&lt;TD align="right" class="xl67" style="border-top: none; border-left: none;"&gt;1500&lt;/TD&gt;&lt;TD class="xl68" style="border-top: none; border-left: none;"&gt;2014-08-24&lt;/TD&gt;&lt;TD align="right"&gt;200&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl67" height="17" style="border-top: none;"&gt;3&lt;/TD&gt;&lt;TD align="right" class="xl67" style="border-top: none; border-left: none;"&gt;600&lt;/TD&gt;&lt;TD class="xl68" style="border-top: none; border-left: none;"&gt;2014-08-25&lt;/TD&gt;&lt;TD align="right"&gt;300&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using set analysis with aggr function but it's not giving me the right value as it is showing the current values only&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Compare BD = only(aggr(NODISTINCT only(COMPARE_BD),[Metric ID])) - which is working fine&lt;/P&gt;&lt;P&gt;Sum({&amp;lt;"LBD = {only(aggr(NODISTINCT only(COMPARE_BD),[Metric ID]))}" &amp;gt;} MetricValue)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please, let me know if you required more information on requirement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;S&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Aug 2014 00:44:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-with-aggr-fuction/m-p/657212#M1070436</guid>
      <dc:creator />
      <dc:date>2014-08-27T00:44:41Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis with aggr fuction</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-with-aggr-fuction/m-p/657213#M1070438</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;Try like this in script&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;*,&lt;/P&gt;&lt;P&gt;If(Previous(MetricID) = MetricID, Previous(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;MetricValue&lt;/SPAN&gt;)) AS PreviousValue;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;FROM DataSource&lt;/P&gt;&lt;P&gt;ORDER BY MetricID, &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;COMPARE_BD&lt;/SPAN&gt;; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now use PreviousValue in your set analysis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jagan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Aug 2014 01:49:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-with-aggr-fuction/m-p/657213#M1070438</guid>
      <dc:creator>jagan</dc:creator>
      <dc:date>2014-08-27T01:49:33Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis with aggr fuction</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-with-aggr-fuction/m-p/657214#M1070440</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jagan, &lt;/P&gt;&lt;P&gt;Thanks for your reply, appreciate it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is just sample data I provided here the actual data model and presentation requirement is different.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately, I need to use this in pivot table and the database is big and those values are in different tables and don't want to perform unnecessary resident load and etc. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sandip.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Aug 2014 02:53:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-with-aggr-fuction/m-p/657214#M1070440</guid>
      <dc:creator />
      <dc:date>2014-08-27T02:53:39Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis with aggr fuction</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-with-aggr-fuction/m-p/657215#M1070441</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;It is difficult to handle in front end.&amp;nbsp; Can you attach sample file?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jagan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Aug 2014 05:30:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-with-aggr-fuction/m-p/657215#M1070441</guid>
      <dc:creator>jagan</dc:creator>
      <dc:date>2014-08-27T05:30:37Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis with aggr fuction</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-with-aggr-fuction/m-p/657216#M1070442</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jagan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't have sample file at the moment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sandip.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Aug 2014 13:16:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-with-aggr-fuction/m-p/657216#M1070442</guid>
      <dc:creator />
      <dc:date>2014-08-27T13:16:29Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis with aggr fuction</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-with-aggr-fuction/m-p/657217#M1070443</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think I have found the solution without using set analysis as below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;sum({&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;BD&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;=&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;LBD&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;aggr&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;nodistinct&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;only&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;COMPARE_LBD&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;),&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Metric Name]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;),&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Metric Value]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AS it seems to be working but if anyone can find set analysis solution for this than it will be great.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sandip.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Aug 2014 20:36:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-with-aggr-fuction/m-p/657217#M1070443</guid>
      <dc:creator />
      <dc:date>2014-08-27T20:36:18Z</dc:date>
    </item>
  </channel>
</rss>

