COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: alex_ on 30 Nov 2012 12:05:37 PM

Title: How can I show some rows in percentages and others in decimal
Post by: alex_ on 30 Nov 2012 12:05:37 PM
Hi all, I have this urgent problem.

I'm using the relational model.

In a table I have column with metrics and another column with quantities.
for example:


METRICS|                     QUANTITIES
DISPUTE_CYCLE_TIME|47.38
OTD_TOTAL_IN_TIME  |0.67
OTD_CHW_IN_TIME    |0.80

CVA-T                          |20.6
The problem is that the quantities for each metric to be displayed in different formats.
Some of quantities should to be displayed in percentages and others in decimal.



METRICS|QUANTITIES
DISPUTE_CYCLE_TIME|47.38
OTD_TOTAL_IN_TIME  |67%
OTD_CHW_IN_TIME    |80%

CVA-T                          |20.6
Do you have any idea how this can be done in Framework Manager.

Thanks.
Title: Re: How can I show some rows in percentages and others in decimal
Post by: blom0344 on 02 Dec 2012 03:10:52 PM
Nothing to do with FM, but you can easily achieve this in Report Studio by using a crosstab and nesting the defined measures under each other. This allows for formatting each measure..
Title: Re: How can I show some rows in percentages and others in decimal
Post by: alex_ on 02 Dec 2012 05:15:57 PM
Thanks for the idea,

but the problem is that they are in one cell. All Metrics are in one cell and the all Quantities are in one cell.



|Metrics|Quantities|

Of a photo is understands much better.

Regards.
Title: Re: How can I show some rows in percentages and others in decimal
Post by: blom0344 on 03 Dec 2012 02:00:27 AM
Which is why you need to rebuild so you apply different formats to different cells. Same cell = same applied format
Title: Re: How can I show some rows in percentages and others in decimal
Post by: Bark on 03 Dec 2012 03:41:55 AM
What about appliying a conditional format based on a variable? The variable can use the name of the metric to define the format. I am asking and not stating because I'm not sure it works fine in a crosstab but it's worth a try :).

Regards,

Bark
Title: Re: How can I show some rows in percentages and others in decimal
Post by: blom0344 on 03 Dec 2012 04:07:06 AM
Good one Bark!  Should work out if you can add boolean expressions against the value of the metrics concerned with an advanced format
Title: Re: How can I show some rows in percentages and others in decimal
Post by: alex_ on 03 Dec 2012 06:55:25 AM
Thank for the ideas.
I used the following techniques:

Created new Data Item 'Quantity%' with the following IF expression:
IF ( [Metrics]='OTD_TOTAL')
THEN ( [Quantity]*100)
ELSE
IF ( [Metrics]='OTD_CHW')
THEN ( [Quantity]*100)
ELSE
IF ( [Metrics]='OTD_xSERIES')
THEN ( [Quantity]*100)
ELSE
IF ( [Metrics]='BA_HARDWARE')
THEN ( [Quantity]*100)
ELSE
IF ( [Metrics]='BA_SERVICES')
THEN ( [Quantity]*100)
ELSE
IF ( [Metrics]='BA_ANNUITY')
THEN ( [Quantity]*100)
ELSE
IF ( [Metrics]='BA_BASED_SERVICES')
THEN ( [Quantity]*100)
ELSE
IF ( [Metrics]='TO_BILLING')
THEN ( [Quantity]*100)
ELSE ( [Quantity])

After that:
created new Data Item with the following IF expression:
IF ( [Metrics]='OTD_TOTAL')
THEN ('%')
ELSE
IF ( [Metrics]='OTD_CHW')
THEN ('%')
ELSE
IF ( [Metrics]='OTD_xSERIES')
THEN ('%')
ELSE
IF ( [Metrics]='BA_HARDWARE')
THEN ('%')
ELSE
IF ( [Metrics]='BA_SERVICES')
THEN ('%')
ELSE
IF ( [Metrics]='BA_ANNUITY')
THEN ('%')
ELSE
IF ( [Metrics]='BA_BASED_SERVICES')
THEN ('%')
ELSE
IF ( [Metrics]='DELINQUENCY_TO_BILLING')
THEN ('%')
ELSE NULL


1.   The metrics that shouldn't be shown as a percentage are not included in 'IF' Constructs.
2.   After that, dreg and dropped a new 'Crosstab Space' in Crosstab.
3.   Unlocked the Crosstab elements.
4.   Changed 'Define Contents' to 'No'.
5.   Put the 'Singleton' element in new row.
6.   Drag and dropped the new Data Items in 'Singleton' element.
7.   Changed the Properties association from (Properties pane/Data/Properties) add association for the new Data Items in Crosstab.

Regards :)