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

Announcements
Learn how to migrate to Qlik Cloud Analytics™: On-Demand Briefing!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Error in Calculated dimension

Hi,

I have Qliview applications in Access point and in all appliactions for Bar and Line chart items I am getting the message as

//Error in Calculated dimension .

This is happening in every Bar and Line chart items.

Could anyone let me know why it is like that please.

Thanks.


16 Replies
tresesco
MVP
MVP

So you are calculating these variables in the script. That means, after the last relaod, these variables have not gotten any values assigned. Please check the logic in the script for these variables. Is there any date hard coded in the script?

Not applicable
Author

I have this script from Master calendar

MasterCalendar_ACCDB:

LOAD*,

  FiscalYear  & '/ W'  & FiscalWeek AS  FiscalYearWeek; 

LOAD*,

  YearStart(Date,0,7) AS FiscalYearStart,

  YearName(Date,0,7) AS FiscalYear,

  AUTONUMBER(Year(Date) & Week(Date)) AS FiscalWeekSerial,

  ROUND(num(([Date]+184-(MakeDate(Year(([Date]+184)-mod(([Date]-2),7)+3), 1, (mod(([Date]-2),7)+1) )-10))/7-0.5,'#,##0')) AS FiscalWeek,

  'Q' & CEIL(if(num(Month(Date))<7,num(Month(Date))+6,num(Month(Date))-6)/3) AS FiscalQuarter;

LOAD

  //DATE(FLOOR(Date),'DD/MM/YYYY') AS Date,  //removing floor for testing 12092012-neeraj

  Timestamp(Date) as Date_TS,

  Date#(Date(Date)) AS Date,

  IF(Date = Today(),1) AS Today,

  week(Date) AS Week,

  Year(Date) AS Year,

  Month(Date) AS Month,

  Day(Date) AS Day,

  WeekDay(Date) AS WeekDay,

  ApplyMap('QuarterMap', Num(Month(Date)), Null()) AS Quarter,

  Date(MonthStart(Date),'MMM-YYYY') AS MonthYear,

  Week(Date) & '-' & Year(Date) AS WeekYear,

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

  InYearToDate(Date, $(varToday), -1) * -1 AS LastYTDFlag;  

LOAD

  Date($(varMinDate) + RecNo() - 1) AS Date

AUTOGENERATE ($(varMaxDate) - $(varMinDate)+1);       

tresesco
MVP
MVP

How are the variables(varMaxDate, varMinDate, FiscalWeek and curFiscalWEeekSeq) defined?

Not applicable
Author

  This way I created

//--------------------------------------------------------------------------------------
// Generate Master Calendar
//--------------------------------------------------------------------------------------

TRACE Creating Master Calendar;

/* Load transaction TABLE to get earliest and latest dates */

MinMax:

LOAD Max(TIMESTAMP([Addition Date])) AS MaxDate,
Min(TIMESTAMP([Addition Date])) AS MinDate
FROM
[..\QVD_Closures\TblCase.qvd]
(
qvd);

// EXIT SCRIPT;
/* STORE earliest and latest dates in variables */

LET varMinDate = Num(Peek('MinDate', -1, 'MinMax'));
LET varMaxDate = Num(Peek('MaxDate', -1, 'MinMax'));

// EXIT SCRIPT;
/* STORE todays date in variable */

LET varToday = Num(Today());

/* Inline TABLE mapping months to quarters */

QuarterMap:
MAPPING LOAD * INLINE [
Month, Quarter
1, Q1
2, Q1
3, Q1
4, Q2
5, Q2
6, Q2
7, Q3
8, Q3
9, Q3
10, Q4
11, Q4
12, Q4
]
;


/* Autogenerate every date between varMinDate and varMaxDate while creating calendar fields */

//MasterCalendar_MDB:
MasterCalendar:

//MasterCalendar_forwhen:

LOAD*,
FiscalYear & '/ W' & FiscalWeek AS FiscalYearWeek;
LOAD*,
YearStart(Date,0,7) AS FiscalYearStart,
YearName(Date,0,7) AS FiscalYear,
AUTONUMBER(Year(Date) & Week(Date)) AS FiscalWeekSerial,
ROUND(num(([Date]+184-(MakeDate(Year(([Date]+184)-mod(([Date]-2),7)+3), 1, (mod(([Date]-2),7)+1) )-10))/7-0.5,'#,##0')) AS FiscalWeek,
'Q' &
CEIL(if(num(Month(Date))<7,num(Month(Date))+6,num(Month(Date))-6)/3) AS FiscalQuarter;
LOAD
//DATE(FLOOR(Date),'DD/MM/YYYY') AS Date, //removing floor for testing 12092012-neeraj
Timestamp(Date) as Date_TS,
Date#(Date(Date)) AS Date,
IF(Date = Today(),1) AS Today,
week(Date) AS Week,
Year(Date) AS Year,
Month(Date) AS Month,
Day(Date) AS Day,
WeekDay(Date) AS WeekDay,
ApplyMap('QuarterMap', Num(Month(Date)), Null()) AS Quarter,
Date(MonthStart(Date),'MMM-YYYY') AS MonthYear,
Week(Date) & '-' & Year(Date) AS WeekYear,
InYearToDate(Date, $(varToday), 0) * -1 AS CurYTDFlag,
InYearToDate(Date, $(varToday), -1) * -1 AS LastYTDFlag;
LOAD
Date($(varMinDate) + RecNo() - 1) AS Date
AUTOGENERATE ($(varMaxDate) - $(varMinDate)+1);

/* DROP Temporary TABLE */

DROP TABLE MinMax;


STORE MasterCalendar INTO D:\Qlikview\MasterCalendar.qvd;

DROP Table MasterCalendar;




//EXIT SCRIPT;

rajeshvaswani77
Specialist III
Specialist III

Why are you dropping and storing the master calender? You can comment the drop statement and leave it in the memory, not sure if you have to store this in the QVD?

thanks,

Rajesh Vaswani

tresesco
MVP
MVP

You wrote,

"Could you please let me a bit more clear as In the Variables Overview tab I am not able to see any values for FiscalWeek and curFiscalWEeekSeq".

I wanted to see definition of these variables in the script as well.

rajeshvaswani77
Specialist III
Specialist III

Please check Settings --> Variable Overview. you must be able to see all the variables declared here,

thanks,

Rajesh Vaswani