<?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: aggregate by maximum year in dataset in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/aggregate-by-maximum-year-in-dataset/m-p/40170#M786603</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;may be this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=count({&amp;lt;Year = {'$(=max(Year(DateField))'}&amp;gt;}Ids)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 17 Feb 2018 03:21:06 GMT</pubDate>
    <dc:creator>shiveshsingh</dc:creator>
    <dc:date>2018-02-17T03:21:06Z</dc:date>
    <item>
      <title>aggregate by maximum year in dataset</title>
      <link>https://community.qlik.com/t5/QlikView/aggregate-by-maximum-year-in-dataset/m-p/40168#M786601</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;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;I have been following the forum questions on using set expressions and $-sign expansions to &lt;/SPAN&gt;aggregate &lt;SPAN style="font-size: 10pt;"&gt;a field where it meets a particular condition. &lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;For example, I want to count the number of IDs for the latest/maximum year in dataset. I wrote the following script: &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;STRONG&gt;count({&amp;lt;current_year={'$(=Max(Date(Date#(Year(date#),'YYYY')), 'YYYY'))'}&amp;gt;}id)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but it returns the count of ids across all years (there are two years of data in my data set) instead of max year. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have field called&lt;STRONG&gt; year#&lt;/STRONG&gt; and&lt;STRONG&gt; date#&lt;/STRONG&gt; in my data set.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I also don't&amp;nbsp; understand that for my code to return a number, I have to create this &lt;STRONG&gt;current_year&lt;/STRONG&gt; variable. I assumed that logically the code be written so&amp;nbsp; that that&lt;STRONG&gt; year# equals&lt;/STRONG&gt; the max year value, the count of ids, like this. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;count({&amp;lt;year#={'$(=Max(Date(Date#(Year(date#),'YYYY')), 'YYYY'))'}&amp;gt;}id)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am new to the Qlik community and have gone through related posts, but still confused by my code behavior. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help is appreciated. &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/aggregate-by-maximum-year-in-dataset/m-p/40168#M786601</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: aggregate by maximum year in dataset</title>
      <link>https://community.qlik.com/t5/QlikView/aggregate-by-maximum-year-in-dataset/m-p/40169#M786602</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be you places wrong place/? May be just this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;&lt;STRONG style="font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;count({&amp;lt;year#={'$(=Max(Year([date#])))'}&amp;gt;}id)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;&lt;STRONG style="font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Feb 2018 17:57:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/aggregate-by-maximum-year-in-dataset/m-p/40169#M786602</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2018-02-16T17:57:09Z</dc:date>
    </item>
    <item>
      <title>Re: aggregate by maximum year in dataset</title>
      <link>https://community.qlik.com/t5/QlikView/aggregate-by-maximum-year-in-dataset/m-p/40170#M786603</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;may be this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=count({&amp;lt;Year = {'$(=max(Year(DateField))'}&amp;gt;}Ids)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 17 Feb 2018 03:21:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/aggregate-by-maximum-year-in-dataset/m-p/40170#M786603</guid>
      <dc:creator>shiveshsingh</dc:creator>
      <dc:date>2018-02-17T03:21:06Z</dc:date>
    </item>
  </channel>
</rss>

