<?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: Calendar Variable Min/Max Date Getting Null Values in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Calendar-Variable-Min-Max-Date-Getting-Null-Values/m-p/1614298#M737340</link>
    <description>&lt;P&gt;That's it! Thank you Brett.&lt;/P&gt;</description>
    <pubDate>Tue, 20 Aug 2019 12:56:56 GMT</pubDate>
    <dc:creator>andersonc</dc:creator>
    <dc:date>2019-08-20T12:56:56Z</dc:date>
    <item>
      <title>Calendar Variable Min/Max Date Getting Null Values</title>
      <link>https://community.qlik.com/t5/QlikView/Calendar-Variable-Min-Max-Date-Getting-Null-Values/m-p/1606223#M737337</link>
      <description>&lt;P&gt;I believe the min and max variables are showing null values and it's causing syntax errors (unexpected token) in the script. The script is below. Does anyone know what could be causing the errors? It worked fine in QV 11 and stopped with the update to QV 12.&amp;nbsp;&lt;/P&gt;&lt;P&gt;//Main Calendar Min &amp;amp; Max Date&lt;/P&gt;&lt;P&gt;UNQUALIFY *;&lt;/P&gt;&lt;P&gt;[Temp]:&lt;BR /&gt;LOAD&lt;BR /&gt;makedate($(v_StartYear),1,1) as [MinDate],&lt;BR /&gt;makedate($(v_CurrentYear),12,31) as [MaxDate]&lt;BR /&gt;autogenerate 1;&lt;/P&gt;&lt;P&gt;LET v_MinDate = Num (Peek ('MinDate', 0, [Temp]));&lt;BR /&gt;LET v_MaxDate = Num (Peek ('MaxDate', 0, [Temp])) ;&lt;/P&gt;&lt;P&gt;// Create a table of all of the dates between the Min and Max dates.&lt;/P&gt;&lt;P&gt;[TempCalendar1]:&lt;BR /&gt;LOAD&lt;BR /&gt;$(v_MinDate) + RowNo () - 1 as Num,&lt;BR /&gt;Num (Date ($(v_MinDate) + RowNo () - 1)) as TempDate&lt;BR /&gt;AutoGenerate&lt;BR /&gt;$(v_MaxDate) - $(v_MinDate) + 1;&lt;/P&gt;&lt;P&gt;//Main Calendar&lt;/P&gt;&lt;P&gt;[Calendar]:&lt;BR /&gt;LOAD&lt;BR /&gt;TempDate as DATE_KEY,&lt;BR /&gt;TempDate as Date,&lt;BR /&gt;Date (TempDate, 'MM/DD/YY') as DateString,&lt;BR /&gt;Date (TempDate, 'MM/DD/YY') as DateString2,&lt;BR /&gt;Day (TempDate) as Day,&lt;BR /&gt;Week (TempDate) as Week,&lt;BR /&gt;Date(WeekStart(TempDate),'MMM-D-YY') as WeekStart,&lt;BR /&gt;Date(weekstart(TempDate,0,6),'MMM-D-YY') as WeekStartMon,&amp;nbsp;&lt;BR /&gt;Dual (Month (TempDate), Num (Month (TempDate))) as Month,&lt;BR /&gt;Num (MonthStart (TempDate)) as [Month Start],&lt;BR /&gt;Num (Month (TempDate)) as [Month Num],&lt;BR /&gt;'Q' &amp;amp; Ceil (Month (TempDate) / 3) as Quarter,&lt;BR /&gt;'Q' &amp;amp; Ceil (Month (TempDate) / 3) &amp;amp; '-' &amp;amp; Year (TempDate) as [Qtr YYYY],&lt;BR /&gt;Year (TempDate) as Year,&lt;BR /&gt;Date (MonthStart (TempDate), 'MMM YYYY') as [Month YYYY],&lt;BR /&gt;Year (TempDate) &amp;amp; '-' &amp;amp; right('00' &amp;amp; Num (Month (TempDate),'#0'),2) as [Year_Month],&lt;BR /&gt;Date (MonthStart (TempDate), 'MMM YY') as [Month YY],&lt;BR /&gt;(TempDate - YearStart (TempDate) + 1) as [Day In Year],&lt;BR /&gt;makedate(Year (TempDate), Num (Month (TempDate)),1) as [Month Begin Date],&lt;BR /&gt;1 as [Day Count Ind] ,&lt;BR /&gt;dual(Year (TempDate) &amp;amp; ' - Wk ' &amp;amp; Week (TempDate), (Year (TempDate) * 100) + Week(TempDate) )as Year_Week,&lt;BR /&gt;Year(TempDate) &amp;amp; '-' &amp;amp; num(Week(TempDate),'00') as YearWeek,&lt;BR /&gt;if(TempDate &amp;gt;= $(v_Last5Days) and TempDate &amp;lt; $(v_Today), 1, 0) as Last5DaysFlag,&lt;BR /&gt;if(TempDate &amp;gt;= $(v_Last3Months) and TempDate &amp;lt; $(v_Today), 1, 0) as Last3MonthsFlag,&lt;BR /&gt;if(TempDate &amp;gt;= $(v_3MonthsPrevYr) and TempDate &amp;lt; $(v_DayinPrevYr), 1, 0) as Same3MonthsPrevFlag,&lt;BR /&gt;if(TempDate &amp;gt;= $(v_Closed3Mth_Start) and TempDate &amp;lt;= $(v_Closed3Mth_End), 1, 0) as Closed3MonthsCFlag,&lt;BR /&gt;if(TempDate &amp;gt;= $(v_Closed3MthP_Start) and TempDate &amp;lt;= $(v_Closed3MthP_End), 1, 0) as Closed3MonthsPFlag,&lt;BR /&gt;if(TempDate &amp;gt;= $(v_Last12Months) and TempDate &amp;lt; $(v_Today), 1, 0) as Last12MonthsFlag,&lt;BR /&gt;if(TempDate &amp;gt;= $(v_Last5Weeks) and TempDate &amp;lt; $(v_Today), 1, 0) as Last5WeeksFlag,&lt;BR /&gt;if(TempDate &amp;lt;= $(v_ClosedPeriod), 1, 0) as ClosedPeriodFlag,&lt;BR /&gt;if(TempDate &amp;gt;= $(v_Fin_TTM) and TempDate &amp;lt;= $(v_ClosedPeriod), 1, 0) as Fin_TTMFlag,&lt;BR /&gt;if(TempDate &amp;gt;= $(v_Fin_T6M) and TempDate &amp;lt;= $(v_ClosedPeriod), 1, 0) as Fin_T6MFlag,&lt;BR /&gt;if(TempDate &amp;gt;= $(v_Fin_T3M) and TempDate &amp;lt;= $(v_ClosedPeriod), 1, 0) as Fin_T3MFlag,&lt;BR /&gt;if(TempDate &amp;gt;= $(v_Ops_TTM) , 1, 0) as Ops_TTMFlag,&lt;BR /&gt;if(TempDate &amp;gt;= $(v_Ops_T6M) , 1, 0) as Ops_T6MFlag,&lt;BR /&gt;Weekday(TempDate) as WeekDayName&lt;BR /&gt;Resident&lt;BR /&gt;[TempCalendar1]&lt;BR /&gt;Order By&lt;BR /&gt;TempDate ASC;&lt;/P&gt;&lt;P&gt;DROP Table [TempCalendar1];&lt;BR /&gt;DROP Table [Temp];&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calendar-Variable-Min-Max-Date-Getting-Null-Values/m-p/1606223#M737337</guid>
      <dc:creator>andersonc</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Calendar Variable Min/Max Date Getting Null Values</title>
      <link>https://community.qlik.com/t5/QlikView/Calendar-Variable-Min-Max-Date-Getting-Null-Values/m-p/1609722#M737338</link>
      <description>&lt;P&gt;I defined the variables&amp;nbsp;&lt;SPAN&gt;v_StartYear and v_CurrentYear, the error has been passed but I have a new error becasue are missing the variables under my comment in script.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Aug 2019 10:47:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calendar-Variable-Min-Max-Date-Getting-Null-Values/m-p/1609722#M737338</guid>
      <dc:creator>Claudiu_Anghelescu</dc:creator>
      <dc:date>2019-08-06T10:47:23Z</dc:date>
    </item>
    <item>
      <title>Re: Calendar Variable Min/Max Date Getting Null Values</title>
      <link>https://community.qlik.com/t5/QlikView/Calendar-Variable-Min-Max-Date-Getting-Null-Values/m-p/1614264#M737339</link>
      <description>&lt;P&gt;Chris, there were some changes in the scripting side of things in the 12.10 track and later, the following Help link will get you on the right track regarding things I believe:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://help.qlik.com/en-US/qlikview/April2019/Subsystems/Client/Content/QV_QlikView/Scripting/script-syntax.htm" target="_blank"&gt;https://help.qlik.com/en-US/qlikview/April2019/Subsystems/Client/Content/QV_QlikView/Scripting/script-syntax.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Be sure to read the following section, as I suspect this may be the main reason, depending upon which version of QlikView you are running, you may have an option to turn things off, but in 12.30 and later, this is no longer possible to do...&lt;/P&gt;
