Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
amber2000
Creator
Creator

Error in Expression when using MasterCalendar


Hello everyone,

I'm strugling with my MasterCalendar, when I do a reload I'm getting :

Error in Espression ')' Expected

I can't find where the error occurs.

Does anybody know why please?

1 Solution

Accepted Solutions
jpenuliar
Partner - Specialist III
Partner - Specialist III

or below:

YeartoDate(TempDate)*-1 as CurYTDFlag
YeartoDate(TempDate,-1)*-1 as LastYTDFlag

View solution in original post

12 Replies
jpenuliar
Partner - Specialist III
Partner - Specialist III

You have ":" semicolon in the below:

RESIDENT TempCalendar: 

it should be

RESIDENT TempCalendar

jpenuliar
Partner - Specialist III
Partner - Specialist III

and the below lines:

InYearToDate(TempDate, $(varToday), 0) * -1 AS CurYTDFlag
InYearToDate(TempDate,
$(varToday), -1) * -1 AS LastYTDFlag

Try with If() function

amber2000
Creator
Creator
Author

How do you mean with the If function?

jpenuliar
Partner - Specialist III
Partner - Specialist III

or below:

YeartoDate(TempDate)*-1 as CurYTDFlag
YeartoDate(TempDate,-1)*-1 as LastYTDFlag

MK_QSL
MVP
MVP

MasterCalendar:

Load

  DATE#(TempDate, 'YYYYMMDD') as DT_Create_Dates,

  Week(TempDate) as Week,

  Year(TempDate) as Year,

  Month(TempDate) as Month,

  Day(TempDate) as Day,

  WeekDay(TempDate) as WeekDay,

  'Q' & CEIL (Month(TempDate)/3) AS Quarter, //Ceil = afronden Tempdate/3 van een non decimaal getal naar een geheel getal

  Date(MonthStart (TempDate), 'MMM-YYYY') as MonthYear, //For TrendInformation (alle dagen van de maand naar de 1e dag van de maand brengen anders heb je 31 x januari 2007)

  Week (TempDate) & '-' & Year(TempDate) as WeekYear,   //For TrendInformation

  InYearToDate(TempDate, Today(), 0) * -1 AS CurYTDFlag,

  InYearToDate(TempDate, Today(), -1) * -1 AS LastYTDFlag

  // Herladen van de tabel TempCalendar, als we dit niet doen moeten we voor elke Datefield 'Month', 'Year' , 'Week' etc. de volledige loop gebruiken van MinMaxTemp tabel

  RESIDENT TempCalendar

  Order by TempDate ASC;

amber2000
Creator
Creator
Author

Thanks Jonathan, your last remark did the trick

amber2000
Creator
Creator
Author

Jonathan,

After testing I see that my Month is not linked to SD_Close_Date.

If I have no selection I get my data, if I make the selection for month 'mrt' then there is no data displayed.

Somewhere there is still something wrong, can you see where?

Kind regards,

Ambertje

jpenuliar
Partner - Specialist III
Partner - Specialist III

Hi Amber,

SD_Close-Date is not included in your Fact table, see below:

jpenuliar
Partner - Specialist III
Partner - Specialist III

The idea of the Master Calendar is to link it to your Date field.

In your case, you have the Master Calendar linked to DT_Create_Dates.

You will have to make another Calendar Table to link to SD_Close_Date.

another way is to look into Common Date technique or Canonical Calendar, quick search in the community will do