Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
rathod14
Contributor
Contributor

Error occurred: Unexpected token: '=', expected one of: '

I am using beow script to load Calendar qvd from DATEDIM

 

LET v_QVD = 'Calendar';

$(v_QVD):
LOAD
DateId As DateId,
Date(floor(CalendarDate)) As CalendarDate,
CurrentYearMonth As YearMonth,
CurrentYearQuarter As YearQuarter,
CurrentQuarter As Quarter,
CurrentYear As Year,
ISOCurrentWeekNo As WeekNo,
ISOCurrentWeekStartDate As WeekStartDate,
ISOCurrentWeekEndDate As WeekEndDate
FROM [$(v_QSDimsPath)DateDim.qvd](qvd)
where DateId >= $(vMinDateId) and DateId <= $(vMaxDateId);

/* Creating Current Max Date variable*/
Max_Temp_Date:
Load Max(CalendarDate) as MaxDate Resident $(v_QVD);

LET vMaxDate = Date(floor(Peek('MaxDate',-1,'Max_Temp_Date')));

LET MyMessage = 'MaxDate: '& vMaxDate;
TRACE $(MyMessage);

LET vPriorDate = Num#(Date(floor(Peek('MaxDate',-1,'Max_Temp_Date')-1),'YYYYMMDD'));

LET MyMessage = 'PriorDate: '& vPriorDate;
TRACE $(MyMessage);

 

But I am getting this below error> Can anyone help

Unexpected token: 'DateId', expected one of: ':', 'OPERATOR_PLUS', 'OPERATOR_MINUS', 'OPERATOR_MULTIPLICATION', 'OPERATOR_DIVISION', 'OPERATOR_STRING_CONCAT', 'like', ...: Calendar: LOAD DateId, Date(floor(CalendarDate)) As CalendarDate, CurrentYearMonth As YearMonth, CurrentYearQuarter As YearQuarter, CurrentQuarter As Quarter, CurrentYear As Year, ISOCurrentWeekNo As WeekNo, ISOCurrentWeekStartDate As WeekStartDate, ISOCurrentWeekEndDate As WeekEndDate FROM [lib://QS_Projects_BA_AMERICA_ANALYSIS/10_QVD/20_DIM/DateDim.qvd](qvd) where DateId >= and >>>>>>DateId<<<<<< <=

 

1 Reply
anthonyj
Creator III
Creator III

Hi @rathod14 ,

I think the error is happening because of the value in your vMaxDateID and vMinDateID. I can't see what the values are but if they are being created with the same functions as vMaxDate then they resolve to a date (DD/MM/YYYY) format.  If they are date format then they would need to be in single quotes. '$(vMaxDateID)'

Regards

Anthony