If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Parameter Expression

Started by zaib, 17 Oct 2013 11:41:06 AM

Previous topic - Next topic

zaib

When I use following expression in a query item
#'[GOSALES].[COUNTRY].[COUNTRY_' + $Language_Lookup{$runLocale} + ']' #

Report Studio throws error

RQP-DEF-0058

             Unable to resolve the expression '#'[GOSALES].[SALES_REGION].[SALES_REGION_' +$Language_Lookup{$runLocale} +']' #' in the object '[Transformation View].[Sales Staff].[Sales Region]'.

Is anything wrong with my expression? It tests fine when I test it from calculation definition window in FrameWork.

MFGF

I know it's an obvious question, but I will ask anyway :)

Do you have a Parameter Map called Language_Lookup defined? It's not by any chance called Language_lookup is it?

MF.
Meep!

zaib

yes Language_Lookup parameter maps is defined.


zaib

Attachment shows it working in FM and error in RS.

CognosPaul

First question: Since you made the parameter map, have you republished the model?

Second, are there any other parts of the expression?

In a new query, try running:

#sq('[GOSALES].[COUNTRY].[COUNTRY_' + $Language_Lookup{$runLocale} + ']')#
That should return the expression as a string. If that doesn't work, then there are more serious issues.

Try running

#sq($Language_Lookup{$runLocale} ) #

Try also running
#sq($Language_Lookup{%runLocale} ) #

(Off the top of my head, I can't remember exactly when you need the percent sign)

Next, try
#sb('GOSALES].[COUNTRY].[COUNTRY_' + $Language_Lookup{$runLocale}))#

zaib

First question: Since you made the parameter map, have you republished the model?
Yes I republished the model

Second, are there any other parts of the expression?
No I copied the whole Expression

In a new query, try running:

#sq('[GOSALES].[COUNTRY].[COUNTRY_' + $Language_Lookup{$runLocale} + ']')#
That should return the expression as a string. If that doesn't work, then there are more serious issues.
Yes Return [GOSALES].[COUNTRY].[COUNTRY_EN]

Try running

#sq($Language_Lookup{$runLocale} ) #
yes return EN

Try also running
#sq($Language_Lookup{%runLocale} ) #

(Off the top of my head, I can't remember exactly when you need the percent sign)

Nothing is returned with %

Next, try
#sb('[GOSALES].[COUNTRY].[COUNTRY_' + $Language_Lookup{$runLocale}))#

Parsing error
QE-DEF-0260 Parsing error before or near position: 69 of: "#sb('[GOSALES].[COUNTRY].[COUNTRY_' + $Language_Lookup{$runLocale}))"



CognosPaul

I put too many closing parens in the last expression, it should just be #sb('[GOSALES].[COUNTRY].[COUNTRY_' + $Language_Lookup{$runLocale})#


zaib

Expression
#sb('[GOSALES].[COUNTRY].[COUNTRY_' + $Language_Lookup{$runLocale})#

Here is what I get

[[GOSALES]].[COUNTRY]].[COUNTRY_EN]



QE-DEF-0030 Expression parsing error.
QE-DEF-0359 The query contains a reference to at least one object '[[GOSALES]].[COUNTRY]].[COUNTRY_EN]' that does not exist.


[[GOSALES]].[COUNTRY]].[COUNTRY_EN]

CognosPaul

hmm, annoying that it's doing that to the country. how about:


