<?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: Get Maximum And Minimum Year From Resident Table in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Get-Maximum-And-Minimum-Year-From-Resident-Table/m-p/1030330#M931500</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Small correction -&lt;/P&gt;&lt;P&gt;TRACE &amp;gt;&amp;gt;1&amp;gt;&amp;gt; &lt;STRONG&gt;&lt;SPAN style="color: #ff6600;"&gt;$(vMinYear)&lt;/SPAN&gt;;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 08 Mar 2016 15:42:54 GMT</pubDate>
    <dc:creator>Digvijay_Singh</dc:creator>
    <dc:date>2016-03-08T15:42:54Z</dc:date>
    <item>
      <title>Get Maximum And Minimum Year From Resident Table</title>
      <link>https://community.qlik.com/t5/QlikView/Get-Maximum-And-Minimum-Year-From-Resident-Table/m-p/1030328#M931498</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a QVD file of loaded date with a date and year field.&lt;/P&gt;&lt;P&gt;I want to limit my generated calendar for the date to the range of years between the minimum and maximum value in the year field.&lt;/P&gt;&lt;P&gt;I have coded:-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MinMaxDate:&lt;/P&gt;&lt;P&gt;Load min(InvoiceYear) As&amp;nbsp; vMinYear&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; max(InvoiceYear) As vMaxYear &lt;/P&gt;&lt;P&gt;resident MyLoadedQVD;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TRACE &amp;gt;&amp;gt;1&amp;gt;&amp;gt; $(vMinDate);&lt;/P&gt;&lt;P&gt;TRACE &amp;gt;&amp;gt;2&amp;gt;&amp;gt; $(vMaxYear);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The trace shows no value for vMinDate or vMaxDate.&lt;/P&gt;&lt;P&gt;I don't understand why.&lt;/P&gt;&lt;P&gt;The InvoiceYear field has values and no nulls.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do I have to declare the variables first in some way for them to receive the min() and max() values?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any advice 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/Get-Maximum-And-Minimum-Year-From-Resident-Table/m-p/1030328#M931498</guid>
      <dc:creator>rebelfox</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Get Maximum And Minimum Year From Resident Table</title>
      <link>https://community.qlik.com/t5/QlikView/Get-Maximum-And-Minimum-Year-From-Resident-Table/m-p/1030329#M931499</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try 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;STRONG&gt;MinMaxDate:&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;Load min(InvoiceYear) As&amp;nbsp; MinYear&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; max(InvoiceYear) As MaxYear&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;resident MyLoadedQVD;&lt;SPAN style="line-height: 1.5em;"&gt; &lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;LET vMinYear = Peek('MinYear');&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;LET vMaxYear = Peek('MaxYear');&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;TRACE &amp;gt;&amp;gt;1&amp;gt;&amp;gt; $(vMinDate);&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;TRACE &amp;gt;&amp;gt;2&amp;gt;&amp;gt; $(vMaxYear);&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Mar 2016 15:34:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Get-Maximum-And-Minimum-Year-From-Resident-Table/m-p/1030329#M931499</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-03-08T15:34:23Z</dc:date>
    </item>
    <item>
      <title>Re: Get Maximum And Minimum Year From Resident Table</title>
      <link>https://community.qlik.com/t5/QlikView/Get-Maximum-And-Minimum-Year-From-Resident-Table/m-p/1030330#M931500</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Small correction -&lt;/P&gt;&lt;P&gt;TRACE &amp;gt;&amp;gt;1&amp;gt;&amp;gt; &lt;STRONG&gt;&lt;SPAN style="color: #ff6600;"&gt;$(vMinYear)&lt;/SPAN&gt;;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Mar 2016 15:42:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Get-Maximum-And-Minimum-Year-From-Resident-Table/m-p/1030330#M931500</guid>
      <dc:creator>Digvijay_Singh</dc:creator>
      <dc:date>2016-03-08T15:42:54Z</dc:date>
    </item>
    <item>
      <title>Re: Get Maximum And Minimum Year From Resident Table</title>
      <link>https://community.qlik.com/t5/QlikView/Get-Maximum-And-Minimum-Year-From-Resident-Table/m-p/1030331#M931501</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt; good eye&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Mar 2016 15:44:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Get-Maximum-And-Minimum-Year-From-Resident-Table/m-p/1030331#M931501</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-03-08T15:44:18Z</dc:date>
    </item>
    <item>
      <title>Re: Get Maximum And Minimum Year From Resident Table</title>
      <link>https://community.qlik.com/t5/QlikView/Get-Maximum-And-Minimum-Year-From-Resident-Table/m-p/1030332#M931502</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes that sorted it.&amp;nbsp; Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Mar 2016 16:06:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Get-Maximum-And-Minimum-Year-From-Resident-Table/m-p/1030332#M931502</guid>
      <dc:creator>rebelfox</dc:creator>
      <dc:date>2016-03-08T16:06:30Z</dc:date>
    </item>
    <item>
      <title>Re: Get Maximum And Minimum Year From Resident Table</title>
      <link>https://community.qlik.com/t5/QlikView/Get-Maximum-And-Minimum-Year-From-Resident-Table/m-p/1030333#M931503</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Roy, it seems there was initially a little confusion about how to use variables vs. table fields.&lt;/P&gt;&lt;P&gt;Has this been sorted as well?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to get min / max values to create a calendar, you can even get rid of the variables completely (following taken from Rob's &lt;A href="http://qlikviewcookbook.com/2015/05/better-calendar-scripts/" title="http://qlikviewcookbook.com/2015/05/better-calendar-scripts/"&gt;Better Calendar Scripts | Qlikview Cookbook&lt;/A&gt; , always a good read, and modified slightly for year extrema), have a look at lines 19ff:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14574573193804059 jive_text_macro" jivemacro_uid="_14574573193804059"&gt;
