Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi all,
I get the following error: when I Re_load the following script after adding the following line:
(Year([Date_Dt])– 1) * 12 + Num(Month([Date_Dt])) As MonthId
below is the script:
//Adding the Calendar
"Calendar":
LOAD
[Date_Dt],
//Standard Date Objects
Day([Date_Dt]) AS DayOfMonth,
WeekDay([Date_Dt]) AS DayName,
Week([Date_Dt]) AS WeekOfYear,
Month([Date_Dt]) AS Month,
Num(Month([Date_Dt])) AS MonthNum,
'Q' & Ceil(Month([Date_Dt])/3) AS Quarter,
Year([Date_Dt]) AS Year,
(Year([Date_Dt])– 1) * 12 + Num(Month([Date_Dt])) As MonthId
RESIDENT "FACT_POLICY_SNAP_DLY"
;
For me, the image of the error is blank. Can you upload the screenshot again, or copy the text of the message?
hi Peter,
below is the screenshot:
Still blank
Qlikview Creates Log file in Text Please check this log file if possible attach so that anybody can guide you on
syntax error
HTH
Vikas
HI Judas, I can't see the screenshot, can you reattach?
Anyway, what are you trying to get in MonthId? ie, for the actual date (16/01/2015) it will return:
(2015-1)*12+1=24169
Usually a number format for year & month is created this way:
Year([Date_Dt])) * 100 + Num(Month([Date_Dt])) As MonthId
This will return 201501 for 16/01/2015
Error msg:
Error in expression:')' expected
Error in expression:
')' expected
"Calendar":
LOAD
[Date_Dt],
Day([Date_Dt]) AS DayOfMonth,
WeekDay([Date_Dt]) AS DayName,
Week([Date_Dt]) AS WeekOfYear,
Month([Date_Dt]) AS Month,
Num(Month([Date_Dt])) AS MonthNum,
'Q' & Ceil(Month([Date_Dt])/3) AS Quarter,
Year([Date_Dt]) AS Year,
(Year([Date_Dt])– 1) * 12 + Num(Month([Date_Dt])) As MonthId
RESIDENT "FACT_POLICY_SNAP_DLY"
Hi Judas, rewrite the '-', in my qv it's readed as an unrecognized symbol.
Try this
( Year([Date_Dt])– 1) * 12 + Num(Month([Date_Dt])) ) As MonthId