<?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 How do you set a Min and Max date based off different fields within the same table? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-do-you-set-a-Min-and-Max-date-based-off-different-fields/m-p/230508#M82328</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;See an excellent way of doing that here:&lt;/P&gt;&lt;P&gt;&lt;A href="http://qlikviewmaven.blogspot.com/2009/06/quick-load-of-max-field-value.html"&gt;http://qlikviewmaven.blogspot.com/2009/06/quick-load-of-max-field-value.html&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 03 Feb 2010 14:48:02 GMT</pubDate>
    <dc:creator>disqr_rm</dc:creator>
    <dc:date>2010-02-03T14:48:02Z</dc:date>
    <item>
      <title>How do you set a Min and Max date based off different fields within the same table?</title>
      <link>https://community.qlik.com/t5/QlikView/How-do-you-set-a-Min-and-Max-date-based-off-different-fields/m-p/230507#M82327</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Could anyone offer some advice on the following.....&lt;/P&gt;&lt;P&gt;I am currently using the following symtax to try and set the min and max dates within my document:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE ___default_attr="plain" class="jive_text_macro jive_macro_code" jivemacro="code"&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;B&gt;LET&lt;/B&gt; varMinDate = Num (Peek('EstProjStart', 0,'Projects')); &lt;STRONG&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;LET&lt;/STRONG&gt; var&lt;BR /&gt;&lt;BR /&gt; varvarMaxDate = Num (Peek('EstProjFin', -1,'Projects'));&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;I appreciate that I need to order the Projects table, however, because I need to take the minimum value from one field and and the maximum value from another field I am not quite sure how to best tackle this. I am also bringing this data in from excel not access like in a lot of the course material. The Projects table symtax can be seen below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Projects:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE ___default_attr="plain" class="jive_text_macro jive_macro_code" jivemacro="code"&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;STRONG&gt;LOAD&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;RegionID,&lt;BR /&gt;&lt;BR /&gt; &lt;STRONG&gt;//EstProjStart,&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Phase&lt;/STRONG&gt;&lt;STRONG&gt;ProjManager&lt;/STRONG&gt; As ProjectManager,&lt;BR /&gt;&lt;STRONG&gt;FROM&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;[Data files\Natural Resources data.xlsx]&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;BR /&gt; &lt;STRONG&gt;ooxml&lt;/STRONG&gt;, embedded labels, table is Projects); &lt;STRONG&gt;//ActProjFin,&lt;/STRONG&gt; &lt;STRONG&gt;//EstProjFin,&lt;/STRONG&gt; &lt;STRONG&gt;//ActProjStart,&lt;/STRONG&gt; ProjectName,&lt;BR /&gt;ProjectDescription&lt;BR /&gt; ,&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Any guidance would be most appreciated.&lt;/P&gt;&lt;P&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;Carl&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Feb 2010 14:38:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-do-you-set-a-Min-and-Max-date-based-off-different-fields/m-p/230507#M82327</guid>
      <dc:creator />
      <dc:date>2010-02-03T14:38:08Z</dc:date>
    </item>
    <item>
      <title>How do you set a Min and Max date based off different fields within the same table?</title>
      <link>https://community.qlik.com/t5/QlikView/How-do-you-set-a-Min-and-Max-date-based-off-different-fields/m-p/230508#M82328</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;See an excellent way of doing that here:&lt;/P&gt;&lt;P&gt;&lt;A href="http://qlikviewmaven.blogspot.com/2009/06/quick-load-of-max-field-value.html"&gt;http://qlikviewmaven.blogspot.com/2009/06/quick-load-of-max-field-value.html&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Feb 2010 14:48:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-do-you-set-a-Min-and-Max-date-based-off-different-fields/m-p/230508#M82328</guid>
      <dc:creator>disqr_rm</dc:creator>
      <dc:date>2010-02-03T14:48:02Z</dc:date>
    </item>
    <item>
      <title>How do you set a Min and Max date based off different fields within the same table?</title>
      <link>https://community.qlik.com/t5/QlikView/How-do-you-set-a-Min-and-Max-date-based-off-different-fields/m-p/230509#M82329</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Rakesh that is very helpful.&lt;/P&gt;&lt;P&gt;I am still having problems though with the master calendar picking up the max and min values though however.&lt;/P&gt;&lt;P&gt;I have added a Max table and a min table, and pointed my let variable statements at them as below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;B&gt;LET&lt;/B&gt; varMinDate = Num (Peek('EstProjStart', 0,'MinEstProjStart'));&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;B&gt;LET&lt;/B&gt; varMaxDate = Num (Peek('EstProjFin', -1,'MaxEstProjFin'));&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;My document is recognising the min and max values, but this is not being picked up in my Master Calendar.&lt;/P&gt;&lt;P&gt;Any suggestions?&lt;/P&gt;&lt;P&gt;Thanks,&lt;BR /&gt;Carl&lt;/P&gt;&lt;H4&gt;&lt;/H4&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Feb 2010 15:17:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-do-you-set-a-Min-and-Max-date-based-off-different-fields/m-p/230509#M82329</guid>
      <dc:creator />
      <dc:date>2010-02-03T15:17:04Z</dc:date>
    </item>
    <item>
      <title>How do you set a Min and Max date based off different fields within the same table?</title>
      <link>https://community.qlik.com/t5/QlikView/How-do-you-set-a-Min-and-Max-date-based-off-different-fields/m-p/230510#M82330</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What you can check is that rour fields have correct date data types in there. Try to take out NUM function and see what you get in your variables.&lt;/P&gt;&lt;P&gt;Also check all the records in your Min and Max tables. Do you have more than one records on those tables?&lt;/P&gt;&lt;P&gt;What do you get in your var* variables?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Feb 2010 16:15:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-do-you-set-a-Min-and-Max-date-based-off-different-fields/m-p/230510#M82330</guid>
      <dc:creator>disqr_rm</dc:creator>
      <dc:date>2010-02-03T16:15:10Z</dc:date>
    </item>
    <item>
      <title>How do you set a Min and Max date based off different fields within the same table?</title>
      <link>https://community.qlik.com/t5/QlikView/How-do-you-set-a-Min-and-Max-date-based-off-different-fields/m-p/230511#M82331</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rakesh,&lt;/P&gt;&lt;P&gt;I'm sure that I am pretty close to fixing this but not quite....My year table is only calculating my dates from the EstProjStart field, I need to it select the Minimum date from that but the Maximum date from the EstProjStart field. I've followed your instructions on creating new new tables which identifies the minimum values and the maximum values from the two fields. My Master Calendar code is below:&lt;/P&gt;&lt;P&gt;&lt;B&gt;LETvarMinDate = Num (Peek('EstProjStart', 0,'MinEstProjStart'));&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LETvarMaxDate = Num (Peek('EstProjFin', 0,'MaxEstProjFin')); &lt;B&gt;&lt;/B&gt;&lt;/P&gt;&lt;P&gt;LETvarToday = Num (today()); &lt;B&gt;&lt;/B&gt;&lt;/P&gt;&lt;P&gt;//Create all days in the range from varMinDate to varMaxDate&lt;/P&gt;&lt;P&gt;TempCalendar:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;B&gt;&lt;I&gt;$(vDateMin)&lt;/I&gt; + RowNo() - 1&lt;/B&gt; AS DateNumber, &lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Date(&lt;B&gt;&lt;I&gt;$(vDateMin)&lt;/I&gt; + RowNo() - 1)&lt;/B&gt; AS TempDate&lt;/P&gt;&lt;P&gt;&lt;I&gt;&lt;/I&gt;&lt;I&gt;&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;AUTOGENERATE&lt;/B&gt;TempDate &lt;B&gt;AS&lt;/B&gt; EstProjFin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1 &lt;B&gt;WHILE&lt;/B&gt; &lt;B&gt;&lt;I&gt;$(vDateMin)&lt;/I&gt;+IterNo()-1&amp;lt;=&lt;/B&gt; &lt;I&gt;$(vDateMax)&lt;/I&gt;;&lt;B&gt;&lt;/B&gt;&lt;/P&gt;&lt;P style="font-weight: bold"&gt;//********** Master Calendar **********&lt;/P&gt;&lt;P style="font-weight: bold"&gt;MasterCalendar:&lt;/P&gt;&lt;P style="font-weight: bold"&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;week(TempDate) &lt;B&gt;AS&lt;/B&gt; Week,&lt;/P&gt;&lt;P&gt;year(TempDate) &lt;B&gt;AS&lt;/B&gt; Year,&lt;/P&gt;&lt;P&gt;month(TempDate) &lt;B&gt;AS&lt;/B&gt; Month,&lt;/P&gt;&lt;P&gt;day(TempDate) &lt;B&gt;AS&lt;/B&gt; Day,&lt;/P&gt;&lt;P&gt;weekday(TempDate) &lt;B&gt;AS&lt;/B&gt; WeekDay,&lt;/P&gt;&lt;P&gt;'Q' &amp;amp; Ceil(Month(TempDate)/3) &lt;B&gt;AS&lt;/B&gt; Quarter,&lt;/P&gt;&lt;P&gt;date(monthstart(TempDate), 'MMM-YYYY') &lt;B&gt;AS&lt;/B&gt; MonthYear,&lt;/P&gt;&lt;P&gt;week(TempDate)&amp;amp;'-'&amp;amp;Year(TempDate) &lt;B&gt;AS&lt;/B&gt; WeekYear,&lt;/P&gt;&lt;P&gt;Year2Date(TempDate, 0, 1, &lt;B&gt;&lt;I&gt;$(vToday)&lt;/I&gt;)*-1&lt;/B&gt; AS CurYTDFlag,&lt;/P&gt;&lt;P&gt;Year2Date(TempDate,-1, 1, &lt;B&gt;&lt;I&gt;$(vToday)&lt;/I&gt;)*-1&lt;/B&gt; AS LastYTDFlag&lt;/P&gt;&lt;P&gt;&lt;B&gt;RESIDENT&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TempCalendar &lt;B&gt;ORDER&lt;/B&gt; &lt;B&gt;BY&lt;/B&gt; TempDate Asc; &lt;B&gt;&lt;/B&gt;&lt;/P&gt;&lt;P style="font-weight: bold"&gt;DROP&lt;/P&gt;&lt;B&gt;TABLE &lt;I&gt;TempCalendar;&lt;/I&gt;&lt;/B&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Is it the temporary calendar which I am not using correctly to pull in two tables?&lt;/P&gt;&lt;P&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;Carl&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Feb 2010 17:27:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-do-you-set-a-Min-and-Max-date-based-off-different-fields/m-p/230511#M82331</guid>
      <dc:creator />
      <dc:date>2010-02-03T17:27:21Z</dc:date>
    </item>
    <item>
      <title>How do you set a Min and Max date based off different fields within the same table?</title>
      <link>https://community.qlik.com/t5/QlikView/How-do-you-set-a-Min-and-Max-date-based-off-different-fields/m-p/230512#M82332</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Carl,&lt;/P&gt;&lt;P&gt;I would do it little differently (may be cleaner way). Have a look and let me know your thoughts.&lt;/P&gt;&lt;P&gt;Rakesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Feb 2010 23:21:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-do-you-set-a-Min-and-Max-date-based-off-different-fields/m-p/230512#M82332</guid>
      <dc:creator>disqr_rm</dc:creator>
      <dc:date>2010-02-03T23:21:50Z</dc:date>
    </item>
    <item>
      <title>How do you set a Min and Max date based off different fields within the same table?</title>
      <link>https://community.qlik.com/t5/QlikView/How-do-you-set-a-Min-and-Max-date-based-off-different-fields/m-p/230513#M82333</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Rakesh - That works great. I had definitely over complicated it...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Feb 2010 11:07:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-do-you-set-a-Min-and-Max-date-based-off-different-fields/m-p/230513#M82333</guid>
      <dc:creator />
      <dc:date>2010-02-04T11:07:08Z</dc:date>
    </item>
    <item>
      <title>How do you set a Min and Max date based off different fields within the same table?</title>
      <link>https://community.qlik.com/t5/QlikView/How-do-you-set-a-Min-and-Max-date-based-off-different-fields/m-p/230514#M82334</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rakesh,&lt;/P&gt;&lt;P&gt;Sorry to ask you another question but it is linked to the above. As an extension to the above I am looking to input some production data for the projects. The production table is very simple with three fields: ProjectName, Date, ProductionAmount. When I bring this information in, I get a script error as follows:&lt;/P&gt;&lt;P&gt;Script line error:&lt;BR /&gt;LOAD date( - recno() + 1) as Date&lt;BR /&gt;AUTOGENERATE NoOfDays&lt;/P&gt;&lt;P&gt;Why would the production table be conflicting so much with the Calendar Table? They should both be linked via the Date field....&lt;/P&gt;&lt;P&gt;Any suggestions would be most appreciated.&lt;/P&gt;&lt;P&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;Carl&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Feb 2010 13:51:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-do-you-set-a-Min-and-Max-date-based-off-different-fields/m-p/230514#M82334</guid>
      <dc:creator />
      <dc:date>2010-02-04T13:51:39Z</dc:date>
    </item>
    <item>
      <title>How do you set a Min and Max date based off different fields within the same table?</title>
      <link>https://community.qlik.com/t5/QlikView/How-do-you-set-a-Min-and-Max-date-based-off-different-fields/m-p/230515#M82335</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have a look at following line in your code:&lt;/P&gt;&lt;P&gt;LOAD date( - recno() + 1) as Date&lt;/P&gt;&lt;P&gt;You are missing the variable before "- recno()". Or it could be that your variable varMaxDate doesn't have any value. Check displaying that variable value in a text box and see what you get.&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Feb 2010 14:38:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-do-you-set-a-Min-and-Max-date-based-off-different-fields/m-p/230515#M82335</guid>
      <dc:creator>disqr_rm</dc:creator>
      <dc:date>2010-02-04T14:38:37Z</dc:date>
    </item>
    <item>
      <title>How do you set a Min and Max date based off different fields within the same table?</title>
      <link>https://community.qlik.com/t5/QlikView/How-do-you-set-a-Min-and-Max-date-based-off-different-fields/m-p/230516#M82336</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In my calendar table I have the variable you are talking about:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;I&gt;&lt;BR /&gt;MasterCalendar:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;B&gt;&lt;/B&gt;&lt;BR /&gt;&lt;BR /&gt;LOAD&lt;BR /&gt;*,&lt;/I&gt;&lt;BR /&gt;week(Date) &lt;B&gt;AS&lt;/B&gt; Week,&lt;BR /&gt;year(Date) &lt;B&gt;AS&lt;/B&gt; Year,&lt;BR /&gt;month(Date) &lt;B&gt;AS&lt;/B&gt; Month,&lt;BR /&gt;day(Date) &lt;B&gt;AS&lt;/B&gt; Day,&lt;BR /&gt;weekday(Date) &lt;B&gt;AS&lt;/B&gt; WeekDay,&lt;BR /&gt;'Q' &amp;amp; Ceil(Month(Date)/3) &lt;B&gt;AS&lt;/B&gt; Quarter,&lt;BR /&gt;date(monthstart(Date), 'MMM-YYYY') &lt;B&gt;AS&lt;/B&gt; MonthYear,&lt;BR /&gt;week(Date)&amp;amp;'-'&amp;amp;Year(Date) &lt;B&gt;AS&lt;/B&gt; WeekYear,&lt;BR /&gt;Year2Date(Date, 0, 1, &lt;B&gt;&lt;I&gt;$(vToday)&lt;/I&gt;)*-1&lt;/B&gt; AS CurYTDFlag,&lt;BR /&gt;Year2Date(Date,-1, 1, &lt;B&gt;&lt;I&gt;$(vToday)&lt;/I&gt;)*-1&lt;/B&gt; AS LastYTDFlag;&lt;BR /&gt;&lt;I&gt;&lt;/I&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;B&gt;&lt;BR /&gt;LOAD&lt;BR /&gt;date(&lt;/B&gt;&lt;I&gt;$(varMaxDate)&lt;/I&gt; - recno() + 1) &lt;B&gt;as&lt;/B&gt; Date&lt;B&gt;&lt;BR /&gt;AUTOGENERATE&lt;BR /&gt;NoOfDays;&lt;/B&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;The code for the Production table is as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;I&gt;&lt;BR /&gt;Production:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;B&gt;&lt;/B&gt;&lt;BR /&gt;&lt;BR /&gt;LOAD&lt;BR /&gt;ProjectName,&lt;/I&gt;&lt;BR /&gt;Date,&lt;BR /&gt;ProductionAmount&lt;BR /&gt;&lt;B&gt;&lt;BR /&gt;FROM&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/B&gt;&lt;BR /&gt;&lt;BR /&gt;[Data files\Natural Resources data.xlsx]&lt;BR /&gt;(ooxml, embedded labels, table is Production);&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Feb 2010 14:59:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-do-you-set-a-Min-and-Max-date-based-off-different-fields/m-p/230516#M82336</guid>
      <dc:creator />
      <dc:date>2010-02-04T14:59:50Z</dc:date>
    </item>
    <item>
      <title>How do you set a Min and Max date based off different fields within the same table?</title>
      <link>https://community.qlik.com/t5/QlikView/How-do-you-set-a-Min-and-Max-date-based-off-different-fields/m-p/230517#M82337</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What's the varMaxDate value? Just put it in a text box and post here.&lt;/P&gt;&lt;P&gt;Also where are you defining varMaxDate? LET varMaxDate = ?????.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Feb 2010 15:13:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-do-you-set-a-Min-and-Max-date-based-off-different-fields/m-p/230517#M82337</guid>
      <dc:creator>disqr_rm</dc:creator>
      <dc:date>2010-02-04T15:13:38Z</dc:date>
    </item>
    <item>
      <title>How do you set a Min and Max date based off different fields within the same table?</title>
      <link>https://community.qlik.com/t5/QlikView/How-do-you-set-a-Min-and-Max-date-based-off-different-fields/m-p/230518#M82338</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The production dates fall within the varMaxDate and the varMinDate.&lt;/P&gt;&lt;P&gt;I have no decided to place the production table after the calendar table and it now works - but would prefer to have the production table in the facts tab which is before the calendar.&lt;/P&gt;&lt;P&gt;This is my code (I have defined the Let statements before the calendar table on the calendar tab:&lt;/P&gt;&lt;P&gt;&lt;B&gt;Let varMinDate = peek('MinEstProjStart');&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let varMaxDate = peek('MaxEstProjFin'); &lt;B&gt;&lt;/B&gt;&lt;/P&gt;&lt;P&gt;Let varToday = today(); &lt;B&gt;&lt;/B&gt;&lt;/P&gt;&lt;P&gt;Let NoOfDays = varMaxDate - varMinDate + 1; &lt;B&gt;&lt;/B&gt;&lt;/P&gt;&lt;P&gt;drop &lt;B&gt;table&lt;/B&gt; &lt;I&gt;MinMaxTab;&lt;/I&gt;&lt;/P&gt;&lt;P&gt;MasterCalendar:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-weight: bold"&gt;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;*, &lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;week(Date) &lt;B&gt;AS&lt;/B&gt; Week,&lt;/P&gt;&lt;P&gt;year(Date) &lt;B&gt;AS&lt;/B&gt; Year,&lt;/P&gt;&lt;P&gt;month(Date) &lt;B&gt;AS&lt;/B&gt; Month,&lt;/P&gt;&lt;P&gt;day(Date) &lt;B&gt;AS&lt;/B&gt; Day,&lt;/P&gt;&lt;P&gt;weekday(Date) &lt;B&gt;AS&lt;/B&gt; WeekDay,&lt;/P&gt;&lt;P&gt;'Q' &amp;amp; Ceil(Month(Date)/3) &lt;B&gt;AS&lt;/B&gt; Quarter,&lt;/P&gt;&lt;P&gt;date(monthstart(Date), 'MMM-YYYY') &lt;B&gt;AS&lt;/B&gt; MonthYear,&lt;/P&gt;&lt;P&gt;week(Date)&amp;amp;'-'&amp;amp;Year(Date) &lt;B&gt;AS&lt;/B&gt; WeekYear,&lt;/P&gt;&lt;P&gt;Year2Date(Date, 0, 1, &lt;B&gt;&lt;I&gt;$(vToday)&lt;/I&gt;)*-1&lt;/B&gt; AS CurYTDFlag,&lt;/P&gt;&lt;P&gt;Year2Date(Date,-1, 1, &lt;B&gt;&lt;I&gt;$(vToday)&lt;/I&gt;)*-1&lt;/B&gt; AS LastYTDFlag;&lt;/P&gt;&lt;P style="font-style: italic"&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;LOAD&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;date(&lt;B&gt;&lt;I&gt;$(varMaxDate)&lt;/I&gt; - recno() + 1)&lt;/B&gt; as Date&lt;B&gt;&lt;/B&gt;&lt;/P&gt;&lt;P style="font-weight: bold"&gt;AUTOGENERATE&lt;/P&gt;&lt;B&gt;NoOfDays;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;//********** Production Table **********&lt;/P&gt;&lt;P style="font-weight: bold"&gt;Production:&lt;/P&gt;&lt;P style="font-weight: bold"&gt;LOAD&lt;/P&gt;&lt;B&gt;ProjectName,&lt;/B&gt; &lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Date,&lt;/P&gt;&lt;P&gt;ProductionAmount&lt;/P&gt;&lt;P style="font-weight: bold"&gt;&lt;/P&gt;&lt;P style="font-weight: bold"&gt;FROM&lt;/P&gt;&lt;P style="font-weight: bold"&gt;&lt;/P&gt;[Data files\Natural Resources data.xlsx]&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;(ooxml, embedded labels, table is Production);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Feb 2010 15:26:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-do-you-set-a-Min-and-Max-date-based-off-different-fields/m-p/230518#M82338</guid>
      <dc:creator />
      <dc:date>2010-02-04T15:26:26Z</dc:date>
    </item>
    <item>
      <title>How do you set a Min and Max date based off different fields within the same table?</title>
      <link>https://community.qlik.com/t5/QlikView/How-do-you-set-a-Min-and-Max-date-based-off-different-fields/m-p/230519#M82339</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;oh! ofcourse, if you had a Date field before load, that would't work. What you could do is use some other field name than Date in the Calendar, and later rename it or load it again in pre-load as Date.&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;LOAD *,&lt;BR /&gt;week(dummyDate) AS Week,&lt;BR /&gt;...&lt;BR /&gt;...&lt;BR /&gt;dummyDate as Date;&lt;BR /&gt;LOAD&lt;BR /&gt;date($(varMaxDate) - recno() + 1) as dummyDate&lt;BR /&gt;AUTOGENERATE&lt;BR /&gt;NoOfDays;&lt;/P&gt;&lt;P&gt;drop field dummyDate;&lt;/P&gt;&lt;P&gt;Anyway, glad that it is working for you now.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Feb 2010 15:42:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-do-you-set-a-Min-and-Max-date-based-off-different-fields/m-p/230519#M82339</guid>
      <dc:creator>disqr_rm</dc:creator>
      <dc:date>2010-02-04T15:42:17Z</dc:date>
    </item>
  </channel>
</rss>

