<?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: FirstSortedValue( Aggr(Concat(distinct Name, ',') , Date), -Aggr(Date,Date))  this expression how to write in script level in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/FirstSortedValue-Aggr-Concat-distinct-Name-Date-Aggr-Date-Date/m-p/1385138#M421806</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ashok,&lt;/P&gt;&lt;P&gt;Suggesting an alternative approach, in case if it still helps and to share with community a solution that worked for me and allowed me to avoid the complexity of writing a longer set-analysis expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Temp:&lt;BR /&gt;Load &lt;BR /&gt; distinct max(Date) as Date&lt;BR /&gt;Resident Facts&lt;BR /&gt;Group by Name;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Left Join (Facts)&lt;BR /&gt;Load&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1 as MaxNameDate&lt;BR /&gt;Resident Temp;&lt;/P&gt;&lt;P&gt;Drop Table Temp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then use something like =Sum({&amp;lt;MaxNameDate={1}&amp;gt;}Value), as an example, for doing aggregation for records where date is max for name in chart with dimension = Name&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 29 Sep 2017 09:21:56 GMT</pubDate>
    <dc:creator>sandeep_sarawgi</dc:creator>
    <dc:date>2017-09-29T09:21:56Z</dc:date>
    <item>
      <title>FirstSortedValue( Aggr(Concat(distinct Name, ',') , Date), -Aggr(Date,Date))  this expression how to write in script level</title>
      <link>https://community.qlik.com/t5/QlikView/FirstSortedValue-Aggr-Concat-distinct-Name-Date-Aggr-Date-Date/m-p/1385134#M421802</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;FirstSortedValue( Aggr(Concat(distinct Name, ',') , Date), -Aggr(Date,Date))&amp;nbsp; this expression how to write in script level&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 10 Sep 2017 10:44:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/FirstSortedValue-Aggr-Concat-distinct-Name-Date-Aggr-Date-Date/m-p/1385134#M421802</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-09-10T10:44:08Z</dc:date>
    </item>
    <item>
      <title>Re: FirstSortedValue( Aggr(Concat(distinct Name, ',') , Date), -Aggr(Date,Date))  this expression how to write in script level</title>
      <link>https://community.qlik.com/t5/QlikView/FirstSortedValue-Aggr-Concat-distinct-Name-Date-Aggr-Date-Date/m-p/1385135#M421803</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you provide some sample data with an expected output?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 10 Sep 2017 18:03:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/FirstSortedValue-Aggr-Concat-distinct-Name-Date-Aggr-Date-Date/m-p/1385135#M421803</guid>
      <dc:creator>vishsaggi</dc:creator>
      <dc:date>2017-09-10T18:03:11Z</dc:date>
    </item>
    <item>
      <title>Re: FirstSortedValue( Aggr(Concat(distinct Name, ',') , Date), -Aggr(Date,Date))  this expression how to write in script level</title>
      <link>https://community.qlik.com/t5/QlikView/FirstSortedValue-Aggr-Concat-distinct-Name-Date-Aggr-Date-Date/m-p/1385136#M421804</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think You want &lt;STRONG&gt;Name&lt;/STRONG&gt; which belongs to highest date among all the listed dates.!!&lt;/P&gt;&lt;P&gt;Am I Correct?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 10 Sep 2017 19:27:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/FirstSortedValue-Aggr-Concat-distinct-Name-Date-Aggr-Date-Date/m-p/1385136#M421804</guid>
      <dc:creator>surendraj</dc:creator>
      <dc:date>2017-09-10T19:27:24Z</dc:date>
    </item>
    <item>
      <title>Re: FirstSortedValue( Aggr(Concat(distinct Name, ',') , Date), -Aggr(Date,Date))  this expression how to write in script level</title>
      <link>https://community.qlik.com/t5/QlikView/FirstSortedValue-Aggr-Concat-distinct-Name-Date-Aggr-Date-Date/m-p/1385137#M421805</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be like this...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Assuming you have a table like this.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Fact:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD &lt;SPAN style="font-size: 13.3333px;"&gt;Name&lt;/SPAN&gt;,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FROM ....&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #ff0000;"&gt;AggrTable:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;LOAD Concat(DISTINCT Name) as ConcatName,&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;Resident Fact&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;Group By Date;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;Right Join (AggrTable)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;LOAD Max(Date) as Date&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #ff0000;"&gt;Resident AggrTable;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 10 Sep 2017 23:27:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/FirstSortedValue-Aggr-Concat-distinct-Name-Date-Aggr-Date-Date/m-p/1385137#M421805</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-09-10T23:27:34Z</dc:date>
    </item>
    <item>
      <title>Re: FirstSortedValue( Aggr(Concat(distinct Name, ',') , Date), -Aggr(Date,Date))  this expression how to write in script level</title>
      <link>https://community.qlik.com/t5/QlikView/FirstSortedValue-Aggr-Concat-distinct-Name-Date-Aggr-Date-Date/m-p/1385138#M421806</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ashok,&lt;/P&gt;&lt;P&gt;Suggesting an alternative approach, in case if it still helps and to share with community a solution that worked for me and allowed me to avoid the complexity of writing a longer set-analysis expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Temp:&lt;BR /&gt;Load &lt;BR /&gt; distinct max(Date) as Date&lt;BR /&gt;Resident Facts&lt;BR /&gt;Group by Name;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Left Join (Facts)&lt;BR /&gt;Load&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1 as MaxNameDate&lt;BR /&gt;Resident Temp;&lt;/P&gt;&lt;P&gt;Drop Table Temp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then use something like =Sum({&amp;lt;MaxNameDate={1}&amp;gt;}Value), as an example, for doing aggregation for records where date is max for name in chart with dimension = Name&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Sep 2017 09:21:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/FirstSortedValue-Aggr-Concat-distinct-Name-Date-Aggr-Date-Date/m-p/1385138#M421806</guid>
      <dc:creator>sandeep_sarawgi</dc:creator>
      <dc:date>2017-09-29T09:21:56Z</dc:date>
    </item>
    <item>
      <title>Re: FirstSortedValue( Aggr(Concat(distinct Name, ',') , Date), -Aggr(Date,Date))  this expression how to write in script level</title>
      <link>https://community.qlik.com/t5/QlikView/FirstSortedValue-Aggr-Concat-distinct-Name-Date-Aggr-Date-Date/m-p/1385139#M421807</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;what is the reason to do this in script? Is there any performnace issue? If you can tell us your need ,we can suggest some easier expression with bit of script solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Perhaps, you can do like below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fact:&lt;/P&gt;&lt;P&gt;LOAD Name,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date&lt;/P&gt;&lt;P&gt;FROM Tbale;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;left join(Fact)&lt;/P&gt;&lt;P&gt;LOAD concate(distinct Name,',') as Name,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date&lt;/P&gt;&lt;P&gt;Resident Fact&lt;/P&gt;&lt;P&gt;group by Date;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;left joion(Fact)&lt;/P&gt;&lt;P&gt;LOAD max(Date) as Date&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1 as &lt;STRONG&gt;isMaxDate&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;resident Fact;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can now use &lt;STRONG&gt;isMaxDate&lt;/STRONG&gt; flag in your expression&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Sep 2017 10:03:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/FirstSortedValue-Aggr-Concat-distinct-Name-Date-Aggr-Date-Date/m-p/1385139#M421807</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2017-09-29T10:03:01Z</dc:date>
    </item>
  </channel>
</rss>

