<?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 Display most recent value based on date selection (island calendar and variable) in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Display-most-recent-value-based-on-date-selection-island/m-p/1609154#M735715</link>
    <description>&lt;P&gt;Hi people, I hope you can help me with this!&lt;/P&gt;&lt;P&gt;Let's say I have this dataset. In this example, its records share all the same ID because there's a need to keep track of modifications. What I need is to display the latest value on "AMOUNT" based on "VALIDITY_START" for a specific date range. For example, if I go to see the data as of today, it should display "70668" for "AMOUNT". If I go to 2018-01 it should display "94436". If I go to 28-08-2018 it should display "78686", and if I go to 31-08-2018, it should display "55005".&lt;/P&gt;&lt;P&gt;I need to display the latest value AND every other value for the user to keep track of modifications. So imagine this very same table but with a totals over it displaying the result of a sum expression, but this total only shows the most recent value.&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;ID&lt;/TD&gt;&lt;TD&gt;VALIDITY_START_NUM&lt;/TD&gt;&lt;TD&gt;VALIDITY_END_NUM&lt;/TD&gt;&lt;TD&gt;AMOUNT&lt;/TD&gt;&lt;TD&gt;AMOUNT2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3015080&lt;/TD&gt;&lt;TD&gt;20171109&lt;/TD&gt;&lt;TD&gt;20180830&lt;/TD&gt;&lt;TD&gt;94436&lt;/TD&gt;&lt;TD&gt;438&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3015080&lt;/TD&gt;&lt;TD&gt;20180827&lt;/TD&gt;&lt;TD&gt;20180830&lt;/TD&gt;&lt;TD&gt;78686&lt;/TD&gt;&lt;TD&gt;438&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3015080&lt;/TD&gt;&lt;TD&gt;20180830&lt;/TD&gt;&lt;TD&gt;20190831&lt;/TD&gt;&lt;TD&gt;55005&lt;/TD&gt;&lt;TD&gt;568&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3015080&lt;/TD&gt;&lt;TD&gt;20190702&lt;/TD&gt;&lt;TD&gt;20190831&lt;/TD&gt;&lt;TD&gt;70668&lt;/TD&gt;&lt;TD&gt;568&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3015080&lt;/TD&gt;&lt;TD&gt;20190831&lt;/TD&gt;&lt;TD&gt;20200731&lt;/TD&gt;&lt;TD&gt;85202&lt;/TD&gt;&lt;TD&gt;454&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Something I must also explain is that this data model and its calculations are based on a single variable called: vDateNumMax. And what does it do? It gets the max date (num format) from an island calendar table. This date is always today's date, but if I pick ie 2018 as year in the date picker, this variable becomes "20181231" and so on for months and days.&lt;/P&gt;&lt;P&gt;I've been trying some expressions with aggr, max and even FirstSortedValue, but I just can't find one to work as I need to...&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas? Thanks beforehand and sorry for the long post, but I wanted to be clear... I'm working on QlikView.&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 20:19:33 GMT</pubDate>
    <dc:creator>José_Espinoza</dc:creator>
    <dc:date>2024-11-16T20:19:33Z</dc:date>
    <item>
      <title>Display most recent value based on date selection (island calendar and variable)</title>
      <link>https://community.qlik.com/t5/QlikView/Display-most-recent-value-based-on-date-selection-island/m-p/1609154#M735715</link>
      <description>&lt;P&gt;Hi people, I hope you can help me with this!&lt;/P&gt;&lt;P&gt;Let's say I have this dataset. In this example, its records share all the same ID because there's a need to keep track of modifications. What I need is to display the latest value on "AMOUNT" based on "VALIDITY_START" for a specific date range. For example, if I go to see the data as of today, it should display "70668" for "AMOUNT". If I go to 2018-01 it should display "94436". If I go to 28-08-2018 it should display "78686", and if I go to 31-08-2018, it should display "55005".&lt;/P&gt;&lt;P&gt;I need to display the latest value AND every other value for the user to keep track of modifications. So imagine this very same table but with a totals over it displaying the result of a sum expression, but this total only shows the most recent value.&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;ID&lt;/TD&gt;&lt;TD&gt;VALIDITY_START_NUM&lt;/TD&gt;&lt;TD&gt;VALIDITY_END_NUM&lt;/TD&gt;&lt;TD&gt;AMOUNT&lt;/TD&gt;&lt;TD&gt;AMOUNT2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3015080&lt;/TD&gt;&lt;TD&gt;20171109&lt;/TD&gt;&lt;TD&gt;20180830&lt;/TD&gt;&lt;TD&gt;94436&lt;/TD&gt;&lt;TD&gt;438&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3015080&lt;/TD&gt;&lt;TD&gt;20180827&lt;/TD&gt;&lt;TD&gt;20180830&lt;/TD&gt;&lt;TD&gt;78686&lt;/TD&gt;&lt;TD&gt;438&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3015080&lt;/TD&gt;&lt;TD&gt;20180830&lt;/TD&gt;&lt;TD&gt;20190831&lt;/TD&gt;&lt;TD&gt;55005&lt;/TD&gt;&lt;TD&gt;568&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3015080&lt;/TD&gt;&lt;TD&gt;20190702&lt;/TD&gt;&lt;TD&gt;20190831&lt;/TD&gt;&lt;TD&gt;70668&lt;/TD&gt;&lt;TD&gt;568&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3015080&lt;/TD&gt;&lt;TD&gt;20190831&lt;/TD&gt;&lt;TD&gt;20200731&lt;/TD&gt;&lt;TD&gt;85202&lt;/TD&gt;&lt;TD&gt;454&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Something I must also explain is that this data model and its calculations are based on a single variable called: vDateNumMax. And what does it do? It gets the max date (num format) from an island calendar table. This date is always today's date, but if I pick ie 2018 as year in the date picker, this variable becomes "20181231" and so on for months and days.&lt;/P&gt;&lt;P&gt;I've been trying some expressions with aggr, max and even FirstSortedValue, but I just can't find one to work as I need to...&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas? Thanks beforehand and sorry for the long post, but I wanted to be clear... I'm working on QlikView.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 20:19:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Display-most-recent-value-based-on-date-selection-island/m-p/1609154#M735715</guid>
      <dc:creator>José_Espinoza</dc:creator>
      <dc:date>2024-11-16T20:19:33Z</dc:date>
    </item>
    <item>
      <title>Re: Display most recent value based on date selection (island calendar and variable)</title>
      <link>https://community.qlik.com/t5/QlikView/Display-most-recent-value-based-on-date-selection-island/m-p/1609419#M735717</link>
      <description>&lt;P&gt;I got one to work, but at the same it doesn't...&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;min(total aggr(sum( {&amp;lt; VALIDITY_START_NUM={"&amp;lt;$(vDateNumMax)"}&amp;gt;} AMOUNT),VALIDITY_START_NUM))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;When I pick an ID it works nicely, but with no selections everything goes to 0.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Aug 2019 13:58:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Display-most-recent-value-based-on-date-selection-island/m-p/1609419#M735717</guid>
      <dc:creator>José_Espinoza</dc:creator>
      <dc:date>2019-08-05T13:58:52Z</dc:date>
    </item>
    <item>
      <title>Re: Display most recent value based on date selection (island calendar and variable)</title>
      <link>https://community.qlik.com/t5/QlikView/Display-most-recent-value-based-on-date-selection-island/m-p/1611220#M735718</link>
      <description>&lt;P&gt;I solved it by the way, the solution was:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;(sum(aggr(if(max( {&amp;lt;VALIDITY_START_NUM={"&amp;lt;$(vDateNumMax)"}&amp;gt;} total &amp;lt;ID&amp;gt; VALIDITY_START_NUM)=VALIDITY_START_NUM, AMOUNT),ID,VALIDITY_START_NUM)))&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Aug 2019 16:24:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Display-most-recent-value-based-on-date-selection-island/m-p/1611220#M735718</guid>
      <dc:creator>José_Espinoza</dc:creator>
      <dc:date>2019-08-09T16:24:25Z</dc:date>
    </item>
  </channel>
</rss>

