Hi All,
I was trying to process out of the box Production order cube, and getting this conversion error. When I pasted the SQL query which was producing this error in SQL management studio, I am able to reproduce the same error, then I select each column one by one in query window and found the same error when I used the following select statement:
select DaysDelayed from ProdTableExpanded.
DaysDelayed is a computed column in View ProdTableExpanded. After 134 rows, this error occurred and further rows were not returned.The code for computed column is shown below:
public static server str daysDelayed()
{
TableName viewName = identifierStr(ProdTableExpanded);
str dlvDate = SysComputedColumn::comparisonField(viewName, identifierStr(ProdTable),fieldStr(ProdTable, DlvDate));
str finishedDate = SysComputedColumn::comparisonField(viewName, identifierStr(ProdTable),fieldStr(ProdTable, FinishedDate));
str todayDate = SysComputedColumn::comparisonLiteral(date2StrUsr(today(), DateFlags::None));
str prodStatusField = SysComputedColumn::returnField(viewName, identifierStr(ProdTable),fieldStr(ProdTable, ProdStatus));
Map comparisonExpressionMap = SysComputedColumn::comparisionExpressionMap();
comparisonExpressionMap.insert(
SysComputedColumn::and2
(
SysComputedColumn::notEqualExpression(prodStatusField, SysComputedColumn::returnLiteral(5)),
SysComputedColumn::notEqualExpression(prodStatusField, SysComputedColumn::returnLiteral(7))
),
SysComputedColumn::getDateDiffWithFallbackToZero(dlvDate, todayDate)
);
return SysComputedColumn::switch('',
comparisonExpressionMap,
SysComputedColumn::getDateDiffWithFallbackToZero(dlvDate, finishedDate));
}
Does anyone have any idea how to fix this issue? I am really stuck in this issue and out of ideas.