<?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 Fiscal year script in Search the Community</title>
    <link>https://community.qlik.com/t5/Search-the-Community/Fiscal-year-script/m-p/1880333#M873</link>
    <description>&lt;P&gt;Dear,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am running the script as provided in the exercise but it generates an error , i did not change it nor do I see a mistake in the script can. What am I missing?&lt;/P&gt;
&lt;P&gt;error:&amp;nbsp;&lt;/P&gt;
&lt;DIV class="headline undefined"&gt;Started loading data&lt;/DIV&gt;
&lt;DIV class="empty undefined"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class=""&gt;Orders &amp;lt;&amp;lt; Orders Lines fetched: 13,142&lt;/DIV&gt;
&lt;DIV class="empty undefined"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="headline edc_error"&gt;The following error occurred:&lt;/DIV&gt;
&lt;DIV class="edc_error"&gt;Unexpected token: ')', expected one of: 'OPERATOR_PLUS', 'OPERATOR_MINUS', 'OPERATOR_MULTIPLICATION', 'OPERATOR_DIVISION', 'OPERATOR_STRING_CONCAT', 'like', 'and', ...&lt;/DIV&gt;
&lt;DIV class="empty edc_error"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="headline edc_error"&gt;The error occurred here:&lt;/DIV&gt;
&lt;DIV class="edc_error"&gt;LET vStartDate = Num(YearStart(, -1)&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;)&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&lt;/DIV&gt;
&lt;DIV class="empty undefined"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="headline undefined"&gt;Data has not been loaded. Please correct the error and try loading again.&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;script from exercise&amp;nbsp; provided by qlik&lt;/P&gt;
&lt;P&gt;// loading Orders data &lt;BR /&gt;Orders:&lt;BR /&gt;LOAD&lt;BR /&gt;OrderRecordCounter,&lt;BR /&gt;OrderID,&lt;BR /&gt;Date(OrderDate) AS OrderDate,&lt;BR /&gt;CustomerID,&lt;BR /&gt;EmployeeID,&lt;BR /&gt;ShipperID,&lt;BR /&gt;FreightWeight,&lt;BR /&gt;OrderStatus,&lt;BR /&gt;LastUpdated&lt;BR /&gt;FROM [lib://DataFiles/Orders.qvd]&lt;BR /&gt;(qvd);&lt;/P&gt;
&lt;P&gt;//vFiscalYearStartMonth - Tells the starting month of the Fiscal Year&lt;BR /&gt;//vStartDate - Starting date of the Calendar generation&lt;BR /&gt;//vEndDate - Ending date of the Calendar generation&lt;BR /&gt;&lt;BR /&gt;LET vToday = Num('20-Mar-2015');&lt;/P&gt;
&lt;P&gt;SET vFiscalYearStartMonth = 7;&lt;BR /&gt;LET vStartDate = Num(YearStart($(vToday), -1));&lt;BR /&gt;LET vEndDate = Num(YearEnd($(vToday)));&lt;BR /&gt;&lt;BR /&gt;FiscalCalendar:&lt;BR /&gt;LOAD&lt;BR /&gt;*,&lt;BR /&gt;Dual('Q' &amp;amp; Ceil(FiscalMonth/3), Ceil(FiscalMonth/3)) AS FiscalQuarter, // Fiscal Calendar Quarter&lt;BR /&gt;Dual(Text(Date(MonthEnd(OrderDate), 'MMM')), FiscalMonth) AS FiscalMonthName; // Fiscal Calendar Month Name&lt;/P&gt;
&lt;P&gt;LOAD&lt;BR /&gt;*,&lt;BR /&gt;Year(OrderDate) &lt;BR /&gt;as Year, // Standard Calendar Year&lt;BR /&gt;Month(OrderDate) &lt;BR /&gt;as Month, // Standard Calendar Month&lt;BR /&gt;Date(MonthEnd(OrderDate), 'MMM') &lt;BR /&gt;as MonthName, // Standard Calendar Month Name&lt;BR /&gt;Dual('Q' &amp;amp; Ceil(Month(OrderDate)/3), Ceil(Month(OrderDate)/3)) &lt;BR /&gt;as Quarter, // Standard Calendar Quarter&lt;BR /&gt;Mod(Month(OrderDate) - $(vFiscalYearStartMonth), 12) + 1 &lt;BR /&gt;as FiscalMonth, // Fiscal Calendar Month&lt;BR /&gt;YearName(OrderDate, 0, $(vFiscalYearStartMonth)) &lt;BR /&gt;as FiscalYear; // Fiscal Calendar Year&lt;/P&gt;
&lt;P&gt;LOAD&lt;BR /&gt;Date($(vStartDate) + RangeSum(Peek('RowNum'), 1) - 1, 'DD-MMM-YYYY') &lt;BR /&gt;as OrderDate,&lt;BR /&gt;RangeSum(Peek('RowNum'), 1) &lt;BR /&gt;as RowNum&lt;BR /&gt;AutoGenerate vEndDate - vStartDate + 1;&lt;/P&gt;</description>
    <pubDate>Wed, 12 Jan 2022 19:06:56 GMT</pubDate>
    <dc:creator>MirkO1</dc:creator>
    <dc:date>2022-01-12T19:06:56Z</dc:date>
    <item>
      <title>Fiscal year script</title>
      <link>https://community.qlik.com/t5/Search-the-Community/Fiscal-year-script/m-p/1880333#M873</link>
      <description>&lt;P&gt;Dear,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am running the script as provided in the exercise but it generates an error , i did not change it nor do I see a mistake in the script can. What am I missing?&lt;/P&gt;
