Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
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?
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);
How are the variables(varMaxDate, varMinDate, FiscalWeek and curFiscalWEeekSeq) defined?
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;
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
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.
Please check Settings --> Variable Overview. you must be able to see all the variables declared here,
thanks,
Rajesh Vaswani