<?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: Qlik View Expression for Max Year (-1)  and Max Date in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Qlik-View-Expression-for-Max-Year-1-and-Max-Date/m-p/1259057#M857084</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Haniff,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As a workaround I have created script level solution for this problem. Created a Resident Load to pull maximum date for each Record and Year (refer below given sample script).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14869630744541612 jive_text_macro" jivemacro_uid="_14869630744541612"&gt;
&lt;P&gt;Data:&lt;/P&gt;
&lt;P&gt;LOAD * INLINE [&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Record, Date, Year&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; abc, 7/9/2015, 2015&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; abc, 6/8/2015, 2015&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; abc, 4/1/2015, 2015&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; abc, 12/3/2016, 2016&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; abc, 16/2/2016, 2016&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; abc, 6/1/2016, 2016&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; abc, 1/1/2017, 2017&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; abc, 6/2/2017, 2017&lt;/P&gt;
&lt;P&gt;];&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;NoConcatenate&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;NewData:&lt;/P&gt;
&lt;P&gt;LOAD&lt;/P&gt;
&lt;P&gt;Record AS NewRecord,&lt;/P&gt;
&lt;P&gt;Year AS NewYear,&lt;/P&gt;
&lt;P&gt;Date(Max(Date),'MM/DD/YYYY') AS NewDate&lt;/P&gt;
&lt;P&gt;Resident Data&lt;/P&gt;
&lt;P&gt;Group By Record, Year;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards!&lt;/P&gt;&lt;P&gt;Rahul&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 13 Feb 2017 05:19:35 GMT</pubDate>
    <dc:creator>rahulpawarb</dc:creator>
    <dc:date>2017-02-13T05:19:35Z</dc:date>
    <item>
      <title>Qlik View Expression for Max Year (-1)  and Max Date</title>
      <link>https://community.qlik.com/t5/QlikView/Qlik-View-Expression-for-Max-Year-1-and-Max-Date/m-p/1259054#M857081</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Currently i got multiple records in database. How can I create expression to retrieve data with specific Year and Max Date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Sample Data:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Record, Date, Year&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; abc, 7/9/2015, 2015&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; abc, 6/8/2015, 2015&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; abc, 4/1/2015, 2015&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; abc, 12/3/2016, 2016&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; abc, 16/2/2016, 2016&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; abc, 6/1/2016, 2016&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; abc, 1/1/2017, 2017&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; abc, 6/2/2017, 2017&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I only able to get the required Year but not the max date:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;My Expression:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=count({$&amp;lt;Year={'$(=max(Year)-1)'}&amp;gt;} Record)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;My Result:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="1.JPG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/152873_1.JPG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;My Expectation Result&lt;/STRONG&gt;:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="1.JPG" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/152874_1.JPG" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Qlik-View-Expression-for-Max-Year-1-and-Max-Date/m-p/1259054#M857081</guid>
      <dc:creator>mohdhaniff</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Qlik View Expression for Max Year (-1)  and Max Date</title>
      <link>https://community.qlik.com/t5/QlikView/Qlik-View-Expression-for-Max-Year-1-and-Max-Date/m-p/1259055#M857082</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please try below expression&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;=count({$&amp;lt;Year={'$(=max(Year)-1)'},&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Date&lt;/SPAN&gt;=&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;{'$(=max(Date))'}&lt;/STRONG&gt;&amp;gt;} Record)&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Feb 2017 04:41:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Qlik-View-Expression-for-Max-Year-1-and-Max-Date/m-p/1259055#M857082</guid>
      <dc:creator>khalander</dc:creator>
      <dc:date>2017-02-13T04:41:35Z</dc:date>
    </item>
    <item>
      <title>Re: Qlik View Expression for Max Year (-1)  and Max Date</title>
      <link>https://community.qlik.com/t5/QlikView/Qlik-View-Expression-for-Max-Year-1-and-Max-Date/m-p/1259056#M857083</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi dada khalander,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks but the formula not work. I got zero (0) result &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/cry.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Feb 2017 05:01:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Qlik-View-Expression-for-Max-Year-1-and-Max-Date/m-p/1259056#M857083</guid>
      <dc:creator>mohdhaniff</dc:creator>
      <dc:date>2017-02-13T05:01:47Z</dc:date>
    </item>
    <item>
      <title>Re: Qlik View Expression for Max Year (-1)  and Max Date</title>
      <link>https://community.qlik.com/t5/QlikView/Qlik-View-Expression-for-Max-Year-1-and-Max-Date/m-p/1259057#M857084</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Haniff,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As a workaround I have created script level solution for this problem. Created a Resident Load to pull maximum date for each Record and Year (refer below given sample script).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14869630744541612 jive_text_macro" jivemacro_uid="_14869630744541612"&gt;
