<?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 of previous year in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/FirstSortedValue-of-previous-year/m-p/2481851#M100874</link>
    <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/313181"&gt;@Yi_DE&lt;/a&gt;&amp;nbsp; I don't think you need firstsorted value. You can use below set&lt;/P&gt;
&lt;P&gt;=sum({&amp;lt;&lt;SPAN&gt;key_date={"$(=date(addyears(min(key_date),-1)))"}&lt;/SPAN&gt;&amp;gt;} measure)&lt;/P&gt;</description>
    <pubDate>Mon, 16 Sep 2024 15:54:19 GMT</pubDate>
    <dc:creator>Kushal_Chawda</dc:creator>
    <dc:date>2024-09-16T15:54:19Z</dc:date>
    <item>
      <title>FirstSortedValue of previous year</title>
      <link>https://community.qlik.com/t5/App-Development/FirstSortedValue-of-previous-year/m-p/2481773#M100866</link>
      <description>&lt;P&gt;Hi Guys, i get 55 for firm A using&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&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(measure, key_date)&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;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;while i select January 2024 and Firm A in my app.&lt;/P&gt;
&lt;P&gt;I also want to get the 2023 value as comparison using&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&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(measure, AddYears(key_date, -1)&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;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;. This however didn't work. Then i tried set analysis to preselect the data to analyse like&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&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({&amp;lt;key_date= {"&amp;gt;=$(=Date(AddYears(Min(key_date), -1))) &amp;lt;=$(=Date(AddYears(Max(key_date), -1)))"} measure, key_date)&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;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;that didn't work as well.&lt;/P&gt;
&lt;P&gt;Following an simplified example of the data. Can someone help?&lt;/P&gt;
&lt;TABLE style="border-collapse: collapse; width: 180pt;" border="0" width="240" cellspacing="0" cellpadding="0"&gt;&lt;COLGROUP&gt;&lt;COL style="width: 60pt;" span="3" width="80" /&gt; &lt;/COLGROUP&gt;
&lt;TBODY&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD width="80" height="20" style="height: 15.0pt; width: 60pt;"&gt;key_date&lt;/TD&gt;
&lt;TD width="80" style="width: 60pt;"&gt;firm&lt;/TD&gt;
&lt;TD width="80" style="width: 60pt;"&gt;measure&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" class="xl63" style="height: 15.0pt;"&gt;&lt;STRONG&gt;01.01.2023&lt;/STRONG&gt;&lt;/TD&gt;
&lt;TD&gt;&lt;STRONG&gt;A&lt;/STRONG&gt;&lt;/TD&gt;
&lt;TD align="right"&gt;&lt;STRONG&gt;100&lt;/STRONG&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" class="xl63" style="height: 15.0pt;"&gt;01.01.2023&lt;/TD&gt;
&lt;TD&gt;B&lt;/TD&gt;
&lt;TD align="right"&gt;5&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" class="xl63" style="height: 15.0pt;"&gt;01.01.2023&lt;/TD&gt;
&lt;TD&gt;C&lt;/TD&gt;
&lt;TD align="right"&gt;200&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" class="xl63" style="height: 15.0pt;"&gt;02.01.2023&lt;/TD&gt;
&lt;TD&gt;A&lt;/TD&gt;
&lt;TD align="right"&gt;10&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" class="xl63" style="height: 15.0pt;"&gt;02.01.2023&lt;/TD&gt;
&lt;TD&gt;B&lt;/TD&gt;
&lt;TD align="right"&gt;20&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" class="xl63" style="height: 15.0pt;"&gt;02.01.2023&lt;/TD&gt;
&lt;TD&gt;C&lt;/TD&gt;
&lt;TD align="right"&gt;3&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" style="height: 15.0pt;"&gt;…&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" class="xl63" style="height: 15.0pt;"&gt;31.01.2023&lt;/TD&gt;
&lt;TD&gt;A&lt;/TD&gt;
&lt;TD align="right"&gt;33&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" style="height: 15.0pt;"&gt;…&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" class="xl63" style="height: 15.0pt;"&gt;&lt;STRONG&gt;01.01.2024&lt;/STRONG&gt;&lt;/TD&gt;
&lt;TD&gt;&lt;STRONG&gt;A&lt;/STRONG&gt;&lt;/TD&gt;
&lt;TD align="right"&gt;&lt;STRONG&gt;55&lt;/STRONG&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" class="xl63" style="height: 15.0pt;"&gt;01.01.2024&lt;/TD&gt;
&lt;TD&gt;B&lt;/TD&gt;
&lt;TD align="right"&gt;2&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" class="xl63" style="height: 15.0pt;"&gt;01.01.2024&lt;/TD&gt;
&lt;TD&gt;C&lt;/TD&gt;
&lt;TD align="right"&gt;43&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" class="xl63" style="height: 15.0pt;"&gt;02.01.2024&lt;/TD&gt;
&lt;TD&gt;A&lt;/TD&gt;
&lt;TD align="right"&gt;67&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" class="xl63" style="height: 15.0pt;"&gt;02.01.2024&lt;/TD&gt;
&lt;TD&gt;B&lt;/TD&gt;
&lt;TD align="right"&gt;3&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" class="xl63" style="height: 15.0pt;"&gt;02.01.2024&lt;/TD&gt;
&lt;TD&gt;C&lt;/TD&gt;
&lt;TD align="right"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" style="height: 15.0pt;"&gt;…&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" class="xl63" style="height: 15.0pt;"&gt;31.01.2024&lt;/TD&gt;
&lt;TD&gt;A&lt;/TD&gt;
&lt;TD align="right"&gt;5&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;</description>
      <pubDate>Mon, 16 Sep 2024 14:54:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/FirstSortedValue-of-previous-year/m-p/2481773#M100866</guid>
      <dc:creator>Yi_DE</dc:creator>
      <dc:date>2024-09-16T14:54:35Z</dc:date>
    </item>
    <item>
      <title>Re: FirstSortedValue of previous year</title>
      <link>https://community.qlik.com/t5/App-Development/FirstSortedValue-of-previous-year/m-p/2481809#M100870</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/313181"&gt;@Yi_DE&lt;/a&gt;&amp;nbsp; what is expected output?&lt;/P&gt;</description>
      <pubDate>Mon, 16 Sep 2024 13:37:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/FirstSortedValue-of-previous-year/m-p/2481809#M100870</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2024-09-16T13:37:15Z</dc:date>
    </item>
    <item>
      <title>Re: FirstSortedValue of previous year</title>
      <link>https://community.qlik.com/t5/App-Development/FirstSortedValue-of-previous-year/m-p/2481830#M100872</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/336"&gt;@Kushal_Chawda&lt;/a&gt;&amp;nbsp;, the expected output is 100, the top line in the table.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Sep 2024 14:53:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/FirstSortedValue-of-previous-year/m-p/2481830#M100872</guid>
      <dc:creator>Yi_DE</dc:creator>
      <dc:date>2024-09-16T14:53:39Z</dc:date>
    </item>
    <item>
      <title>Re: FirstSortedValue of previous year</title>
      <link>https://community.qlik.com/t5/App-Development/FirstSortedValue-of-previous-year/m-p/2481851#M100874</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/313181"&gt;@Yi_DE&lt;/a&gt;&amp;nbsp; I don't think you need firstsorted value. You can use below set&lt;/P&gt;
&lt;P&gt;=sum({&amp;lt;&lt;SPAN&gt;key_date={"$(=date(addyears(min(key_date),-1)))"}&lt;/SPAN&gt;&amp;gt;} measure)&lt;/P&gt;</description>
      <pubDate>Mon, 16 Sep 2024 15:54:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/FirstSortedValue-of-previous-year/m-p/2481851#M100874</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2024-09-16T15:54:19Z</dc:date>
    </item>
    <item>
      <title>Re: FirstSortedValue of previous year</title>
      <link>https://community.qlik.com/t5/App-Development/FirstSortedValue-of-previous-year/m-p/2481975#M100884</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/336"&gt;@Kushal_Chawda&lt;/a&gt;&amp;nbsp;This approach returns 0 as result, even though the key_date has the correct value of 01.01.2023&lt;/P&gt;</description>
      <pubDate>Tue, 17 Sep 2024 07:44:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/FirstSortedValue-of-previous-year/m-p/2481975#M100884</guid>
      <dc:creator>Yi_DE</dc:creator>
      <dc:date>2024-09-17T07:44:14Z</dc:date>
    </item>
    <item>
      <title>Re: FirstSortedValue of previous year</title>
      <link>https://community.qlik.com/t5/App-Development/FirstSortedValue-of-previous-year/m-p/2482009#M100888</link>
      <description>&lt;P&gt;I finally get it to work with this&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;{&amp;lt;[key_date.autoCalendar.Year]={"$(=Min(Year(key_date)) - 1)"}&amp;gt;} firstsortedvalue(measure, key_date)
&lt;/LI-CODE&gt;
&lt;P&gt;, but i don't really understand why ...&lt;/P&gt;</description>
      <pubDate>Tue, 17 Sep 2024 08:55:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/FirstSortedValue-of-previous-year/m-p/2482009#M100888</guid>
      <dc:creator>Yi_DE</dc:creator>
      <dc:date>2024-09-17T08:55:04Z</dc:date>
    </item>
  </channel>
</rss>

