COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: srini1226 on 14 May 2013 09:55:37 AM

Title: Text Values in Cross Tab Facts
Post by: srini1226 on 14 May 2013 09:55:37 AM
Hi Friends , I  have requirement that we need to show Text value in cross tab cells.I can not use true or false condition because Text value is coming from data Item.

Please see the attached file.
(//)

Thank you,

Nivas
Title: Re: Text Values in Cross Tab Facts
Post by: iBoy on 15 May 2013 07:52:09 AM
Hey Nivas!

Crosstabs are not built to show text values, as cross-tabs deal in summary data.  So essentially, crosstabs only understand numbers.  If you try to get text coming out of the crosstab you will receive values like this "--" as it doesn't recognise text.

However, you can still do what you want, but the above is good to bear in mind if you have future requirements.

Step 1
You need to assign a code for all the possible text outputs you'll have.  So add an extra column in your database alongside the Product Value column.  And assign a unique number, they cannot overlap, so for Bulb assign it the value 1, for Shirt give it the value 2, etc.  This allows us to output  the numeric value into the crosstab, which it will recognise.

Step 2
You need to unlock the padlock on your report developer screen, and select the cells you expect text values to output in.

Step 3
Drop a text box in these cells, make the text source a "Report Expression" and write a case statement along these lines:

CASE

WHEN cellValue() = 1 THEN 'Bulb'
WHEN cellValue() = 2 THEN 'Shirt' (etc)

END


And that will provide you a cross tab with text values you expect.

iBoy
Title: Re: Text Values in Cross Tab Facts
Post by: srini1226 on 15 May 2013 10:05:56 AM
Hi,
Thank you for your reply.Unfortunately we can not use that logic because data is not static.We don't know what kind of data we get to show in cell.We contacted IBM and said same.
I am planing to show the data in different layout.
But Trying to give CROSS TAB look.
Thank you,
Nivas