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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

error when reloading the script

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"
;

17 Replies
Peter_Cammaert
Partner - Champion III
Partner - Champion III

For me, the image of the error is blank. Can you upload the screenshot again, or copy the text of the message?

Not applicable
Author

hi Peter,

below is the screenshot:

Not applicable
Author

Still blank

vikasmahajan

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

Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.
rubenmarin1

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


Not applicable
Author

Error msg:

Error in expression:')' expected

Not applicable
Author

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"

rubenmarin1

Hi Judas, rewrite the '-', in my qv it's readed as an unrecognized symbol.

vikasmahajan

Try this


( Year([Date_Dt])– 1) * 12 + Num(Month([Date_Dt])) ) As MonthId

Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.