&lt;P&gt;MasterCalendar:&lt;/P&gt;
&lt;P&gt;Load&lt;/P&gt;
&lt;P&gt;TempDate AS InvoiceDate,&lt;/P&gt;
&lt;P&gt;week(TempDate) As Week,&lt;/P&gt;
&lt;P&gt;Year(TempDate) As Year,&lt;/P&gt;
&lt;P&gt;Month(TempDate) As Month,&lt;/P&gt;
&lt;P&gt;Day(TempDate) As Day,&lt;/P&gt;
&lt;P&gt;'Q' &amp;amp; ceil(month(TempDate) / 3) AS Quarter,&lt;/P&gt;
&lt;P&gt;Week(weekstart(TempDate)) &amp;amp; '-' &amp;amp; WeekYear(TempDate) as WeekYear,&lt;/P&gt;
&lt;P&gt;WeekDay(TempDate) as WeekDay&lt;/P&gt;
&lt;P&gt;;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;//=== Generate a temp table of dates ===&lt;/P&gt;
&lt;P&gt;LOAD&lt;/P&gt;
&lt;P&gt;date(&lt;SPAN style="font-size: 13.3333px;"&gt;Makedate(minyear) + IterNo()-1&lt;/SPAN&gt;) AS TempDate&lt;/P&gt;
&lt;P&gt;WHILE Makedate(minyear) + IterNo()-1 &amp;lt; Makedate(maxyear+1);&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;//=== Get min/max year from Field ===/&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;LOAD&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;min(FieldValue('InvoiceYear', recno())) as minyear,&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;max(FieldValue('InvoiceYear', recno())) as maxyear&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;AUTOGENERATE FieldValueCount('InvoiceYear');&lt;/STRONG&gt;&lt;/P&gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Mar 2016 17:16:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Get-Maximum-And-Minimum-Year-From-Resident-Table/m-p/1030333#M931503</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-03-08T17:16:00Z</dc:date>
    </item>
    <item>
      <title>Re: Get Maximum And Minimum Year From Resident Table</title>
      <link>https://community.qlik.com/t5/QlikView/Get-Maximum-And-Minimum-Year-From-Resident-Table/m-p/1030334#M931504</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you really need to generate the max and minimum date?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Often the start date is known and can be hard-coded, and the end date can be calculated based on todays date. &lt;BR /&gt;It may be today(), yearend(today()) or possibly today + 12 or 24 months.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using a simple expression like this can be significantly faster than calculating the min and max date every time you build the calendar, especially when dealing with large data sets.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Mar 2016 17:23:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Get-Maximum-And-Minimum-Year-From-Resident-Table/m-p/1030334#M931504</guid>
      <dc:creator>Colin-Albert</dc:creator>
      <dc:date>2016-03-08T17:23:01Z</dc:date>
    </item>
  </channel>
</rss>

