<?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 in Pivot Table with many dimensions in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/FirstSortedValue-in-Pivot-Table-with-many-dimensions/m-p/2145951#M93241</link>
    <description>&lt;P&gt;try this&lt;/P&gt;
&lt;P&gt;FirstSortedValue(&lt;BR /&gt;AGGR(SUM({&amp;lt;Year={'$(=Only(Year))'}&amp;gt;} [Cumulative]), [Fin YM], [Account Level 1]),&lt;BR /&gt;-[Fin YM]&lt;BR /&gt;)&lt;/P&gt;</description>
    <pubDate>Sun, 10 Dec 2023 04:47:14 GMT</pubDate>
    <dc:creator>Chanty4u</dc:creator>
    <dc:date>2023-12-10T04:47:14Z</dc:date>
    <item>
      <title>FirstSortedValue in Pivot Table with many dimensions</title>
      <link>https://community.qlik.com/t5/App-Development/FirstSortedValue-in-Pivot-Table-with-many-dimensions/m-p/2145667#M93221</link>
      <description>&lt;P&gt;Hey Everyone,&lt;BR /&gt;&lt;BR /&gt;I'm having trouble with my firstsortedvalue formula. I'm creating a balance sheet for a company, and as such I want to enhance the formula to show the balances as at the last month of a particular year, because if you currently select the year only (while using a sum) it sums up the balances for the entire year. I currently force the user to pick a financial year-month combo to see the balances:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="alwynkfinal2_0-1702026667097.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/121279i9758A26019ABBC83/image-size/medium?v=v2&amp;amp;px=400" role="button" title="alwynkfinal2_0-1702026667097.png" alt="alwynkfinal2_0-1702026667097.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;The idea is to tell the system to show the balance for the latest month when you only select a year:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="alwynkfinal2_1-1702026731097.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/121281i623DE3FD1F478B0E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="alwynkfinal2_1-1702026731097.png" alt="alwynkfinal2_1-1702026731097.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;When I show it per year, it rolls up by sum, so I want to use firstsorted value to say:&lt;BR /&gt;&lt;BR /&gt;Give me the last balance of the last Fin YM for that Year and display it instead of summing the entire year:&lt;BR /&gt;&lt;BR /&gt;I tried something along these lines. I want it to aggregate the sum by Fin YM and Account Level 1, but then sort only by Fin YM.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;=FIRSTSORTEDVALUE(
    AGGR(SUM([Cumulative]), [Fin YM], [Account Level 1]), 
    -[Fin YM]
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;BR /&gt;Any ideas on how to achieve this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Dec 2023 09:14:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/FirstSortedValue-in-Pivot-Table-with-many-dimensions/m-p/2145667#M93221</guid>
      <dc:creator>alwynkfinal2</dc:creator>
      <dc:date>2023-12-08T09:14:14Z</dc:date>
    </item>
    <item>
      <title>Re: FirstSortedValue in Pivot Table with many dimensions</title>
      <link>https://community.qlik.com/t5/App-Development/FirstSortedValue-in-Pivot-Table-with-many-dimensions/m-p/2145951#M93241</link>
      <description>&lt;P&gt;try this&lt;/P&gt;
&lt;P&gt;FirstSortedValue(&lt;BR /&gt;AGGR(SUM({&amp;lt;Year={'$(=Only(Year))'}&amp;gt;} [Cumulative]), [Fin YM], [Account Level 1]),&lt;BR /&gt;-[Fin YM]&lt;BR /&gt;)&lt;/P&gt;</description>
      <pubDate>Sun, 10 Dec 2023 04:47:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/FirstSortedValue-in-Pivot-Table-with-many-dimensions/m-p/2145951#M93241</guid>
      <dc:creator>Chanty4u</dc:creator>
      <dc:date>2023-12-10T04:47:14Z</dc:date>
    </item>
  </channel>
</rss>

