<?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 with two criteria in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/FirstSortedValue-with-two-criteria/m-p/1735222#M591926</link>
    <description>&lt;P&gt;Finally, I resolved my issue. Below the script:&lt;/P&gt;&lt;P&gt;NoConcatenate&lt;BR /&gt;[RESULT_TEMP]:&lt;BR /&gt;Load Distinct&lt;BR /&gt;InvoiceNumber,&lt;BR /&gt;FirstSortedValue(DISTINCT NetAmountConverted, -EntryDate and -EntryTime) + SUM(ChargesFees) AS TempVlaue&lt;BR /&gt;Resident INV_TEMP&lt;BR /&gt;Group By InvoiceNumber;&lt;/P&gt;</description>
    <pubDate>Wed, 12 Aug 2020 12:15:19 GMT</pubDate>
    <dc:creator>Black_Hole</dc:creator>
    <dc:date>2020-08-12T12:15:19Z</dc:date>
    <item>
      <title>FirstSortedValue with two criteria</title>
      <link>https://community.qlik.com/t5/QlikView/FirstSortedValue-with-two-criteria/m-p/1735201#M591925</link>
      <description>&lt;P&gt;Hello all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to use the function FirstSortedValued by considering two criteria inside.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I try to affect the "ChargesFees" value to the "NetAmountConverted" for only the row which has the oldest date and time.&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;RowNo | InvoiceNumber&amp;nbsp; |&amp;nbsp; NetAmountConverted&amp;nbsp; |&amp;nbsp; ChargesFees&amp;nbsp; |&amp;nbsp; EntryDate&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;|&amp;nbsp; EntryTime&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;1&lt;STRONG&gt; | &lt;/STRONG&gt;INV01&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;STRONG&gt;|&amp;nbsp;&lt;/STRONG&gt;&amp;nbsp; &amp;nbsp;1000&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;STRONG&gt;|&amp;nbsp; &amp;nbsp;&lt;/STRONG&gt;60&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;STRONG&gt;|&amp;nbsp; &lt;/STRONG&gt;20200123 &lt;STRONG&gt;|&lt;/STRONG&gt;&amp;nbsp; 1501&lt;/P&gt;&lt;P&gt;2&lt;STRONG&gt; |&lt;/STRONG&gt;INV01&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;STRONG&gt;|&amp;nbsp;&lt;/STRONG&gt;&amp;nbsp; &amp;nbsp;2000&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;STRONG&gt;|&amp;nbsp; &amp;nbsp;&lt;/STRONG&gt;60&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;STRONG&gt;|&amp;nbsp; &lt;/STRONG&gt;20200123 &lt;STRONG&gt;|&lt;/STRONG&gt;&amp;nbsp; 1502&lt;/P&gt;&lt;P&gt;3&lt;STRONG&gt; |&lt;/STRONG&gt;INV02&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;STRONG&gt;|&amp;nbsp;&lt;/STRONG&gt;&amp;nbsp; &amp;nbsp;5000&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;STRONG&gt;|&amp;nbsp; &amp;nbsp;&lt;/STRONG&gt;12&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;STRONG&gt;|&amp;nbsp; &lt;/STRONG&gt;20191208&amp;nbsp;&lt;STRONG&gt;|&lt;/STRONG&gt;&amp;nbsp; 1620&lt;/P&gt;&lt;P&gt;4&lt;STRONG&gt; |&lt;/STRONG&gt;INV02&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;STRONG&gt;|&amp;nbsp;&lt;/STRONG&gt;&amp;nbsp; &amp;nbsp;100&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;STRONG&gt;|&amp;nbsp; &amp;nbsp;&lt;/STRONG&gt;12&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;STRONG&gt;|&amp;nbsp; &lt;/STRONG&gt;20200706&amp;nbsp;&lt;STRONG&gt;|&lt;/STRONG&gt;&amp;nbsp; 0935&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;gt; The result expected:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;RowNo | InvoiceNumber&amp;nbsp; |&amp;nbsp; TempValue&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;1&lt;STRONG&gt; |&lt;/STRONG&gt;INV01&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;STRONG&gt;|&amp;nbsp;&lt;/STRONG&gt;&amp;nbsp; &amp;nbsp;1060&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;2&lt;STRONG&gt; |&lt;/STRONG&gt;INV01&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;STRONG&gt;|&amp;nbsp;&lt;/STRONG&gt;&amp;nbsp; &amp;nbsp;2000&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;3&lt;STRONG&gt; |&lt;/STRONG&gt;INV02&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;STRONG&gt;|&amp;nbsp;&lt;/STRONG&gt;&amp;nbsp; &amp;nbsp;5012&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;4&lt;STRONG&gt; |&lt;/STRONG&gt;INV02&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;STRONG&gt;|&amp;nbsp;&lt;/STRONG&gt;&amp;nbsp; &amp;nbsp;100&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;gt; My current script:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;NoConcatenate&lt;/EM&gt;&lt;BR /&gt;[RESULT_TEMP]:&lt;BR /&gt;&lt;STRONG&gt;Load Distinct&lt;/STRONG&gt;&lt;BR /&gt;InvoiceNumber,&lt;BR /&gt;FirstSortedValue(SUM(NetAmountConverted)+SUM(ChargesFees), -EntryDate and -EntryTime) AS TempVlaue&lt;BR /&gt;&lt;STRONG&gt;Resident&lt;/STRONG&gt; INV_TEMP&lt;BR /&gt;&lt;STRONG&gt;Group By&lt;/STRONG&gt; InvoiceNumber;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Please could you highlight me what is not correct in my current script.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance for your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 00:09:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/FirstSortedValue-with-two-criteria/m-p/1735201#M591925</guid>
      <dc:creator>Black_Hole</dc:creator>
      <dc:date>2024-11-16T00:09:29Z</dc:date>
    </item>
    <item>
      <title>Re: FirstSortedValue with two criteria</title>
      <link>https://community.qlik.com/t5/QlikView/FirstSortedValue-with-two-criteria/m-p/1735222#M591926</link>
      <description>&lt;P&gt;Finally, I resolved my issue. Below the script:&lt;/P&gt;&lt;P&gt;NoConcatenate&lt;BR /&gt;[RESULT_TEMP]:&lt;BR /&gt;Load Distinct&lt;BR /&gt;InvoiceNumber,&lt;BR /&gt;FirstSortedValue(DISTINCT NetAmountConverted, -EntryDate and -EntryTime) + SUM(ChargesFees) AS TempVlaue&lt;BR /&gt;Resident INV_TEMP&lt;BR /&gt;Group By InvoiceNumber;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Aug 2020 12:15:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/FirstSortedValue-with-two-criteria/m-p/1735222#M591926</guid>
      <dc:creator>Black_Hole</dc:creator>
      <dc:date>2020-08-12T12:15:19Z</dc:date>
    </item>
  </channel>
</rss>