&lt;P&gt;error:&amp;nbsp;&lt;/P&gt;
&lt;DIV class="headline undefined"&gt;Started loading data&lt;/DIV&gt;
&lt;DIV class="empty undefined"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class=""&gt;Orders &amp;lt;&amp;lt; Orders Lines fetched: 13,142&lt;/DIV&gt;
&lt;DIV class="empty undefined"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="headline edc_error"&gt;The following error occurred:&lt;/DIV&gt;
&lt;DIV class="edc_error"&gt;Unexpected token: ')', expected one of: 'OPERATOR_PLUS', 'OPERATOR_MINUS', 'OPERATOR_MULTIPLICATION', 'OPERATOR_DIVISION', 'OPERATOR_STRING_CONCAT', 'like', 'and', ...&lt;/DIV&gt;
&lt;DIV class="empty edc_error"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="headline edc_error"&gt;The error occurred here:&lt;/DIV&gt;
&lt;DIV class="edc_error"&gt;LET vStartDate = Num(YearStart(, -1)&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;)&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&lt;/DIV&gt;
&lt;DIV class="empty undefined"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="headline undefined"&gt;Data has not been loaded. Please correct the error and try loading again.&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;script from exercise&amp;nbsp; provided by qlik&lt;/P&gt;
&lt;P&gt;// loading Orders data &lt;BR /&gt;Orders:&lt;BR /&gt;LOAD&lt;BR /&gt;OrderRecordCounter,&lt;BR /&gt;OrderID,&lt;BR /&gt;Date(OrderDate) AS OrderDate,&lt;BR /&gt;CustomerID,&lt;BR /&gt;EmployeeID,&lt;BR /&gt;ShipperID,&lt;BR /&gt;FreightWeight,&lt;BR /&gt;OrderStatus,&lt;BR /&gt;LastUpdated&lt;BR /&gt;FROM [lib://DataFiles/Orders.qvd]&lt;BR /&gt;(qvd);&lt;/P&gt;
&lt;P&gt;//vFiscalYearStartMonth - Tells the starting month of the Fiscal Year&lt;BR /&gt;//vStartDate - Starting date of the Calendar generation&lt;BR /&gt;//vEndDate - Ending date of the Calendar generation&lt;BR /&gt;&lt;BR /&gt;LET vToday = Num('20-Mar-2015');&lt;/P&gt;
&lt;P&gt;SET vFiscalYearStartMonth = 7;&lt;BR /&gt;LET vStartDate = Num(YearStart($(vToday), -1));&lt;BR /&gt;LET vEndDate = Num(YearEnd($(vToday)));&lt;BR /&gt;&lt;BR /&gt;FiscalCalendar:&lt;BR /&gt;LOAD&lt;BR /&gt;*,&lt;BR /&gt;Dual('Q' &amp;amp; Ceil(FiscalMonth/3), Ceil(FiscalMonth/3)) AS FiscalQuarter, // Fiscal Calendar Quarter&lt;BR /&gt;Dual(Text(Date(MonthEnd(OrderDate), 'MMM')), FiscalMonth) AS FiscalMonthName; // Fiscal Calendar Month Name&lt;/P&gt;
&lt;P&gt;LOAD&lt;BR /&gt;*,&lt;BR /&gt;Year(OrderDate) &lt;BR /&gt;as Year, // Standard Calendar Year&lt;BR /&gt;Month(OrderDate) &lt;BR /&gt;as Month, // Standard Calendar Month&lt;BR /&gt;Date(MonthEnd(OrderDate), 'MMM') &lt;BR /&gt;as MonthName, // Standard Calendar Month Name&lt;BR /&gt;Dual('Q' &amp;amp; Ceil(Month(OrderDate)/3), Ceil(Month(OrderDate)/3)) &lt;BR /&gt;as Quarter, // Standard Calendar Quarter&lt;BR /&gt;Mod(Month(OrderDate) - $(vFiscalYearStartMonth), 12) + 1 &lt;BR /&gt;as FiscalMonth, // Fiscal Calendar Month&lt;BR /&gt;YearName(OrderDate, 0, $(vFiscalYearStartMonth)) &lt;BR /&gt;as FiscalYear; // Fiscal Calendar Year&lt;/P&gt;
&lt;P&gt;LOAD&lt;BR /&gt;Date($(vStartDate) + RangeSum(Peek('RowNum'), 1) - 1, 'DD-MMM-YYYY') &lt;BR /&gt;as OrderDate,&lt;BR /&gt;RangeSum(Peek('RowNum'), 1) &lt;BR /&gt;as RowNum&lt;BR /&gt;AutoGenerate vEndDate - vStartDate + 1;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jan 2022 19:06:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Search-the-Community/Fiscal-year-script/m-p/1880333#M873</guid>
      <dc:creator>MirkO1</dc:creator>
      <dc:date>2022-01-12T19:06:56Z</dc:date>
    </item>
    <item>
      <title>Re: Fiscal year script</title>
      <link>https://community.qlik.com/t5/Search-the-Community/Fiscal-year-script/m-p/1880337#M874</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/161926"&gt;@MirkO1&lt;/a&gt;&amp;nbsp; if I understood correctly&lt;/P&gt;