&lt;P&gt;Data:&lt;/P&gt;
&lt;P&gt;LOAD * INLINE [&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Record, Date, Year&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; abc, 7/9/2015, 2015&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; abc, 6/8/2015, 2015&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; abc, 4/1/2015, 2015&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; abc, 12/3/2016, 2016&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; abc, 16/2/2016, 2016&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; abc, 6/1/2016, 2016&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; abc, 1/1/2017, 2017&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; abc, 6/2/2017, 2017&lt;/P&gt;
&lt;P&gt;];&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;NoConcatenate&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;NewData:&lt;/P&gt;
&lt;P&gt;LOAD&lt;/P&gt;
&lt;P&gt;Record AS NewRecord,&lt;/P&gt;
&lt;P&gt;Year AS NewYear,&lt;/P&gt;
&lt;P&gt;Date(Max(Date),'MM/DD/YYYY') AS NewDate&lt;/P&gt;
&lt;P&gt;Resident Data&lt;/P&gt;
&lt;P&gt;Group By Record, Year;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards!&lt;/P&gt;&lt;P&gt;Rahul&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Feb 2017 05:19:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Qlik-View-Expression-for-Max-Year-1-and-Max-Date/m-p/1259057#M857084</guid>
      <dc:creator>rahulpawarb</dc:creator>
      <dc:date>2017-02-13T05:19:35Z</dc:date>
    </item>
    <item>
      <title>Re: Qlik View Expression for Max Year (-1)  and Max Date</title>
      <link>https://community.qlik.com/t5/QlikView/Qlik-View-Expression-for-Max-Year-1-and-Max-Date/m-p/1259058#M857085</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rahul,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry.&amp;nbsp; I use QV Personal Edition and cannot open your attachment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;By using the script provided by you, now I got 2 tables and the data become bigger.&lt;/SPAN&gt; Can you help me to copy the expression script from your sample?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Feb 2017 06:29:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Qlik-View-Expression-for-Max-Year-1-and-Max-Date/m-p/1259058#M857085</guid>
      <dc:creator>mohdhaniff</dc:creator>
      <dc:date>2017-02-13T06:29:35Z</dc:date>
    </item>
    <item>
      <title>Re: Qlik View Expression for Max Year (-1)  and Max Date</title>
      <link>https://community.qlik.com/t5/QlikView/Qlik-View-Expression-for-Max-Year-1-and-Max-Date/m-p/1259059#M857086</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your problem is around date formats. The dates are loading as 'd/M/yyyy', but your environment setting is probably 'dd/MM/yyyy'. Try:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET DateFormat='dd/MM/YYYY';&lt;/P&gt;&lt;P&gt;=Count({&amp;lt;Date = {"$(=Date(Max({&amp;lt;Year={'$(=Max(Year)-1)'}&amp;gt;} Date), 'd/M/yyyy'))"}&amp;gt;} Record)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;SET DateFormat='d/M/YYYY';&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;=Count({&amp;lt;Date = {"$(=Date(Max({&amp;lt;Year={'$(=Max(Year)-1)'}&amp;gt;} Date)))"}&amp;gt;} Record)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Feb 2017 06:32:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Qlik-View-Expression-for-Max-Year-1-and-Max-Date/m-p/1259059#M857086</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2017-02-13T06:32:10Z</dc:date>
    </item>
    <item>
      <title>Re: Qlik View Expression for Max Year (-1)  and Max Date</title>
      <link>https://community.qlik.com/t5/QlikView/Qlik-View-Expression-for-Max-Year-1-and-Max-Date/m-p/1259060#M857087</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Jonathan for your solution.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Feb 2017 06:44:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Qlik-View-Expression-for-Max-Year-1-and-Max-Date/m-p/1259060#M857087</guid>
      <dc:creator>mohdhaniff</dc:creator>
      <dc:date>2017-02-13T06:44:17Z</dc:date>
    </item>
  </channel>
</rss>

