<?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 variable in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-Analysis-with-variable/m-p/97336#M15606</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oh i might have been a bit unclear,&lt;/P&gt;&lt;P&gt;what i mean is that it seems that the set expression in the right column of the table is static and thats where I want to use the variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have data that are not updated every month. so one project could have lastDate 2018-08-01 and a second project might have a lastDate of 2018-09-01. so by using the variable to find the first date before a selected date I am hoping to be able to get data from different periods in the same column. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hopefully it is clearer when opening the files. &lt;/P&gt;&lt;P&gt;My best regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 12 Oct 2018 07:30:15 GMT</pubDate>
    <dc:creator>patrickbender</dc:creator>
    <dc:date>2018-10-12T07:30:15Z</dc:date>
    <item>
      <title>Set Analysis with variable</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-with-variable/m-p/97329#M15599</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I have tried to solve what I thought would be a simple task for a while now and I must be missing something.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have defined two variables:&lt;/P&gt;&lt;P&gt;beforeDate = 2018-10-30&lt;/P&gt;&lt;P&gt;lastDate = MAX({$&amp;lt;dateCol={"&amp;lt;=$(=beforeDate)"}&amp;gt;}dateCol)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In a chart i have no trouble using "=$(lastDate)" in order to get the most current date before "beforeDate".&lt;/P&gt;&lt;P&gt;But when I want to use it in a Set analysis i get into trouble.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is my current expression:&lt;/P&gt;&lt;P&gt;Sum({$&amp;lt;dateCol={"=$(=lastDate)"}&amp;gt;}costCol)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What am I missing?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Oct 2018 15:52:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-with-variable/m-p/97329#M15599</guid>
      <dc:creator>patrickbender</dc:creator>
      <dc:date>2018-10-11T15:52:47Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis with variable</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-with-variable/m-p/97330#M15600</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is this the kind of behaviour you are expecting?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="316624.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/215720_316624.png" style="width: 620px; height: 236px;" /&gt;&lt;/P&gt;&lt;P&gt;If so then I think issues &lt;EM&gt;may&lt;/EM&gt; have spread from date formats (so I had to change to my local format) &amp;amp; possibly some extra '='s signs (although possibly not).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Something I picked up from a book was that in a straight table if you don't override the label you get to see the dollar expanded formula (so you can see to the right of dateCol in straight table above), which may also help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chris.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Oct 2018 16:08:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-with-variable/m-p/97330#M15600</guid>
      <dc:creator>chrismarlow</dc:creator>
      <dc:date>2018-10-11T16:08:16Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis with variable</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-with-variable/m-p/97331#M15601</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In a set expression field modifier,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;= {"=..."}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is used for an expression search, something you don't want or need if you want to filter a known date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What do you see in a chart using&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=lastDate&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;? The date, correctly formatted same way as dateCol?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then try&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;=Sum({$&amp;lt;dateCol={'$(=lastDate)'}&amp;gt;} costCol)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Besides this, read&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;A href="https://community.qlik.com/qlik-blogpost/4394"&gt;Dates in Set Analysis&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;A href="https://community.qlik.com/qlik-blogpost/3444"&gt;The Magic of Dollar Expansions&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;A href="https://community.qlik.com/qlik-blogpost/3996"&gt;The Little Equals Sign&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Oct 2018 18:01:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-with-variable/m-p/97331#M15601</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2018-10-11T18:01:15Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis with variable</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-with-variable/m-p/97332#M15602</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Stefan and Chris,&lt;/P&gt;&lt;P&gt;First of all a big thank you for trying to help me out it is much appreciated!&lt;/P&gt;&lt;P&gt;Even though I tried to amnipulate both the date formats and reading up on the very good articles you posted Stefan I can't seem to get it right.&lt;/P&gt;&lt;P&gt;I attatch a testfile and the source data if someone would like to take a look.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.5pt; font-family: 'Segoe UI',sans-serif; color: #797c7f;"&gt;&lt;A href="https://we.tl/t-VYL8DjAYbl"&gt;&lt;SPAN style="color: #409fff;"&gt;https://we.tl/t-VYL8DjAYbl&lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Oct 2018 21:25:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-with-variable/m-p/97332#M15602</guid>
      <dc:creator>patrickbender</dc:creator>
      <dc:date>2018-10-11T21:25:35Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis with variable</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-with-variable/m-p/97333#M15603</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Chris,&lt;/P&gt;&lt;P&gt;After reading Stefans articles I do think that an extra $ is needed but I want to use the variable in the expression and not use a static date as you do in the right column and thats where the wierd things start to happen. The filter doesn't seeem to work for me and I end up with the total value instead of the sum of a record that I want.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have sent an updated set of files below if you would like to take a look at it &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Oct 2018 05:21:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-with-variable/m-p/97333#M15603</guid>
      <dc:creator>patrickbender</dc:creator>
      <dc:date>2018-10-12T05:21:20Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis with variable</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-with-variable/m-p/97334#M15604</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.5pt; font-family: 'Segoe UI',sans-serif; color: #797c7f;"&gt;&lt;A href="https://we.tl/t-VejtpmidPI"&gt;&lt;SPAN style="color: #409fff;"&gt;https://we.tl/t-VejtpmidPI&lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Oct 2018 05:27:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-with-variable/m-p/97334#M15604</guid>
      <dc:creator>patrickbender</dc:creator>
      <dc:date>2018-10-12T05:27:23Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis with variable</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-with-variable/m-p/97335#M15605</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Patrick,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will try to open the files later. Not sure what you mean by static date, adding another date to my toy application &amp;amp; then updating in the text box (beforeDate);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="316624_2.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/215744_316624_2.png" style="width: 620px; height: 193px;" /&gt;&lt;/P&gt;&lt;P&gt;Am I missing something?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chris.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Oct 2018 07:20:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-with-variable/m-p/97335#M15605</guid>
      <dc:creator>chrismarlow</dc:creator>
      <dc:date>2018-10-12T07:20:10Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis with variable</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-with-variable/m-p/97336#M15606</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oh i might have been a bit unclear,&lt;/P&gt;&lt;P&gt;what i mean is that it seems that the set expression in the right column of the table is static and thats where I want to use the variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have data that are not updated every month. so one project could have lastDate 2018-08-01 and a second project might have a lastDate of 2018-09-01. so by using the variable to find the first date before a selected date I am hoping to be able to get data from different periods in the same column. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hopefully it is clearer when opening the files. &lt;/P&gt;&lt;P&gt;My best regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Oct 2018 07:30:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-with-variable/m-p/97336#M15606</guid>
      <dc:creator>patrickbender</dc:creator>
      <dc:date>2018-10-12T07:30:15Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis with variable</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-with-variable/m-p/97337#M15607</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Patrick, the dollar sign expansion as well as the set analysis is evaluated only once per chart, not per dimension line, if that's what you expect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So if you use for example project as dimension, the dollar sign expansion won't be re-evaluated per project.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Oct 2018 07:51:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-with-variable/m-p/97337#M15607</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2018-10-12T07:51:01Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis with variable</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-with-variable/m-p/97338#M15608</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Patrick,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We are both on personal edition, so I can't open your file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However I did have a think about what I think you are trying to do &amp;amp; I now remember why I hate dates in QlikView.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So in a straight table;&lt;/P&gt;&lt;P&gt;max({$&amp;lt;dateCol={"&amp;lt;$(beforeDate)"}&amp;gt;}dateCol)&lt;/P&gt;&lt;P&gt;Will return the max date before the 'beforeDate' for each account.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So in my very simple model I can then return the relevant sums using the below;&lt;/P&gt;&lt;P&gt;FirstSortedValue({$&amp;lt;dateCol={"&amp;lt;$(beforeDate)"}&amp;gt;} aggr(sum({$&amp;lt;dateCol={"&amp;lt;$(beforeDate)"}&amp;gt;}costCol), Account, dateCol),-dateCol)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So you can see for A the date &amp;amp; value for 30th Sep is returned, but B (where there is no data for Sep) returns 31st Aug instead.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="316624_3.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/215772_316624_3.png" style="width: 620px; height: 207px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My script is really simple &amp;amp; not based on your spreadsheet;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data:&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Account, dateCol, costCol&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; A, 31/10/2018, 10&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; A, 30/09/2018, 8&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; A, 31/08/2018, 7&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; B, 31/10/2018, 12&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; B, 31/08/2018, 11&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chris.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Oct 2018 11:45:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-with-variable/m-p/97338#M15608</guid>
      <dc:creator>chrismarlow</dc:creator>
      <dc:date>2018-10-12T11:45:57Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis with variable</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-with-variable/m-p/97339#M15609</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This worked perfectly!!!&lt;/P&gt;&lt;P&gt;Thank you &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;Now I just need to read up on the aggr function since i'm not comfterble with the use of that just yet &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Oct 2018 12:10:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-with-variable/m-p/97339#M15609</guid>
      <dc:creator>patrickbender</dc:creator>
      <dc:date>2018-10-15T12:10:37Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis with variable</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-with-variable/m-p/97340#M15610</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Patrick,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Glad it was helpful. I normally end up re-reading the aggr definition every time I use it &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;Cheers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chris.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Oct 2018 12:20:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-with-variable/m-p/97340#M15610</guid>
      <dc:creator>chrismarlow</dc:creator>
      <dc:date>2018-10-15T12:20:26Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis with variable</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-with-variable/m-p/97341#M15611</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Chris,&lt;/P&gt;&lt;P&gt;Sorry for opening this thread again.&lt;/P&gt;&lt;P&gt;I thought that it worked out turns out it didn't and when I rebuild your application I understand why as Stefan pointed it out for me. FirstSorted value is not able to sum two values on the same date so when I add a second line with the same date I get 0. Is there any other way to get around this?&lt;/P&gt;&lt;P&gt;I need to get the result 17 for Account A if using this data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data:&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Account, dateCol, costCol&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; A, 2018-10-31, 10&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; A, 2018-09-30, 8&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; A, 2018-09-30, 9&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; A, 2018-08-31, 7&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; B, 2018-10-31, 12&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; B, 2018-08-31, 11&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Oct 2018 14:34:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-with-variable/m-p/97341#M15611</guid>
      <dc:creator>patrickbender</dc:creator>
      <dc:date>2018-10-18T14:34:52Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis with variable</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-with-variable/m-p/97342#M15612</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Patrick,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;No worries. I am not sure why the following works (or seems to), but give it a go;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FirstSortedValue({$&amp;lt;dateCol={"&amp;lt;$(beforeDate)"}&amp;gt;} &lt;STRONG&gt;distinct&lt;/STRONG&gt; aggr(sum({$&amp;lt;dateCol={"&amp;lt;$(beforeDate)"}&amp;gt;}costCol), Account, dateCol),-dateCol)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would have assumed the distinct would have applied to the value (the aggregation) and therefor be irrelevant (it is aggregating, after all), but seems like it also has an impact on the sort weight (-dateCol).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chris.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Oct 2018 14:53:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-with-variable/m-p/97342#M15612</guid>
      <dc:creator>chrismarlow</dc:creator>
      <dc:date>2018-10-18T14:53:33Z</dc:date>
    </item>
  </channel>
</rss>

