COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: f-pasquier on 13 Feb 2014 05:03:22 AM

Title: Calculated "property" with dimensional source
Post by: f-pasquier on 13 Feb 2014 05:03:22 AM
Hi all,

I try to create a calculated "column" in a query, which is just a member property concatenated with a string.
Example
I would like the column to be    'YTD'||[BL_LogiQual].[Suppliers].[Suppliers].[ShortName]
The member property ShortName is of type "Character (String)"
In the toolbox, under Query Calculation, I tried both Calculated Member and "other expression", but I get the error:
xqe-pln-0075:  The context for the arithmetic operator '||' is invalid. Current value is 'YTD', a numeric value is required.
any idea?

Title: Re: Calculated "property" with dimensional source
Post by: MFGF on 13 Feb 2014 05:29:57 AM
Maybe you can try + instead of ||

MF.
Title: Re: Calculated "property" with dimensional source
Post by: f-pasquier on 13 Feb 2014 05:52:09 AM
I think Cognos treats + exactly as || cause when I replace || by +, then the error message remains the same.
Title: Re: Calculated "property" with dimensional source
Post by: CognosPaul on 13 Feb 2014 09:07:52 AM
You can't do any string calculations on a dimensional query. No concatenations, substrings, trims, and so on. There are tricks you can do. Can you explain what you're trying to achieve?
Title: Re: Calculated "property" with dimensional source
Post by: f-pasquier on 13 Feb 2014 09:14:45 AM
Actually, I have a property that tells the "short name" of a brand. For example, if the element name is element name is Rolls-Royce, the short name would be RR.
And in a chart, I would like to have labels that say for example "Total of RR". So my idea was to use the Supplier "short name" and concatenate "Total of ", and then display in my chart this new calculated item. So you see what I mean?
Title: Re: Calculated "property" with dimensional source
Post by: CognosPaul on 13 Feb 2014 03:50:20 PM
The nodes in the charts have a text source property. Change that to report expression and do the concatenation there.