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

Cognos set expression based on condition

Started by twister, 13 Jan 2014 11:00:00 AM

Previous topic - Next topic

twister

Hi All,
I have a requirement to use set expression based on condition. Is this possible?

For example, if (caption([selected_value])='A') then (set(C,D))
else (set(E,F))

It is throwing error. ANy guidance?

MFGF

Quote from: twister on 13 Jan 2014 11:00:00 AM
It is throwing error. ANy guidance?

...and the error is?????? :)

If I had to guess I'd wager that it is saying your condition needs to return a single item? You could perhaps try adding query items for each of the two sets, and referring to these in your expression? I'm guessing, though. Until you tell us what the error is that's all anyone will be able to do...

MF.
Meep!

twister

Sorry mate. The error is,

XQE-PLN-0093

The query is not supported. The argument at position 2 of 'if' from the data item 'Region or Country' cannot be coerced into a 'Value' expression.

Thanks.

twister

This is DQM and I have put the set expressions as data items and referring the data items in the condition.

MFGF

Oh ok - a coercion error. What is [selected_value] defined as? According to your expression it should be a level or a member or a set. What is it actually?

Cheers!

MF.
Meep!

twister

if (caption([BI_Reporting].[BI_Store].[BI_Store] -> ?pStore?)='aaaa')
then ([DATAITEM_SET1])
ELSE ([DATAITEM_SET2])

twister

Long time but ended with the same problem...This is disallowed in DQM. I get a coercion error when I use the following in DQM.
if (caption([BI_Reporting].[BI_Store].[BI_Store] -> ?pStore?)='aaaa')
then ([DATAITEM_SET1])
ELSE ([DATAITEM_SET2])

This is working fine with CQM. For DQM, I am planning to have 2 dataitems (one for assigning text and the second one to pickup the value of the first text using macro).  However, struggling with the second data item with the macro.

The first dataitem will look something like this,
if (caption([BI_Reporting].[BI_Store].[BI_Store] -> ?pStore?)='aaaa')
then ('DATAITEM_SET1')
ELSE ('DATAITEM_SET2')

the second dataitem would be like #sb('DATAITEM1')#...Any help would be much appreciated?

twister

Any idea COgnos Paul? Basically I want to pass dataitem inside a macro. Is this possible?

#sb('DATAITEM1')#