<?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: Show previous entries within same row in a straight table in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Show-previous-entries-within-same-row-in-a-straight-table/m-p/1658455#M49314</link>
    <description>&lt;P&gt;Create table as follows&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Dimension&lt;/STRONG&gt; &lt;/U&gt;: Year&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Expressions&lt;/STRONG&gt; &lt;/U&gt;:&lt;BR /&gt;1) Max(Year)&lt;BR /&gt;2) FirstSortedValue(Status, -Aggr(Max(Year), Status))&lt;BR /&gt;3) Concat({&amp;lt;Year-={"$(=Max(Year))"}&amp;gt;} Year &amp;amp; ' - '&amp;amp; Status, Chr(13))&lt;/P&gt;</description>
    <pubDate>Tue, 17 Dec 2019 12:22:29 GMT</pubDate>
    <dc:creator>Anil_Babu_Samineni</dc:creator>
    <dc:date>2019-12-17T12:22:29Z</dc:date>
    <item>
      <title>Show previous entries within same row in a straight table</title>
      <link>https://community.qlik.com/t5/App-Development/Show-previous-entries-within-same-row-in-a-straight-table/m-p/1658399#M49309</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I've got a question for which I can't seem to find the right solution. In a straight table I want to show in a specific cell the previous entries for each record. For example, Company A is in 2019 a Customer, while in 2018 the company was still a Prospect, and in 2017 they were Unknown. As such, the table should look something like follows:&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;Name&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Year&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Status&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Previous years&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Company A&lt;/TD&gt;&lt;TD&gt;2019&lt;/TD&gt;&lt;TD&gt;Customer&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;2017 Unknown&lt;/P&gt;&lt;P&gt;2018 Prospect&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Company B&lt;/TD&gt;&lt;TD&gt;2019&lt;/TD&gt;&lt;TD&gt;Removed&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;2015 Prospect&lt;/P&gt;&lt;P&gt;2016 Customer&lt;/P&gt;&lt;P&gt;2017 Customer&lt;/P&gt;&lt;P&gt;2018 Customer&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note that the current year (2019) is selected as a filter.&lt;/P&gt;&lt;P&gt;Some sample data&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;Name, Year, Status&lt;/P&gt;&lt;P&gt;Company A, 2017, Unknown,&lt;/P&gt;&lt;P&gt;Company A, 2018, Prospect,&lt;/P&gt;&lt;P&gt;Company A, 2019, Customer,&lt;/P&gt;&lt;P&gt;Company B, 2015, Prospect,&lt;/P&gt;&lt;P&gt;Company B, 2016, Customer,&lt;/P&gt;&lt;P&gt;Company B, 2017, Customer,&lt;/P&gt;&lt;P&gt;Company B, 2018, Customer,&lt;/P&gt;&lt;P&gt;Company B, 2019, Removed,&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I tried so far is creating another dimension with data previous to 2019 and using a custom variable called Mapper which was set to 2019. Second, in the Previous years dimension of the straight table using an IF-statement: if(Mapper = Year, Status). However, this doesn't work.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Another method I tried was setting the table to a static state. Then using FirstSortedValue(Status, -Year) in one measure of the table and FirstSortedValue(Status, -Mapper) as a second measure. This however returns a null is more than one previous value is found.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Much appreciated for the help&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 03:48:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Show-previous-entries-within-same-row-in-a-straight-table/m-p/1658399#M49309</guid>
      <dc:creator>klikgevoel</dc:creator>
      <dc:date>2024-11-16T03:48:34Z</dc:date>
    </item>
    <item>
      <title>Re: Show previous entries within same row in a straight table</title>
      <link>https://community.qlik.com/t5/App-Development/Show-previous-entries-within-same-row-in-a-straight-table/m-p/1658455#M49314</link>
      <description>&lt;P&gt;Create table as follows&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Dimension&lt;/STRONG&gt; &lt;/U&gt;: Year&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Expressions&lt;/STRONG&gt; &lt;/U&gt;:&lt;BR /&gt;1) Max(Year)&lt;BR /&gt;2) FirstSortedValue(Status, -Aggr(Max(Year), Status))&lt;BR /&gt;3) Concat({&amp;lt;Year-={"$(=Max(Year))"}&amp;gt;} Year &amp;amp; ' - '&amp;amp; Status, Chr(13))&lt;/P&gt;</description>
      <pubDate>Tue, 17 Dec 2019 12:22:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Show-previous-entries-within-same-row-in-a-straight-table/m-p/1658455#M49314</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2019-12-17T12:22:29Z</dc:date>
    </item>
  </channel>
</rss>

