Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
dhavalvyas
Contributor III
Contributor III

Error in calendar

Hi,

While i am developing calendar it shows following error. my script is as follows.

Script line error :

LOAD

Date( + RangeSum(Peek('RowNum'), 1) - 1) AS Day,

RangeSum(Peek('RowNum'), 1) AS RowNum

AutoGenerate vEndDate - vStartDate + 1

Calendar Script is :

SET vFiscalYearStartMonth = 4;

DateRange:

LOAD

Date(Min(Day)) AS MinDate,

Date(Max(Day)) AS MaxDate

Resident Orderdetails;

LET vStartDate = Date(Peek(MinDate));

LET vEndDate = Date(Peek(MaxDate));

DROP TABLE DateRange;

FiscalCalendar:

LOAD

*,

Dual('Q' & Ceil(FiscalMonth/3), Ceil(FiscalMonth/3)) AS FiscalQuarter, // Fiscal Calendar Quarter

Dual(Text(Date(MonthEnd(Date), 'MMM')), FiscalMonth) AS FiscalMonthName; // Fiscal Calendar Month Name

LOAD

*,

Year(Day) AS Year, // Standard Calendar Year

Month(Day) AS Month, // Standard Calendar Month

Date(MonthEnd(Day), 'MMM') AS MonthName,  // Standard Calendar Month Name

Dual('Q' & Ceil(Month(Day)/3), Ceil(Month(Day)/3)) AS Quarter,  // Standard Calendar Quarter

Mod(Month(Day) - $(vFiscalYearStartMonth), 12)+1 AS FiscalMonth,  // Fiscal Calendar Month

YearName(Day, 0, $(vFiscalYearStartMonth)) AS FiscalYear;  // Fiscal Calendar Year

LOAD

Date($(vStartDate) + RangeSum(Peek('RowNum'), 1) - 1) AS Day,

RangeSum(Peek('RowNum'), 1) AS RowNum

AutoGenerate vEndDate - vStartDate + 1;

5 Replies
kristof_j
Creator III
Creator III

Have you tried:

AUTOGENERATE num($(vEndDate)) - num($(vStartDate)) + 1;

mayuresh_d
Partner - Creator
Partner - Creator

you are having issue in startdate and enddate variable they are showing null value please check format.

Anonymous
Not applicable

Have you try:

AUTOGENERATE (1)

WHILE $(vEndDate)+IterNo()-1<= $(vStartDate);

jonathandienst
Partner - Champion III
Partner - Champion III

It looks like the variables are not getting defined. Check the log to ensure that the DateRange table retuned 1 row. Silly question, perhaps, but is the DateRange LOAD before or after you load Orderdetails?

And the above post is correct. You need $() expansions in the AutoGenerate line as well.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
dhavalvyas
Contributor III
Contributor III
Author

I tried your solution but however there is no data showing in month,year,quarter list box ? Script reload successfully but it does not showing data ?