#'[GOSALES].[COUNTRY].[COUNTRY_' + sb($Language_Lookup{$runLocale})#
or
[GOSALES].[COUNTRY].[COUNTRY_#sb($Language_Lookup{$runLocale})#

zaib

Expression
#'[GOSALES].[COUNTRY].[COUNTRY_' + sb($Language_Lookup{$runLocale})#

Here is what I get

[GOSALES].[COUNTRY].[COUNTRY_[EN]



QE-DEF-0030 Expression parsing error.
QE-DEF-0359 The query contains a reference to at least one object '[GOSALES].[COUNTRY].[COUNTRY_[EN]' that does not exist.


[GOSALES].[COUNTRY].[COUNTRY_[EN]



Expression
[GOSALES].[COUNTRY].[COUNTRY_#sb($Language_Lookup{$runLocale})#

This is what I get

QE-DEF-0260 Parsing error before or near position: 64 of: "[GOSALES].[COUNTRY].[COUNTRY_#sb($Language_Lookup{$runLocale})#"

zaib

Attaching the screen shot of parameter map... may be helpful

CognosPaul

Remind me not to try to find solutions late at night.

The reason that it's failing is sb is wrapping the EN in brackets, when it should wrap the segment:

#'[GOSALES].[COUNTRY].' + sb('COUNTRY_' + $Language_Lookup{$runLocale})#
or
[GOSALES].[COUNTRY].+#sb('COUNTRY_' + $Language_Lookup{$runLocale})#


zaib

Running this expression #'[GOSALES].[COUNTRY].' + sb('COUNTRY_' + $Language_Lookup{$runLocale})#

Returns

QE-DEF-0030

             Expression parsing error.

         Details

QE-DEF-0359 The query contains a reference to at least one object '[GOSALES].[COUNTRY].[COUNTRY_]' that does not exist.RSV-SRV-0042 Trace back:RSReportService.cpp(826): QFException: CCL_CAUGHT: RSReportService::process()RSReportServiceMethod.cpp(259): QFException: CCL_RETHROW: RSReportServiceMethod::process(): asynchRunSpecification_RequestRSASyncExecutionThread.cpp(789): QFException: RSASyncExecutionThread::checkExceptionRSASyncExecutionThread.cpp(250): QFException: CCL_CAUGHT: RSASyncExecutionThread::runImpl(): asynchRunSpecification_RequestRSASyncExecutionThread.cpp(842): QFException: CCL_RETHROW: RSASyncExecutionThread::processCommand(): asynchRunSpecification_RequestExecution/RSRenderExecution.cpp(616): QFException: CCL_RETHROW: RSRenderExecution::executeAssembly/RSDocAssemblyDispatch.cpp(289): QFException: CCL_RETHROW: RSDocAssemblyDispatch::dispatchAssemblyAssembly/RSLayoutAssembly.cpp(79): QFException: CCL_RETHROW: RSLayoutAssembly::assembleAssembly/RSDocAssemblyDispatch.cpp(356): QFException: CCL_RETHROW: RSDocAssemblyDispatch::dispatchChildrenAssemblyForwardAssembly/RSReportPagesAssembly.cpp(179): QFException: CCL_RETHROW: RSReportPagesAssembly::assembleAssembly/RSDocAssemblyDispatch.cpp(306): QFException: CCL_RETHROW: RSDocAssemblyDispatch::dispatchAssemblyAssembly/RSPageAssembly.cpp(303): QFException: CCL_RETHROW: RSPageAssembly::assembleAssembly/RSDocAssemblyDispatch.cpp(306): QFException: CCL_RETHROW: RSDocAssemblyDispatch::dispatchAssemblyAssembly/RSTableRowAssembly.cpp(175): QFException: CCL_RETHROW: RSTableRowAssembly::assembleAssembly/RSDocAssemblyDispatch.cpp(306): QFException: CCL_RETHROW: RSDocAssemblyDispatch::dispatchAssemblyAssembly/RSTableCellAssembly.cpp(137): QFException: CCL_RETHROW: RSTableCellAssembly::assembleAssembly/RSDocAssemblyDispatch.cpp(356): QFException: CCL_RETHROW: RSDocAssemblyDispatch::dispatchChildrenAssemblyForwardRSQueryMgr.cpp(1164): QFException: CCL_RETHROW: RSQueryMgr::getResultSetIteratorRSQueryMgr.cpp(1324): QFException: CCL_RETHROW: RSQueryMgr::createIteratorRSQueryMgr.cpp(1624): QFException: CCL_RETHROW: RSQueryMgr::executeRsapiCommandRSQueryMgr.cpp(1614): QFException: CCL_RETHROW: RSQueryMgr::executeRsapiCommandRSQueryMgrExecutionHandlerImpl.cpp(189): QFException: CCL_RETHROW: RSQueryMgrExecutionHandlerImpl::execute()RSQueryMgrExecutionHandlerImpl.cpp(173): QFException: CCL_RETHROW: RSQueryMgrExecutionHandlerImpl::execute()QFSSession.cpp(1066): QFException: CCL_RETHROW: QFSSession::ProcessDoRequest()QFSSession.cpp(1064): QFException: CCL_CAUGHT: QFSSession::ProcessDoRequest()QFSSession.cpp(1021): QFException: CCL_RETHROW: QFSSession::ProcessDoRequest()QFSSession.cpp(997): QFException: CCL_RETHROW: QFSSession::ProcessDoRequest()QFSConnection.cpp(788): QFException: CCL_RETHROW: QFSConnection::ExecuteQFSQuery.cpp(213): QFException: CCL_RETHROW: QFSQuery::Execute v2CoordinationQFSQuery.cpp(4452): QFException: CCL_THROW: CoordinationPlanner





Running this expression [GOSALES].[COUNTRY].+#sb('COUNTRY_' + $Language_Lookup{$runLocale})#

Returns


[GOSALES].[COUNTRY].+[COUNTRY_EN]



QE-DEF-0260 Parsing error before or near position: 22 of: "[GOSALES].[COUNTRY].+"


[COUNTRY_EN]

CognosPaul

[GOSALES].[COUNTRY].#sb('COUNTRY_' + $Language_Lookup{$runLocale})#


According to the first parsing error, the language lookup isn't returning a value when it's being concatenated with 'COUNTRY_', does your parameter map have a default value?

zaib

CognosPaul   8) you are a genius....... Parameter map did not have a default value. Once I set a default value it worked.