<?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: problematical FirstSortedValue in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/problematical-FirstSortedValue/m-p/1289563#M461656</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=Date(FirstSortedValue({&amp;lt;TimeStamp&amp;nbsp; = {"&amp;gt;$(=TimeStamp(LocalTime(), 'M/D/YYYY h:mm:ss'))"}&amp;gt;} Date, Aggr(Sum({&amp;lt;TimeStamp&amp;nbsp; = {"&amp;gt;$(=TimeStamp(LocalTime(), 'M/D/YYYY h:mm:ss'))"}&amp;gt;}UnitSales) + Date/1E4, Date)))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where I modified the script a little&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ProductData:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD Customer,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; Product,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; UnitSales,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; Date as TimeStamp,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; Date(Floor(Date)) as Date;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD * inline [&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Customer|Product|UnitSales|Date&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Astrida|AA||12/19/2016 23:00:00&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Astrida|AA|12|12/20/2016 10:00:00&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Astrida|BB||12/20/2016 10:30:00&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Betacab|BB|5|12/20/2016 12:15:00&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Betacab|CC|1|12/20/2016 12:16:00&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Betacab|DD|1|12/20/2016 12:30:00&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Canutility|AA|8|12/20/2016 12:45:00&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Canutility|CC|1|12/20/2016 13:00:00&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Astrida|CC||12/20/2016 14:00:00&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Astrida|AA|10|12/20/2016 15:00:00&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Astrida|CC||12/21/2016 11:00:00&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Betacab|CC|5|12/21/2016 17:00:00&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Betacab|CC||12/22/2016 20:00:00&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Betacab|CC||12/23/2016 01:00:00&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;] (delimiter is '|');&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 20 Dec 2016 14:01:49 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2016-12-20T14:01:49Z</dc:date>
    <item>
      <title>problematical FirstSortedValue</title>
      <link>https://community.qlik.com/t5/QlikView/problematical-FirstSortedValue/m-p/1289555#M461648</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Qlik professors,&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757;"&gt;Need advices , also it would be good if someone explained my mistakes. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757;"&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;I have a problem of getting first ( lowest ) Date&amp;nbsp; where is minimum count UnitSales and which is higher than today's date. &lt;/SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757;"&gt;For example LocalTime() = 12/20/2016 12:00:00 &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Then i need too get 12/22/2016, because at day 22 &lt;SPAN style="color: #0000ff;"&gt;count&lt;/SPAN&gt;(&lt;SPAN style="color: #ff9900; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;UnitSales&lt;/SPAN&gt;) = 0&amp;nbsp; and &lt;SPAN style="font-size: 13.3333px;"&gt;because &lt;/SPAN&gt;&lt;STRONG&gt;12/22/2016&amp;nbsp; &amp;gt; 12/20/2016 12:00:00 &lt;/STRONG&gt;but&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;12/22/2016&amp;nbsp; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt; 12/23/2016 01:00:00&lt;/SPAN&gt; .&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757;"&gt;My data looks like that:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN style="color: #800000;"&gt;ProductData&lt;/SPAN&gt;:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN style="color: #0000ff;"&gt;LOAD&lt;/SPAN&gt; * &lt;SPAN style="color: #0000ff;"&gt;inline&lt;/SPAN&gt; [&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 10pt;"&gt;Customer|Product|UnitSales|Date&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;Astrida|AA||12/19/2016 23:00:00&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;Astrida|AA|12|12/20/2016 10:00:00&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;Astrida|BB||12/20/2016 10:30:00&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;Betacab|BB|5|12/20/2016 12:15:00&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;Betacab|CC|1|12/20/2016 12:16:00&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;Betacab|DD|1|12/20/2016 12:30:00&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;Canutility|AA|8|12/20/2016 12:45:00&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;Canutility|CC|1|12/20/2016 13:00:00&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;Astrida|CC||12/20/2016 14:00:00&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;Astrida|AA|10|12/20/2016 15:00:00&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;Astrida|CC||12/21/2016 11:00:00&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;Betacab|CC|5|12/21/2016 17:00:00&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;Betacab|CC||12/22/2016 20:00:00&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;Betacab|CC||12/23/2016 01:00:00&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;] (&lt;SPAN style="color: #0000ff;"&gt;delimiter is&lt;/SPAN&gt; '|');&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757;"&gt;Feels like i have tried everything, this is the closet:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;Date(&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&amp;nbsp; firstsortedvalue (&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; distinct {&amp;lt; Date&amp;nbsp; = {'&amp;gt;$(=LocalTime())'} &amp;gt;} Date,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&amp;nbsp; aggr(&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; count(UnitSales) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; , Date &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&amp;nbsp; )&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN style="color: #333333;"&gt;I hope there is solution&lt;/SPAN&gt; &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Thank you for your time.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Dec 2016 09:56:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/problematical-FirstSortedValue/m-p/1289555#M461648</guid>
      <dc:creator />
      <dc:date>2016-12-20T09:56:21Z</dc:date>
    </item>
    <item>
      <title>Re: problematical FirstSortedValue</title>
      <link>https://community.qlik.com/t5/QlikView/problematical-FirstSortedValue/m-p/1289556#M461649</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How about this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=Date(FirstSortedValue(DISTINCT {&amp;lt;Date&amp;nbsp; = {&lt;SPAN style="color: #ff0000;"&gt;"&lt;/SPAN&gt;&amp;gt;$(=&lt;SPAN style="color: #ff0000;"&gt;TimeStamp(&lt;/SPAN&gt;LocalTime()&lt;SPAN style="color: #ff0000;"&gt;, 'M/D/YYYY h:mm:ss')&lt;/SPAN&gt;)&lt;SPAN style="color: #ff0000;"&gt;"&lt;/SPAN&gt;}&amp;gt;} Date, Aggr(Count(UnitSales), Date)))&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Dec 2016 13:00:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/problematical-FirstSortedValue/m-p/1289556#M461649</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-12-20T13:00:50Z</dc:date>
    </item>
    <item>
      <title>Re: problematical FirstSortedValue</title>
      <link>https://community.qlik.com/t5/QlikView/problematical-FirstSortedValue/m-p/1289557#M461650</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;it returns &lt;STRONG&gt;12/21/2016&lt;/STRONG&gt; and i need &lt;STRONG&gt;12/22/2016. &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;if we count UnitSales then Day 20 will have "7+2*0", Day 21 &lt;SPAN style="font-size: 13.3333px;"&gt;"&lt;/SPAN&gt;1+0&lt;SPAN style="font-size: 13.3333px;"&gt;"&lt;/SPAN&gt;, Day 22 &lt;SPAN style="font-size: 13.3333px;"&gt;"&lt;/SPAN&gt;0&lt;SPAN style="font-size: 13.3333px;"&gt;"&lt;/SPAN&gt;, Day 23 &lt;SPAN style="font-size: 13.3333px;"&gt;"&lt;/SPAN&gt;0&lt;SPAN style="font-size: 13.3333px;"&gt;"&lt;/SPAN&gt;. &lt;BR /&gt;I need date &lt;STRONG style="font-size: 13.3333px;"&gt;12/22/2016&lt;/STRONG&gt; because it have lowest count and and lowest date. &lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13px;"&gt;Best Regards &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Dec 2016 13:41:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/problematical-FirstSortedValue/m-p/1289557#M461650</guid>
      <dc:creator />
      <dc:date>2016-12-20T13:41:18Z</dc:date>
    </item>
    <item>
      <title>Re: problematical FirstSortedValue</title>
      <link>https://community.qlik.com/t5/QlikView/problematical-FirstSortedValue/m-p/1289558#M461651</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure I am understanding the logic here&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt;if we count UnitSales then Day 20 will have "7+2*0", Day 21 &lt;SPAN style="font-size: 13.3333px;"&gt;"&lt;/SPAN&gt;1+0&lt;SPAN style="font-size: 13.3333px;"&gt;"&lt;/SPAN&gt;, Day 22 &lt;SPAN style="font-size: 13.3333px;"&gt;"&lt;/SPAN&gt;0&lt;SPAN style="font-size: 13.3333px;"&gt;"&lt;/SPAN&gt;, Day 23 &lt;SPAN style="font-size: 13.3333px;"&gt;"&lt;/SPAN&gt;0&lt;SPAN style="font-size: 13.3333px;"&gt;"&lt;/SPAN&gt;. &lt;/P&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Dec 2016 13:45:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/problematical-FirstSortedValue/m-p/1289558#M461651</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-12-20T13:45:55Z</dc:date>
    </item>
    <item>
      <title>Re: problematical FirstSortedValue</title>
      <link>https://community.qlik.com/t5/QlikView/problematical-FirstSortedValue/m-p/1289559#M461652</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if change to &lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;=&lt;SPAN style="color: #ff0000;"&gt;Timestamp&lt;/SPAN&gt;(FirstSortedValue(DISTINCT {&amp;lt;Date&amp;nbsp; = {&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #ff0000;"&gt;"&lt;/SPAN&gt;&amp;gt;$(=&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #ff0000;"&gt;TimeStamp(&lt;/SPAN&gt;LocalTime()&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #ff0000;"&gt;, 'M/D/YYYY h:mm:ss')&lt;/SPAN&gt;)&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #ff0000;"&gt;"&lt;/SPAN&gt;}&amp;gt;} Date, Aggr(Count(UnitSales), Date)))&lt;/STRONG&gt; then it returns 12/21/2016 11:00:00 instead of 12/22/2016 20:00:00&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Dec 2016 13:46:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/problematical-FirstSortedValue/m-p/1289559#M461652</guid>
      <dc:creator />
      <dc:date>2016-12-20T13:46:38Z</dc:date>
    </item>
    <item>
      <title>Re: problematical FirstSortedValue</title>
      <link>https://community.qlik.com/t5/QlikView/problematical-FirstSortedValue/m-p/1289560#M461653</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I guess I am in a different timezone, what is your time right now?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Dec 2016 13:48:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/problematical-FirstSortedValue/m-p/1289560#M461653</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-12-20T13:48:37Z</dc:date>
    </item>
    <item>
      <title>Re: problematical FirstSortedValue</title>
      <link>https://community.qlik.com/t5/QlikView/problematical-FirstSortedValue/m-p/1289561#M461654</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Trying my best.&lt;/P&gt;&lt;P&gt;I mean if we count UnitSales per day we at day 20 we will get 7 because there 7 values and 2 null() values.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Dec 2016 13:50:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/problematical-FirstSortedValue/m-p/1289561#M461654</guid>
      <dc:creator />
      <dc:date>2016-12-20T13:50:33Z</dc:date>
    </item>
    <item>
      <title>Re: problematical FirstSortedValue</title>
      <link>https://community.qlik.com/t5/QlikView/problematical-FirstSortedValue/m-p/1289562#M461655</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;15:50 &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt; I from lithuania&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Dec 2016 13:51:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/problematical-FirstSortedValue/m-p/1289562#M461655</guid>
      <dc:creator />
      <dc:date>2016-12-20T13:51:14Z</dc:date>
    </item>
    <item>
      <title>Re: problematical FirstSortedValue</title>
      <link>https://community.qlik.com/t5/QlikView/problematical-FirstSortedValue/m-p/1289563#M461656</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=Date(FirstSortedValue({&amp;lt;TimeStamp&amp;nbsp; = {"&amp;gt;$(=TimeStamp(LocalTime(), 'M/D/YYYY h:mm:ss'))"}&amp;gt;} Date, Aggr(Sum({&amp;lt;TimeStamp&amp;nbsp; = {"&amp;gt;$(=TimeStamp(LocalTime(), 'M/D/YYYY h:mm:ss'))"}&amp;gt;}UnitSales) + Date/1E4, Date)))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where I modified the script a little&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ProductData:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD Customer,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; Product,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; UnitSales,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; Date as TimeStamp,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; Date(Floor(Date)) as Date;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD * inline [&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Customer|Product|UnitSales|Date&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Astrida|AA||12/19/2016 23:00:00&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Astrida|AA|12|12/20/2016 10:00:00&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Astrida|BB||12/20/2016 10:30:00&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Betacab|BB|5|12/20/2016 12:15:00&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Betacab|CC|1|12/20/2016 12:16:00&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Betacab|DD|1|12/20/2016 12:30:00&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Canutility|AA|8|12/20/2016 12:45:00&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Canutility|CC|1|12/20/2016 13:00:00&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Astrida|CC||12/20/2016 14:00:00&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Astrida|AA|10|12/20/2016 15:00:00&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Astrida|CC||12/21/2016 11:00:00&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Betacab|CC|5|12/21/2016 17:00:00&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Betacab|CC||12/22/2016 20:00:00&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Betacab|CC||12/23/2016 01:00:00&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;] (delimiter is '|');&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Dec 2016 14:01:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/problematical-FirstSortedValue/m-p/1289563#M461656</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-12-20T14:01:49Z</dc:date>
    </item>
    <item>
      <title>Re: problematical FirstSortedValue</title>
      <link>https://community.qlik.com/t5/QlikView/problematical-FirstSortedValue/m-p/1289564#M461657</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sunny, take care to add small amounts proportional to date as weight, that are smaller than the UnitSales increments you are aggregating. In this case, I would use at least Date/1E5.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Dec 2016 14:09:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/problematical-FirstSortedValue/m-p/1289564#M461657</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-12-20T14:09:11Z</dc:date>
    </item>
    <item>
      <title>Re: problematical FirstSortedValue</title>
      <link>https://community.qlik.com/t5/QlikView/problematical-FirstSortedValue/m-p/1289565#M461658</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes you are right, I was going to do 1E10, but somehow ended with just 1E4&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Dec 2016 14:12:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/problematical-FirstSortedValue/m-p/1289565#M461658</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-12-20T14:12:06Z</dc:date>
    </item>
    <item>
      <title>Re: problematical FirstSortedValue</title>
      <link>https://community.qlik.com/t5/QlikView/problematical-FirstSortedValue/m-p/1289566#M461659</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Many many Thanks, its correct answer.&lt;/P&gt;&lt;P&gt;But could you please explain this part&amp;nbsp; &lt;STRONG&gt;+ Date/1E4,&lt;/STRONG&gt; can't figure out what its doing.&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;Best Regards.&lt;/SPAN&gt;&lt;SPAN class="emoticon-inline emoticon_happy" style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Dec 2016 14:15:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/problematical-FirstSortedValue/m-p/1289566#M461659</guid>
      <dc:creator />
      <dc:date>2016-12-20T14:15:36Z</dc:date>
    </item>
    <item>
      <title>Re: problematical FirstSortedValue</title>
      <link>https://community.qlik.com/t5/QlikView/problematical-FirstSortedValue/m-p/1289567#M461660</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Since there were two dates to choose from 12/21 and 12/22, I added back the date to give them different sorting weights. 12/21 in its numeric form is divided by 1E10 (1E4 might not be a good idea) to make its sort weight smaller than the sort weight of the Sum(UnitSales) which is the first thing we want to worry about.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Dec 2016 14:18:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/problematical-FirstSortedValue/m-p/1289567#M461660</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-12-20T14:18:04Z</dc:date>
    </item>
    <item>
      <title>Re: problematical FirstSortedValue</title>
      <link>https://community.qlik.com/t5/QlikView/problematical-FirstSortedValue/m-p/1289568#M461661</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Dec 2016 14:25:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/problematical-FirstSortedValue/m-p/1289568#M461661</guid>
      <dc:creator />
      <dc:date>2016-12-20T14:25:13Z</dc:date>
    </item>
  </channel>
</rss>