&lt;P&gt;&lt;A href="https://help.qlik.com/en-US/qlikview/April2019/Subsystems/Client/Content/QV_QlikView/Scripting/Backus-Naur-formalism.htm" target="_blank"&gt;https://help.qlik.com/en-US/qlikview/April2019/Subsystems/Client/Content/QV_QlikView/Scripting/Backus-Naur-formalism.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Article regarding turning off the BNF feature:&amp;nbsp;&lt;A href="	https://support.qlik.com/articles/000042307" target="_self"&gt;BNF functionality&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Regards,&lt;BR /&gt;Brett&lt;/P&gt;</description>
      <pubDate>Tue, 20 Aug 2019 12:13:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calendar-Variable-Min-Max-Date-Getting-Null-Values/m-p/1614264#M737339</guid>
      <dc:creator>Brett_Bleess</dc:creator>
      <dc:date>2019-08-20T12:13:47Z</dc:date>
    </item>
    <item>
      <title>Re: Calendar Variable Min/Max Date Getting Null Values</title>
      <link>https://community.qlik.com/t5/QlikView/Calendar-Variable-Min-Max-Date-Getting-Null-Values/m-p/1614298#M737340</link>
      <description>&lt;P&gt;That's it! Thank you Brett.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Aug 2019 12:56:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calendar-Variable-Min-Max-Date-Getting-Null-Values/m-p/1614298#M737340</guid>
      <dc:creator>andersonc</dc:creator>
      <dc:date>2019-08-20T12:56:56Z</dc:date>
    </item>
  </channel>
</rss>