&lt;P&gt;can you check your date format in LET vToday = Num('20-Mar-2015');&lt;/P&gt;
&lt;P&gt;for example if your date default format is :&lt;/P&gt;
&lt;P&gt;SET DateFormat='DD/MM/YYYY';&lt;/P&gt;
&lt;P&gt;you can use :&lt;/P&gt;
&lt;P&gt;LET vToday = floor(Num('20/04/2015'));&lt;/P&gt;
&lt;P&gt;SET vFiscalYearStartMonth = 7;&lt;BR /&gt;LET vStartDate = floor(Num(YearStart($(vToday), -1)));&lt;BR /&gt;LET vEndDate = floor(Num(YearEnd($(vToday))));&lt;/P&gt;
&lt;P&gt;debeug output:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Taoufiq_Zarra_0-1642016222012.png"&gt;&lt;img src="https://community.qlik.com/skins/images/02770EC0BC01C66F20EC4EACC3851929/responsive_peak/images/image_not_found.png" alt="Taoufiq_Zarra_0-1642016222012.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jan 2022 19:37:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Search-the-Community/Fiscal-year-script/m-p/1880337#M874</guid>
      <dc:creator>Taoufiq_Zarra</dc:creator>
      <dc:date>2022-01-12T19:37:16Z</dc:date>
    </item>
    <item>
      <title>Re: Fiscal year script</title>
      <link>https://community.qlik.com/t5/Search-the-Community/Fiscal-year-script/m-p/1880507#M877</link>
      <description>&lt;P&gt;Dear Mr Taoufiq,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Many thanks this indeed works. Oddly this script was the orginal script from qliksense itself.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Mirko&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jan 2022 08:40:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Search-the-Community/Fiscal-year-script/m-p/1880507#M877</guid>
      <dc:creator>MirkO1</dc:creator>
      <dc:date>2022-01-13T08:40:02Z</dc:date>
    </item>
  </channel>
</rss>

