Process failing periodically
Posted: Thu Sep 19, 2013 6:49 pm
I have a process that fails only periodically with the following error:
Error: Data procedure line (68): error repeats 15 times
"Agriculture","Australia","06-0300-AF SHEET","AUTOMOTIVE COMPONENTS LTD-06-CAUT501","BIRollup","Local","06","All Years","BIRollup","307.67",Data Source line (2) Error: Data procedure line (58): Element "AUTOMOTIVE COMPONENTS LTD-06-CAUT501" not found in dimension "Customer"
The log for the process is filled with similar errors. Here is what the process is doing:
ExportPath = 'D:\BI Extract\BIDailySalesTTM' | Y1 | '.txt';
#Get the current and previous year
#T1 = TODAY(0);
#Y1 = YEAR(T1);
#Y0 = YEAR(T1) - 1;
#Y1 = SUBST(SelectedYear,3,2);
#Y0 = NUMBERTOSTRING(StringToNumber(Y1) - 1);
#Because we did a time hierarchy (multiple years/periods), loop thru 12 month and get the necessary data for each month
m = 1;
while (m <= 12);
#Build the lookup period: MMM-YY
IF (m = 1);
LoadMonth = 'JAN-';
ELSEIF (m = 2);
LoadMonth = 'FEB-';
ELSEIF (m = 3);
LoadMonth = 'MAR-';
ELSEIF (m = 4);
LoadMonth = 'APR-';
ELSEIF (m = 5);
LoadMonth = 'MAY-';
ELSEIF (m = 6);
LoadMonth = 'JUN-';
ELSEIF (m = 7);
LoadMonth = 'JUL-';
ELSEIF (m = 8);
LoadMonth = 'AUG-';
ELSEIF (m = 9);
LoadMonth = 'SEP-';
ELSEIF (m = 10);
LoadMonth = 'OCT-';
ELSEIF (m = 11);
LoadMonth = 'NOV-';
ELSEIF (m = 12);
LoadMonth = 'DEC-';
EndIf;
PeriodCY = LoadMonth | Y1;
PeriodPY = LoadMonth | Y0;
#Get the dimension display values
CountryName = ATTRS('Country', Country, 'Standard Name');
CompanyName = ATTRS('Company', Company, 'Name');
ProductName = ATTRS('Product', Product, 'Corporate Revenue Account Mapping');
If (ProductName @= '');
ProductName = 'Other';
EndIf;
RegionName = ELPAR('Country', Country, 1);
CustomerName = ATTRS('Customer', Customer, 'Name Code');
If (ATTRS('Customer', Customer, 'Corporate Customer Group') @<> '');
CustomerName = ATTRS('Customer', Customer, 'Corporate Customer Group');
EndIf;
If (ATTRS('Customer', Customer, 'Entity Customer Group') @<> '');
CustomerName = ATTRS('Customer', Customer, 'Entity Customer Group');
EndIf;
#get the sales measure for this period for both Euros and local currency.
EurSales = CellgetN (CubeName, Industry, Country, Product, Customer, 'Actual', 'EUR', Company, PeriodCY, 'Ship Amt');
LocalSales = CellgetN (CubeName, Industry, Country, Product, Customer, 'Actual', 'Local', Company, PeriodCY, 'Ship Amt');
EurCost = CellgetN (CubeName, Industry, Country, Product, Customer, 'Actual', 'EUR', Company, PeriodCY, 'Total Shipment Costs');
LocalCost = CellgetN (CubeName, Industry, Country, Product, Customer, 'Actual', 'Local', Company, PeriodCY, 'Total Shipment Costs');
EurIntake = CellgetN (CubeName, Industry, Country, Product, Customer, 'Actual', 'EUR', Company, PeriodCY, 'Order Intake Amt');
LocalIntake = CellgetN (CubeName, Industry, Country, Product, Customer, 'Actual', 'Local', Company, PeriodCY, 'Order Intake Amt');
EurSalesPlan = CellgetN (CubeName, Industry, Country, Product, Customer, 'Final Plan Archive', 'EUR', Company, PeriodCY, 'Ship Amt');
LocalSalesPlan = CellgetN (CubeName, Industry, Country, Product, Customer, 'Final Plan Archive', 'Local', Company, PeriodCY, 'Ship Amt');
EurSalesForecast = CellgetN (CubeName, Industry, Country, Product, Customer, 'Forecast', 'EUR', Company, PeriodCY, 'Ship Amt');
LocalSalesForecast = CellgetN (CubeName, Industry, Country, Product, Customer, 'Forecast', 'Local', Company, PeriodCY, 'Ship Amt');
#Get the prior year sales, and the TTM amounts for this year and the prior year
EurSalesPY = CellgetN (CubeName, Industry, Country, Product, Customer, 'Actual', 'EUR', Company, PeriodPY, 'Ship Amt');
LocalSalesPY = CellgetN (CubeName, Industry, Country, Product, Customer, 'Actual', 'Local', Company, PeriodPY, 'Ship Amt');
EurSalesCYTTM = CellgetN (CubeName, Industry, Country, Product, Customer, 'Actual', 'EUR', Company, PeriodCY|'TTM', 'Ship Amt');
LocalSalesCYTTM = CellgetN (CubeName, Industry, Country, Product, Customer, 'Actual', 'Local', Company, PeriodCY|'TTM', 'Ship Amt');
EurSalesPYTTM = CellgetN (CubeName, Industry, Country, Product, Customer, 'Actual', 'EUR', Company, PeriodPY|'TTM', 'Ship Amt');
LocalSalesPYTTM = CellgetN (CubeName, Industry, Country, Product, Customer, 'Actual', 'Local', Company, PeriodPY|'TTM', 'Ship Amt');
#skip if all amounts are zero
IF (EurSales <> 0 % EurSalesPY <> 0 % EurSalesCYTTM <> 0 % EurSalesPYTTM <> 0 % EurSalesPlan <> 0 % EurIntake <> 0 % EurSalesForecast <> 0);
ASCIIOUTPUT(
ExportPath,
Y1,
CompanyName,
CustomerName,
Customer,
Industry,
ProductName,
Product,
CountryName,
RegionName,
PeriodCY,
NUMBERTOSTRING(EurSales),
NUMBERTOSTRING(LocalSales),
NUMBERTOSTRING(EurIntake),
NUMBERTOSTRING(LocalIntake),
NUMBERTOSTRING(EurCost),
NUMBERTOSTRING(LocalCost),
NUMBERTOSTRING(EurSalesPlan),
NUMBERTOSTRING(LocalSalesPlan),
NUMBERTOSTRING(EurSalesForecast),
NUMBERTOSTRING(LocalSalesForecast),
NUMBERTOSTRING(EurSalesPY),
NUMBERTOSTRING(LocalSalesPY),
NUMBERTOSTRING(EurSalesCYTTM),
NUMBERTOSTRING(LocalSalesCYTTM),
NUMBERTOSTRING(EurSalesPYTTM),
NUMBERTOSTRING(LocalSalesPYTTM)
);
ENDIF;
m = m + 1;
END;
My suspicion is that one of the other processes is causing the error. We have another process which Zeros out the cube that is used as a datasource in the process that is failing.
Error: Data procedure line (68): error repeats 15 times
"Agriculture","Australia","06-0300-AF SHEET","AUTOMOTIVE COMPONENTS LTD-06-CAUT501","BIRollup","Local","06","All Years","BIRollup","307.67",Data Source line (2) Error: Data procedure line (58): Element "AUTOMOTIVE COMPONENTS LTD-06-CAUT501" not found in dimension "Customer"
The log for the process is filled with similar errors. Here is what the process is doing:
ExportPath = 'D:\BI Extract\BIDailySalesTTM' | Y1 | '.txt';
#Get the current and previous year
#T1 = TODAY(0);
#Y1 = YEAR(T1);
#Y0 = YEAR(T1) - 1;
#Y1 = SUBST(SelectedYear,3,2);
#Y0 = NUMBERTOSTRING(StringToNumber(Y1) - 1);
#Because we did a time hierarchy (multiple years/periods), loop thru 12 month and get the necessary data for each month
m = 1;
while (m <= 12);
#Build the lookup period: MMM-YY
IF (m = 1);
LoadMonth = 'JAN-';
ELSEIF (m = 2);
LoadMonth = 'FEB-';
ELSEIF (m = 3);
LoadMonth = 'MAR-';
ELSEIF (m = 4);
LoadMonth = 'APR-';
ELSEIF (m = 5);
LoadMonth = 'MAY-';
ELSEIF (m = 6);
LoadMonth = 'JUN-';
ELSEIF (m = 7);
LoadMonth = 'JUL-';
ELSEIF (m = 8);
LoadMonth = 'AUG-';
ELSEIF (m = 9);
LoadMonth = 'SEP-';
ELSEIF (m = 10);
LoadMonth = 'OCT-';
ELSEIF (m = 11);
LoadMonth = 'NOV-';
ELSEIF (m = 12);
LoadMonth = 'DEC-';
EndIf;
PeriodCY = LoadMonth | Y1;
PeriodPY = LoadMonth | Y0;
#Get the dimension display values
CountryName = ATTRS('Country', Country, 'Standard Name');
CompanyName = ATTRS('Company', Company, 'Name');
ProductName = ATTRS('Product', Product, 'Corporate Revenue Account Mapping');
If (ProductName @= '');
ProductName = 'Other';
EndIf;
RegionName = ELPAR('Country', Country, 1);
CustomerName = ATTRS('Customer', Customer, 'Name Code');
If (ATTRS('Customer', Customer, 'Corporate Customer Group') @<> '');
CustomerName = ATTRS('Customer', Customer, 'Corporate Customer Group');
EndIf;
If (ATTRS('Customer', Customer, 'Entity Customer Group') @<> '');
CustomerName = ATTRS('Customer', Customer, 'Entity Customer Group');
EndIf;
#get the sales measure for this period for both Euros and local currency.
EurSales = CellgetN (CubeName, Industry, Country, Product, Customer, 'Actual', 'EUR', Company, PeriodCY, 'Ship Amt');
LocalSales = CellgetN (CubeName, Industry, Country, Product, Customer, 'Actual', 'Local', Company, PeriodCY, 'Ship Amt');
EurCost = CellgetN (CubeName, Industry, Country, Product, Customer, 'Actual', 'EUR', Company, PeriodCY, 'Total Shipment Costs');
LocalCost = CellgetN (CubeName, Industry, Country, Product, Customer, 'Actual', 'Local', Company, PeriodCY, 'Total Shipment Costs');
EurIntake = CellgetN (CubeName, Industry, Country, Product, Customer, 'Actual', 'EUR', Company, PeriodCY, 'Order Intake Amt');
LocalIntake = CellgetN (CubeName, Industry, Country, Product, Customer, 'Actual', 'Local', Company, PeriodCY, 'Order Intake Amt');
EurSalesPlan = CellgetN (CubeName, Industry, Country, Product, Customer, 'Final Plan Archive', 'EUR', Company, PeriodCY, 'Ship Amt');
LocalSalesPlan = CellgetN (CubeName, Industry, Country, Product, Customer, 'Final Plan Archive', 'Local', Company, PeriodCY, 'Ship Amt');
EurSalesForecast = CellgetN (CubeName, Industry, Country, Product, Customer, 'Forecast', 'EUR', Company, PeriodCY, 'Ship Amt');
LocalSalesForecast = CellgetN (CubeName, Industry, Country, Product, Customer, 'Forecast', 'Local', Company, PeriodCY, 'Ship Amt');
#Get the prior year sales, and the TTM amounts for this year and the prior year
EurSalesPY = CellgetN (CubeName, Industry, Country, Product, Customer, 'Actual', 'EUR', Company, PeriodPY, 'Ship Amt');
LocalSalesPY = CellgetN (CubeName, Industry, Country, Product, Customer, 'Actual', 'Local', Company, PeriodPY, 'Ship Amt');
EurSalesCYTTM = CellgetN (CubeName, Industry, Country, Product, Customer, 'Actual', 'EUR', Company, PeriodCY|'TTM', 'Ship Amt');
LocalSalesCYTTM = CellgetN (CubeName, Industry, Country, Product, Customer, 'Actual', 'Local', Company, PeriodCY|'TTM', 'Ship Amt');
EurSalesPYTTM = CellgetN (CubeName, Industry, Country, Product, Customer, 'Actual', 'EUR', Company, PeriodPY|'TTM', 'Ship Amt');
LocalSalesPYTTM = CellgetN (CubeName, Industry, Country, Product, Customer, 'Actual', 'Local', Company, PeriodPY|'TTM', 'Ship Amt');
#skip if all amounts are zero
IF (EurSales <> 0 % EurSalesPY <> 0 % EurSalesCYTTM <> 0 % EurSalesPYTTM <> 0 % EurSalesPlan <> 0 % EurIntake <> 0 % EurSalesForecast <> 0);
ASCIIOUTPUT(
ExportPath,
Y1,
CompanyName,
CustomerName,
Customer,
Industry,
ProductName,
Product,
CountryName,
RegionName,
PeriodCY,
NUMBERTOSTRING(EurSales),
NUMBERTOSTRING(LocalSales),
NUMBERTOSTRING(EurIntake),
NUMBERTOSTRING(LocalIntake),
NUMBERTOSTRING(EurCost),
NUMBERTOSTRING(LocalCost),
NUMBERTOSTRING(EurSalesPlan),
NUMBERTOSTRING(LocalSalesPlan),
NUMBERTOSTRING(EurSalesForecast),
NUMBERTOSTRING(LocalSalesForecast),
NUMBERTOSTRING(EurSalesPY),
NUMBERTOSTRING(LocalSalesPY),
NUMBERTOSTRING(EurSalesCYTTM),
NUMBERTOSTRING(LocalSalesCYTTM),
NUMBERTOSTRING(EurSalesPYTTM),
NUMBERTOSTRING(LocalSalesPYTTM)
);
ENDIF;
m = m + 1;
END;
My suspicion is that one of the other processes is causing the error. We have another process which Zeros out the cube that is used as a datasource in the process that is failing.