COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: Rosanero4Ever on 21 Apr 2015 02:40:28 AM

Title: Custom sort dimension members in a report
Post by: Rosanero4Ever on 21 Apr 2015 02:40:28 AM
Hi all,

i have a simple crosstab having customers in rows and centers of cost in column.
The source is an OLAP cube created with Transformer.
I would like customize sorting of centers of cost (in columns)
For example, if my columns members are A, B, C, D, E
i would like a disposition like
A, B, C, E, D (E before D)
In a relational source, I usually create an item as follows:

if ([center of cost] = 'D')
then ('z')
else ([center of cost])


and I after  use this item in order to sort the columns.

How can I handle a similar sort in a OLAP source?
Many thanks in advance
Title: Re: Custom sort dimension members in a report
Post by: bdbits on 21 Apr 2015 09:46:09 AM
You can do use the same technique with a cube data source. I just verified it for myself in Report Studio, using a calculated query item in Edit Layout Sorting.

What is not working for you?
Title: Re: Custom sort dimension members in a report
Post by: Rosanero4Ever on 21 Apr 2015 09:52:43 AM
Hi,

using the same technique the following message is displayed:

QE-DEF-0478 Invalid coercion from 'level' to 'string'

So, I used the statement
if (caption([MyCube].[CenterOfCosts].[CenterOfCosts].[CenterOfCost])='D') then ('z') else (caption([MyCube].[CenterOfCosts].[CenterOfCosts].[CenterOfCost])

but I didn't solve the issue  :(

Title: Re: Custom sort dimension members in a report
Post by: bdbits on 21 Apr 2015 10:54:35 AM
Yeah I don't know what I was thinking, my 'test' was oversimplified since it referenced set members - you need a set for dimensional.

I had not had my morning caffeine yet, that is my story.  8)

This should still be doable, you just have to use some dimensional functions. If nobody beats me to the solution, I will try to get back to this later today.