Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

General Script Error

I am trying to look up a calender file returning a single record with Today's date. Using this returned record I am trying to get the Financial Year & Period value and then in another table return all records from the same calendar table so I can then get the start date of the Financial Year & Period combination.

My issue is that each time I run it I get the General Script error message. Can anyone please provide me with information on what I am doing wrong.


SET dteToday= date(ReloadTime());

Calendar:
LOAD FinancialYear,
FinanceYearPeriod,
Date,
CalendarWeek,
FinancialPeriod,
FinancialPeriodWeek,
FinancialWeek,
FinancialQuarter,
Day,
FullDate,
CalenderDocCounter,
NoOfDaysInPeriod,
NoOfDaysInYear
FROM
\\206.156.1.3\QlikView\Data_QVD\Calendar.qvd (qvd)
WHERE FullDate = $(dteToday);

SET v1 = min(FinanceYearPeriod);

//get todays period details
TodayDetails:
LOAD Date as NODDate,
FullDate as nodFull,
1 as DayCounter,
FinanceYearPeriod
Resident Calendar Where FinanceYearPeriod = $(v1);

set vThisFYP = load min(FinanceYearPeriod) resident Calendar;
Set vThisPeriodStart = min(nodFull);

Many Thanks

3 Replies
Not applicable
Author

So with "each time I run it" you mean a reload?

If so, then the first variable is set to now and I am not sure table Calendar will have a record with field FullDate =now ...?!?

But perhaps you meant something else?

disqr_rm
Partner - Specialist III
Partner - Specialist III

Try:


Calendar:
LOAD FinancialYear,
FinanceYearPeriod,
Date,
CalendarWeek,
FinancialPeriod,
FinancialPeriodWeek,
FinancialWeek,
FinancialQuarter,
Day,
FullDate,
CalenderDocCounter,
NoOfDaysInPeriod,
NoOfDaysInYear
FROM
\\206.156.1.3\QlikView\Data_QVD\Calendar.qvd (qvd)
WHERE FullDate = $(dteToday);
MinFY:
LOAD min(FinanceYearPeriod) as MinFY
RESIDENT Calendar
GROUP BY 1;
Let v1 = peek('MinFY');
DROP TABLE MinFY;
//get todays period details
TodayDetails:
LOAD Date as NODDate,
FullDate as nodFull,
1 as DayCounter,
FinanceYearPeriod
Resident Calendar Where FinanceYearPeriod = $(v1);


The min() and max() functions require GROUP BY addition. The code above should run fine, or atleast give you idea.

wizardo
Creator III
Creator III

if you have only aggr expression in your load the you dont have to use the groupBy clause

qlikview will consider the entire table as one big group

kinda like using TOTAL