<?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: Help with firstsortedvalue and fabs in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Help-with-firstsortedvalue-and-fabs/m-p/1562291#M742280</link>
    <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;I don't know how data is related in your problem but I would use Aggr instead FirstSortedValue. Please, find the attached file where I think I solve your issue. Hope it helps!&lt;/P&gt;&lt;P&gt;Bests,&lt;/P&gt;&lt;P&gt;Jaime.&lt;/P&gt;</description>
    <pubDate>Thu, 28 Mar 2019 08:54:48 GMT</pubDate>
    <dc:creator>jaibau1993</dc:creator>
    <dc:date>2019-03-28T08:54:48Z</dc:date>
    <item>
      <title>Help with firstsortedvalue and fabs</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-firstsortedvalue-and-fabs/m-p/1562154#M742278</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I have a key field (made up of a code and Allocated_Date) and a TransactionDate field.&amp;nbsp;&lt;BR /&gt;What i am trying to do is for each TransactionDate find all of the Allocated_Dates which are &amp;lt;= to it and return the max.&amp;nbsp;&lt;/P&gt;&lt;P&gt;So if i have the following Allocated Dates..&lt;/P&gt;&lt;P&gt;05/03/2019 11:57:42&lt;/P&gt;&lt;P&gt;11/03/2019 10:05:23&lt;/P&gt;&lt;P&gt;14/03/2019&amp;nbsp; 07:05:31&lt;/P&gt;&lt;P&gt;14/03/2019 07:45:01&lt;/P&gt;&lt;P&gt;and i have a list of TransactionDates,&lt;/P&gt;&lt;P&gt;13/03/2019 08:30:47&lt;/P&gt;&lt;P&gt;13/03/2019 08:30:59&lt;/P&gt;&lt;P&gt;13/03/2019 08:31:55&lt;/P&gt;&lt;P&gt;13/03/2019 08:37:40&lt;/P&gt;&lt;P&gt;14/03/2019 09:47:01&lt;/P&gt;&lt;P&gt;14/03/2019 10:11:04&lt;/P&gt;&lt;P&gt;What i would want to see is...&lt;/P&gt;&lt;P&gt;for the first TransactionDate i would find all of the Allocated_Dates &amp;lt;=&amp;nbsp;13/03/2019 08:30:47 which would be..&lt;/P&gt;&lt;P&gt;05/03/2019 11:57:42&lt;/P&gt;&lt;P&gt;11/03/2019 10:05:23&lt;/P&gt;&lt;P&gt;Then i want the max of the above, so my result would be&amp;nbsp;11/03/2019 10:05:23&lt;/P&gt;&lt;P&gt;I would want the same value for all of the TransactionDates 13/03/2019 xx:xx:xx as the 11/03/2019 in the highest timestamp &amp;lt;= the 13/03/2019 xx:xx:xx.&lt;/P&gt;&lt;P&gt;for the next 2 TransactionDates..&lt;/P&gt;&lt;P&gt;14/03/2019 09:47:01&lt;/P&gt;&lt;P&gt;14/03/2019 10:11:04&lt;/P&gt;&lt;P&gt;I would want the returned value to be 14/03/2019 07:45:01 as this is the highest timestamp &amp;lt;= the above 2 TransactionDates.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried using..&lt;/P&gt;&lt;P&gt;Timestamp(firstsortedvalue(Allocated_Date,fabs(Allocated_Date-TransactionDate)))&lt;/P&gt;&lt;P&gt;This does the opposite of what i want, so for the TransactionDates of ...&lt;/P&gt;&lt;P&gt;13/03/2019 08:30:47&lt;/P&gt;&lt;P&gt;13/03/2019 08:30:59&lt;/P&gt;&lt;P&gt;13/03/2019 08:31:55&lt;/P&gt;&lt;P&gt;13/03/2019 08:37:40&lt;/P&gt;&lt;P&gt;it returns 14/03/2019 07:05:08 which is the min of the dates &amp;gt;= TransactionDate(s)&lt;/P&gt;&lt;P&gt;So i guess i need to do the opposite of the above expression.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone help please?&lt;/P&gt;&lt;P&gt;I have already tried..&lt;/P&gt;&lt;P&gt;Timestamp(firstsortedvalue(Allocated_Date,fabs(-Allocated_Date-TransactionDate)))&lt;/P&gt;&lt;P&gt;Timestamp(firstsortedvalue(Allocated_Date,-fabs(Allocated_Date-TransactionDate)))&lt;/P&gt;&lt;P&gt;Timestamp(firstsortedvalue(-Allocated_Date,fabs(Allocated_Date-TransactionDate)))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be appreciated.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-firstsortedvalue-and-fabs/m-p/1562154#M742278</guid>
      <dc:creator>hopkinsc</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Help with firstsortedvalue and fabs</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-firstsortedvalue-and-fabs/m-p/1562270#M742279</link>
      <description>&lt;P&gt;Bump.... &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Mar 2019 08:23:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-firstsortedvalue-and-fabs/m-p/1562270#M742279</guid>
      <dc:creator>hopkinsc</dc:creator>
      <dc:date>2019-03-28T08:23:12Z</dc:date>
    </item>
    <item>
      <title>Re: Help with firstsortedvalue and fabs</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-firstsortedvalue-and-fabs/m-p/1562291#M742280</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;I don't know how data is related in your problem but I would use Aggr instead FirstSortedValue. Please, find the attached file where I think I solve your issue. Hope it helps!&lt;/P&gt;&lt;P&gt;Bests,&lt;/P&gt;&lt;P&gt;Jaime.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Mar 2019 08:54:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-firstsortedvalue-and-fabs/m-p/1562291#M742280</guid>
      <dc:creator>jaibau1993</dc:creator>
      <dc:date>2019-03-28T08:54:48Z</dc:date>
    </item>
  </channel>
</rss>

