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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
GregB
Contributor
Contributor

Error in expression: ')' expected

Hi,

 

I'm only new to Qlik & have come across an issue which is make me lose my hair quicker than I should be.

I have the script for a Master Calendar below, but when I try to load it I am receiving the "Error in expression: ')' expected" error & I can't work out why.

My script is:

//**** Create the Master Calendar ****
MasterCalendar:
LOAD
[Authorised Date],
Week([Authorised Date]) as Week,
Year([Authorised Date]) as Year,
Month([Authorised Date]) as Month,
Day([Authorised Date]) as Day,
WeekDay([Authorised Date]) as WeekDay,
Dual('Q' & Ceil(Month([Authorised Date]) / 3), Ceil(Month([Authorised Date]) / 3)) as Quarter, // new for better sorting
Date(MonthStart([Authorised Date]),'MMM-YYYY') as MonthYear,
Week([Authorised Date]) &'-'& If(Week([Authorised Date])=1 AND Month([Authorised Date])=12,Year([Authorised Date])+1, If(Match(Week([Authorised Date]), 52, 53) AND
Month([Authorised Date])=1, Year([Authorised Date])-1, Year([Authorised Date]))) as WeekYear,
InYearToDate([Authorised Date], $(vToday), 0) * -1 as CYTDFlag,
InYearToDate([Authorised Date], $(vToday), -1) * -1 as LYTDFlag,
If(DayNumberOfYear([Authorised Date]) <= DayNumberOfYear($(vToday)), 1, 0 ) as IsInYTD,
If(DayNumberOfQuarter([Authorised Date]) <= DayNumberOfQuarter($(vToday)), 1, 0) as IsInQTD,
If(Day([Authorised Date]) <= Day($(vToday)), 1, 0) as IsInMTD,
If(Month([Authorised Date]) = Month($(vToday)), 1, 0) as IsCurrentMonth,
If(Month(AddMonths([Authorised Date],1)) = Month($(vToday)), 1, 0) as IsLastMonth
RESIDENT MasterCalendar_Temp;

Any help would be greatly appreciated.

Thank you in advance
Greg

1 Solution

Accepted Solutions
GregB
Contributor
Contributor
Author

Oh wow, it's quite pedantic isn't it.....

I spoke to my colleague who gave me a known script that works...and it does 🙂

I have no doubt this won't be the last time I have to call on the wise Qlik community for assistance.

I appreciate your help, thank you 🙂

 

 

View solution in original post

3 Replies
lockematthewp
Creator II
Creator II

It seems like all of your parenthesis are there. You should comment out a line or two at a time until you can determine which is giving the error.

Anil_Babu_Samineni

If you use this line 

//**** Create the Master Calendar ****

Instead can you below line

//Create the Master Calendar 

/* will say there is comment enabled but not closed.

I am silly, But it is powerful. 

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
GregB
Contributor
Contributor
Author

Oh wow, it's quite pedantic isn't it.....

I spoke to my colleague who gave me a known script that works...and it does 🙂

I have no doubt this won't be the last time I have to call on the wise Qlik community for assistance.

I appreciate your help, thank you 🙂