<?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 FirstSortedValue using Aggr in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/FirstSortedValue-using-Aggr/m-p/1643753#M48014</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;We have following dataset...&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dataset.png" style="width: 623px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/23013i55D8FC828594A2A3/image-size/large?v=v2&amp;amp;px=999" role="button" title="dataset.png" alt="dataset.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;... and we need to show diferent measures when user select a date:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;Select Date Qty:&lt;/STRONG&gt; SOLVED with..&lt;UL&gt;&lt;LI&gt;&lt;EM&gt;Sum([Qty])&lt;/EM&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;Last Date:&lt;/STRONG&gt; SOLVED with..&lt;UL&gt;&lt;LI&gt;&lt;EM&gt;FirstSortedValue({&amp;lt;Date=&amp;gt;} Date, Aggr(Sum({&amp;lt;Date=&amp;gt;} Floor(Today())-Floor(Date)), Date, Name))&lt;/EM&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;Last Date Qty:&lt;/STRONG&gt; NOT SOLVED..&lt;/LI&gt;&lt;/UL&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;Max Qty Date:&lt;/STRONG&gt; SOLVED, but with problems cause in the example the Qty is the same in all dates and we want in this case show last date among valid dates.&lt;UL&gt;&lt;LI&gt;&lt;EM&gt;FirstSortedValue({&amp;lt;Date=&amp;gt;} Date, -Aggr(Sum({&amp;lt;Date=&amp;gt;} [Qty]), Date, Name))&lt;/EM&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;Max Qty Date Qty:&lt;/STRONG&gt; SOLVED, but with the previous problem.&lt;UL&gt;&lt;LI&gt;&lt;EM&gt;FirstSortedValue({&amp;lt;Date=&amp;gt;} Aggr(Sum({&amp;lt;Date=&amp;gt;} [Qty]), Date, Name), -Aggr(Sum({&amp;lt;Date=&amp;gt;} [Qty]), Date, Name))&lt;/EM&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;EM&gt;The result with previous measures is the following:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="datafiltered.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/23014iB62CF4856941D255/image-size/large?v=v2&amp;amp;px=999" role="button" title="datafiltered.png" alt="datafiltered.png" /&gt;&lt;/span&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;.. a&lt;/EM&gt;&lt;EM&gt;nd data should be displayed are&lt;/EM&gt;&lt;EM&gt;:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Select Date Qty:&lt;/STRONG&gt;&lt;EM&gt; 0,6&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Last Date:&lt;/STRONG&gt;&lt;EM&gt; 31/3/2019&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Last Date Qty:&lt;/STRONG&gt;&amp;nbsp;&lt;EM&gt;0,6&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Max Qty Date:&amp;nbsp;&lt;/STRONG&gt;31/3/2019&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Max Qty Date Qty:&lt;/STRONG&gt;&amp;nbsp;0,6&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone know to solve the problem with measures? Thanks in advanced!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 04:10:08 GMT</pubDate>
    <dc:creator>rubenares</dc:creator>
    <dc:date>2024-11-16T04:10:08Z</dc:date>
    <item>
      <title>FirstSortedValue using Aggr</title>
      <link>https://community.qlik.com/t5/App-Development/FirstSortedValue-using-Aggr/m-p/1643753#M48014</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;We have following dataset...&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dataset.png" style="width: 623px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/23013i55D8FC828594A2A3/image-size/large?v=v2&amp;amp;px=999" role="button" title="dataset.png" alt="dataset.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;... and we need to show diferent measures when user select a date:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;Select Date Qty:&lt;/STRONG&gt; SOLVED with..&lt;UL&gt;&lt;LI&gt;&lt;EM&gt;Sum([Qty])&lt;/EM&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;Last Date:&lt;/STRONG&gt; SOLVED with..&lt;UL&gt;&lt;LI&gt;&lt;EM&gt;FirstSortedValue({&amp;lt;Date=&amp;gt;} Date, Aggr(Sum({&amp;lt;Date=&amp;gt;} Floor(Today())-Floor(Date)), Date, Name))&lt;/EM&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;Last Date Qty:&lt;/STRONG&gt; NOT SOLVED..&lt;/LI&gt;&lt;/UL&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;Max Qty Date:&lt;/STRONG&gt; SOLVED, but with problems cause in the example the Qty is the same in all dates and we want in this case show last date among valid dates.&lt;UL&gt;&lt;LI&gt;&lt;EM&gt;FirstSortedValue({&amp;lt;Date=&amp;gt;} Date, -Aggr(Sum({&amp;lt;Date=&amp;gt;} [Qty]), Date, Name))&lt;/EM&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;Max Qty Date Qty:&lt;/STRONG&gt; SOLVED, but with the previous problem.&lt;UL&gt;&lt;LI&gt;&lt;EM&gt;FirstSortedValue({&amp;lt;Date=&amp;gt;} Aggr(Sum({&amp;lt;Date=&amp;gt;} [Qty]), Date, Name), -Aggr(Sum({&amp;lt;Date=&amp;gt;} [Qty]), Date, Name))&lt;/EM&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;EM&gt;The result with previous measures is the following:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="datafiltered.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/23014iB62CF4856941D255/image-size/large?v=v2&amp;amp;px=999" role="button" title="datafiltered.png" alt="datafiltered.png" /&gt;&lt;/span&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;.. a&lt;/EM&gt;&lt;EM&gt;nd data should be displayed are&lt;/EM&gt;&lt;EM&gt;:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Select Date Qty:&lt;/STRONG&gt;&lt;EM&gt; 0,6&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Last Date:&lt;/STRONG&gt;&lt;EM&gt; 31/3/2019&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Last Date Qty:&lt;/STRONG&gt;&amp;nbsp;&lt;EM&gt;0,6&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Max Qty Date:&amp;nbsp;&lt;/STRONG&gt;31/3/2019&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Max Qty Date Qty:&lt;/STRONG&gt;&amp;nbsp;0,6&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone know to solve the problem with measures? Thanks in advanced!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 04:10:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/FirstSortedValue-using-Aggr/m-p/1643753#M48014</guid>
      <dc:creator>rubenares</dc:creator>
      <dc:date>2024-11-16T04:10:08Z</dc:date>
    </item>
  </channel>
</rss>

