COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: SCI Guy on 12 Apr 2016 09:29:15 AM

Title: Time Interval Issue in Charts
Post by: SCI Guy on 12 Apr 2016 09:29:15 AM
I'm using Report Studio 10 and I can get a list to produce expected output.   Which is average time interval for each day.  However, when I try to make a chart from the same query, the output seems to always be in milliseconds, regardless of the data format that I choose (see attached image).

How do I get it to show the value as the number of hours instead of milliseconds (and yes, it's already formatted as time interval)

Title: Re: Time Interval Issue in Charts
Post by: Lynn on 13 Apr 2016 07:13:35 AM
I vaguely recall having that issue before. I think I did a cast of the interval to integer and then divided to convert the result to hours.
Title: Re: Time Interval Issue in Charts
Post by: SCI Guy on 13 Apr 2016 07:59:45 AM
Thanks Lynn.

I'm having issues with the cast function in cognos (could be because I'm a newbie).

cast(([Putaway End] - [CheckIn DTTM]), integer)

That function validates but returns error message

UDA-SQL-0114 The cursor supplied to the operation "sqlOpenResult" is inactive.UDA-SQL-0144 An arithmetic exception was detected.UDA-EE-0106 A day-time/year-month interval value that contains only a single primary datetime field is required.UDA-SQL-0460 A general exception has occurred during local processing.RSV-SRV-0042 Trace back:RSReportService.cpp(722): QFException: CCL_CAUGHT: RSReportService::process()RSReportServiceMethod.cpp(263): QFException: CCL_RETHROW: RSReportServiceMethod::process(): asynchRunSpecification_RequestRSASyncExecutionThread.cpp(808): QFException: RSASyncExecutionThread::checkExceptionRSASyncExecutionThread.cpp(260): QFException: CCL_CAUGHT: RSASyncExecutionThread::runImpl(): asynchRunSpecification_RequestRSASyncExecutionThread.cpp(864): QFException: CCL_RETHROW: RSASyncExecutionThread::processCommand(): asynchRunSpecification_RequestExecution/RSRenderExecution.cpp(670): QFException: CCL_RETHROW: RSRenderExecution::executeAssembly/RSDocAssemblyDispatch.cpp(292): QFException: CCL_RETHROW: RSDocAssemblyDispatch::dispatchAssemblyAssembly/RSLayoutAssembly.cpp(79): QFException: CCL_RETHROW: RSLayoutAssembly::assembleAssembly/RSDocAssemblyDispatch.cpp(359): QFException: CCL_RETHROW: RSDocAssemblyDispatch::dispatchChildrenAssemblyForwardAssembly/RSReportPagesAssembly.cpp(179): QFException: CCL_RETHROW: RSReportPagesAssembly::assembleAssembly/RSDocAssemblyDispatch.cpp(309): QFException: CCL_RETHROW: RSDocAssemblyDispatch::dispatchAssemblyAssembly/RSPageAssembly.cpp(303): QFException: CCL_RETHROW: RSPageAssembly::assembleAssembly/RSDocAssemblyDispatch.cpp(309): QFException: CCL_RETHROW: RSDocAssemblyDispatch::dispatchAssemblyAssembly/RSTableRowAssembly.cpp(177): QFException: CCL_RETHROW: RSTableRowAssembly::assembleAssembly/RSDocAssemblyDispatch.cpp(309): QFException: CCL_RETHROW: RSDocAssemblyDispatch::dispatchAssemblyAssembly/RSTableCellAssembly.cpp(137): QFException: CCL_RETHROW: RSTableCellAssembly::assembleAssembly/RSDocAssemblyDispatch.cpp(359): QFException: CCL_RETHROW: RSDocAssemblyDispatch::dispatchChildrenAssemblyForwardAssembly/RSTableAssembly.cpp(119): QFException: CCL_RETHROW: RSTableAssembly::assembleAssembly/RSDocAssemblyDispatch.cpp(359): QFException: CCL_RETHROW: RSDocAssemblyDispatch::dispatchChildrenAssemblyForwardAssembly/RSTableRowAssembly.cpp(177): QFException: CCL_RETHROW: RSTableRowAssembly::assembleAssembly/RSDocAssemblyDispatch.cpp(309): QFException: CCL_RETHROW: RSDocAssemblyDispatch::dispatchAssemblyAssembly/RSTableCellAssembly.cpp(137): QFException: CCL_RETHROW: RSTableCellAssembly::assembleAssembly/RSDocAssemblyDispatch.cpp(359): QFException: CCL_RETHROW: RSDocAssemblyDispatch::dispatchChildrenAssemblyForwardAssembly/RSDocAssemblyDispatch.cpp(309): QFException: CCL_RETHROW: RSDocAssemblyDispatch::dispatchAssemblyAssembly/RSAssembly.cpp(662): QFException: CCL_RETHROW: RSAssembly::createListIteratorAssembly/RSAssembly.cpp(717): QFException: CCL_RETHROW: RSAssembly::createListIteratorRSQueryMgr.cpp(1055): QFException: CCL_RETHROW: RSQueryMgr::getListIteratorRSQueryMgr.cpp(1131): QFException: CCL_RETHROW: RSQueryMgr::getResultSetIteratorRSQueryMgr.cpp(1295): QFException: CCL_RETHROW: RSQueryMgr::createIteratorRSQueryMgr.cpp(1569): QFException: CCL_RETHROW: RSQueryMgr::executeRsapiCommandRSQueryMgr.cpp(1559): QFException: CCL_RETHROW: RSQueryMgr::executeRsapiCommandRSQueryMgrExecutionHandlerImpl.cpp(168): QFException: CCL_RETHROW: RSQueryMgrExecutionHandlerImpl::execute()RSQueryMgrExecutionHandlerImpl.cpp(160): QFException: CCL_RETHROW: RSQueryMgrExecutionHandlerImpl::execute()QFSSession.cpp(1147): QFException: CCL_RETHROW: QFSSession::ProcessDoRequest()QFSSession.cpp(1145): QFException: CCL_CAUGHT: QFSSession::ProcessDoRequest()QFSSession.cpp(1102): QFException: CCL_RETHROW: QFSSession::ProcessDoRequest()QFSSession.cpp(1078): QFException: CCL_RETHROW: QFSSession::ProcessDoRequest()QFSConnection.cpp(788): QFException: CCL_RETHROW: QFSConnection::ExecuteQFSQuery.cpp(213): QFException: CCL_RETHROW: QFSQuery::Execute v2CoordinationQFSQuery.cpp(4456): QFException: CCL_THROW: CoordinationPlanner
Title: Re: Time Interval Issue in Charts
Post by: MacProTX on 04 Mar 2021 04:35:34 PM
I realize this is a very old thread, but a search led me here, because I had the identical series of errors.

My DB vendor is Oracle.

I had also tried cast([DateTime1] - [DateTime2]), integer), which is what appears to have generated the arithmetic error.

The solution seems to be, instead of cast, using extract: extract(day, [DateTime1] - [DateTime2]). This allowed my query to process without errors.