<?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 Sum - Group by - Order by in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Sum-Group-by-Order-by/m-p/2014856#M83854</link>
    <description>&lt;P&gt;Hello everyone!&lt;/P&gt;
&lt;P&gt;I have an issue with my App. I want to wirte an expression which sums a value grouped by a field and then order it by a date field.&lt;/P&gt;
&lt;P&gt;My sum expression is:&amp;nbsp;&lt;STRONG&gt;Aggr(sum({&amp;lt;causale={0003}&amp;gt;}importo), datar)&amp;nbsp;&lt;/STRONG&gt;which is working.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Immagine.png" style="width: 538px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/95844iFA2630CA7FBD8E39/image-size/large?v=v2&amp;amp;px=999" role="button" title="Immagine.png" alt="Immagine.png" /&gt;&lt;/span&gt; &lt;/P&gt;
&lt;P&gt;Then I want to order these values by the date field &lt;STRONG&gt;datar&lt;/STRONG&gt;&amp;nbsp; (&lt;EM&gt;Data reg&amp;nbsp;&lt;/EM&gt;in the image) to display this value in a KPI box&amp;nbsp;but I don't know how to do it. I've used this expression:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;FirstSortedValue(&amp;nbsp;Aggr(sum({&amp;lt;causale={0003}&amp;gt;}importo), datar), - datar)&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;but it's not working.&lt;/P&gt;
&lt;P&gt;Could anyone suggest me the correct way to achieve that?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks a lot!&lt;/P&gt;</description>
    <pubDate>Fri, 09 Dec 2022 15:14:03 GMT</pubDate>
    <dc:creator>danimarc12</dc:creator>
    <dc:date>2022-12-09T15:14:03Z</dc:date>
    <item>
      <title>Sum - Group by - Order by</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-Group-by-Order-by/m-p/2014856#M83854</link>
      <description>&lt;P&gt;Hello everyone!&lt;/P&gt;
&lt;P&gt;I have an issue with my App. I want to wirte an expression which sums a value grouped by a field and then order it by a date field.&lt;/P&gt;
&lt;P&gt;My sum expression is:&amp;nbsp;&lt;STRONG&gt;Aggr(sum({&amp;lt;causale={0003}&amp;gt;}importo), datar)&amp;nbsp;&lt;/STRONG&gt;which is working.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Immagine.png" style="width: 538px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/95844iFA2630CA7FBD8E39/image-size/large?v=v2&amp;amp;px=999" role="button" title="Immagine.png" alt="Immagine.png" /&gt;&lt;/span&gt; &lt;/P&gt;
&lt;P&gt;Then I want to order these values by the date field &lt;STRONG&gt;datar&lt;/STRONG&gt;&amp;nbsp; (&lt;EM&gt;Data reg&amp;nbsp;&lt;/EM&gt;in the image) to display this value in a KPI box&amp;nbsp;but I don't know how to do it. I've used this expression:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;FirstSortedValue(&amp;nbsp;Aggr(sum({&amp;lt;causale={0003}&amp;gt;}importo), datar), - datar)&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;but it's not working.&lt;/P&gt;
&lt;P&gt;Could anyone suggest me the correct way to achieve that?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks a lot!&lt;/P&gt;</description>
      <pubDate>Fri, 09 Dec 2022 15:14:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-Group-by-Order-by/m-p/2014856#M83854</guid>
      <dc:creator>danimarc12</dc:creator>
      <dc:date>2022-12-09T15:14:03Z</dc:date>
    </item>
    <item>
      <title>Re: Sum - Group by - Order by</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-Group-by-Order-by/m-p/2015117#M83861</link>
      <description>&lt;P&gt;if datar is a dual (a date field), and you are using it as a dimension in your table, then sorting by this field first should be enough, you dont even need to sort by expression.&amp;nbsp; it is curious though that you have two entries for 5/12/2022 which tells me either you arent using dater field as dimension (maybe its a calculation) or it may be some sort of time field - that 5/12/2022 has two numeric values.&lt;/P&gt;
&lt;P&gt;you may need to add more info so others can understand whats going on&lt;/P&gt;</description>
      <pubDate>Sat, 10 Dec 2022 21:07:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-Group-by-Order-by/m-p/2015117#M83861</guid>
      <dc:creator>edwin</dc:creator>
      <dc:date>2022-12-10T21:07:39Z</dc:date>
    </item>
  </channel>
</rss>

