<?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 SET ANALYSIS HELP in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/SET-ANALYSIS-HELP/m-p/550214#M205487</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good Morning to everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to select the latest date for each raw in order to get the value on that date and the days before.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is that articles in different raws have a different last date, and using the following code it picks the latest date of all the stocks which is good for 90% of the datas but not for them all....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I make it work for all the raws?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code I'm using is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum( {$&amp;lt;Date = {$(=max(Date,2))}&amp;gt;}Value )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also tried this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; aggr(NODISTINCT sum( {1&amp;lt;Date = {$(=max(Date,2))}&amp;gt;}Value ),article_code)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Before I was using this one without set analysis which works better but I get problems with non working days because on those days I don't get values.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum(if(Date=Last_Date-1,Chiusura,0))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If it's not clear I'll send a sample file in a while but I need to clean it up as it's all in italian and big one so you would get lost in it!! &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/sad.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot for your help&lt;/P&gt;&lt;P&gt;Michele&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 13 Oct 2013 09:34:28 GMT</pubDate>
    <dc:creator />
    <dc:date>2013-10-13T09:34:28Z</dc:date>
    <item>
      <title>SET ANALYSIS HELP</title>
      <link>https://community.qlik.com/t5/QlikView/SET-ANALYSIS-HELP/m-p/550214#M205487</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good Morning to everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to select the latest date for each raw in order to get the value on that date and the days before.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is that articles in different raws have a different last date, and using the following code it picks the latest date of all the stocks which is good for 90% of the datas but not for them all....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I make it work for all the raws?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code I'm using is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum( {$&amp;lt;Date = {$(=max(Date,2))}&amp;gt;}Value )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also tried this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; aggr(NODISTINCT sum( {1&amp;lt;Date = {$(=max(Date,2))}&amp;gt;}Value ),article_code)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Before I was using this one without set analysis which works better but I get problems with non working days because on those days I don't get values.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum(if(Date=Last_Date-1,Chiusura,0))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If it's not clear I'll send a sample file in a while but I need to clean it up as it's all in italian and big one so you would get lost in it!! &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/sad.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot for your help&lt;/P&gt;&lt;P&gt;Michele&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 13 Oct 2013 09:34:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SET-ANALYSIS-HELP/m-p/550214#M205487</guid>
      <dc:creator />
      <dc:date>2013-10-13T09:34:28Z</dc:date>
    </item>
    <item>
      <title>Re: SET ANALYSIS HELP</title>
      <link>https://community.qlik.com/t5/QlikView/SET-ANALYSIS-HELP/m-p/550215#M205488</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi &lt;/P&gt;&lt;P&gt;set analysis won't work in this case because , what it does is simulating a selection in the model so it will always give just one value to whole model.&lt;/P&gt;&lt;P&gt;you can use firstsortedvalue maybe something like firstsortedvalue(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Chiusura&lt;/SPAN&gt; , -Date) and then , firstsortedvalue(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Chiusura&lt;/SPAN&gt; , -Date,2 ) and so on.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 13 Oct 2013 09:54:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SET-ANALYSIS-HELP/m-p/550215#M205488</guid>
      <dc:creator>lironbaram</dc:creator>
      <dc:date>2013-10-13T09:54:23Z</dc:date>
    </item>
    <item>
      <title>Re: SET ANALYSIS HELP</title>
      <link>https://community.qlik.com/t5/QlikView/SET-ANALYSIS-HELP/m-p/550216#M205489</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It works &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;&lt;/P&gt;&lt;P&gt;Thanks a lot!!! I wasted hours not knowing that function &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/silly.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 13 Oct 2013 19:53:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SET-ANALYSIS-HELP/m-p/550216#M205489</guid>
      <dc:creator />
      <dc:date>2013-10-13T19:53:28Z</dc:date>
    </item>
    <item>
      <title>Re: SET ANALYSIS HELP</title>
      <link>https://community.qlik.com/t5/QlikView/SET-ANALYSIS-HELP/m-p/550217#M205490</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try&amp;nbsp; with the help of variables&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Oct 2013 05:28:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SET-ANALYSIS-HELP/m-p/550217#M205490</guid>
      <dc:creator />
      <dc:date>2013-10-14T05:28:06Z</dc:date>
    </item>
    <item>
      <title>Re: SET ANALYSIS HELP</title>
      <link>https://community.qlik.com/t5/QlikView/SET-ANALYSIS-HELP/m-p/550218#M205491</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if this working &lt;/P&gt;&lt;P&gt;please mark the question as answered &lt;/P&gt;&lt;P&gt;to help other users&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Oct 2013 07:25:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SET-ANALYSIS-HELP/m-p/550218#M205491</guid>
      <dc:creator>lironbaram</dc:creator>
      <dc:date>2013-10-14T07:25:56Z</dc:date>
    </item>
  </channel>
</rss>

