Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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 🙂
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.
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.
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 🙂