COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: ravikrsingh on 02 Mar 2013 12:01:40 AM

Title: Asterisks not getting displayed along with fact in the Crosstab fact cell
Post by: ravikrsingh on 02 Mar 2013 12:01:40 AM
Hi All,
In the crosstab, I need to display (VALUE*/**/or no asterisk) based on the value of a column, in the fact cells.

IF ([Volume Calculation Type Trucks] in (4,5) ) THEN (cast([Vol_Trucks_yr],VARCHAR(10)) || '*')
ELSE
(
IF ( [Volume Calculation Type Trucks] in (2,3) ) THEN (cast([Vol_Trucks_yr],VARCHAR(10)) || '**')
ELSE(cast([Vol_Trucks_yr],VARCHAR(10)))
)

Its displaying the VALUES only when its matching the last criteria(no asterisks).
Can anyone pls help, how to display the asterisks along with the values.

Thanks,
Ravi
Title: Re: Asterisks not getting displayed along with fact in the Crosstab fact cell
Post by: CognosPaul on 02 Mar 2013 10:04:44 AM
Crosstab fact cells only take numeric values. By casting it to a string, you're preventing it from being used in the crosstab.

Instead, try casting after the crosstab has been processed. Click on the node in the rows and add Volume Calculation Type Trucks to the properties list. Unlock the report, drag a layout calculation next to the value in the intersection.

The expression should be something like:

case
  when [Volume Calculation Type Trucks] in (4,5) then '*'
  when [Volume Calculation Type Trucks] in (2,3) then '**'
end

Title: Re: Asterisks not getting displayed along with fact in the Crosstab fact cell
Post by: ravikrsingh on 04 Mar 2013 04:45:38 AM
Hi Paul,
This works. However my problem is still not resolved.
In the crosstab, I have to display VolumeofAllVeh*/**(VolumeofTrucks*/**)
I am able to achieve VolumeofAllVeh*/** but not able to display (VolumeofTrucks*/**), as crosstab fact cell is displaying only one numeric value and asterisk.

Any idea, how to display VolumeofAllVeh*/** and (VolumeofTrucks*/**) together in the crosstab fact cell.
VolumeofAllVeh and VolumeofTrucks are dataitems available and asterisk are getting calculated using [Volume Calculation Type Trucks].

Sample output required is attached.
Title: Re: Asterisks not getting displayed along with fact in the Crosstab fact cell
Post by: CoolP on 04 Mar 2013 04:50:50 AM
Hi Ravi,


Press the unlock layout objects button and then add two text items to the fact cells. One with '*' and the another with a '**'. Set the relative alignment property of these textitems to superscript. Then create two boolean variables each with the required expression. Expression 1 will be true for the required criteria of (*), where as expression2 should be true for the required criteria (**). Then use these boolean variables in the render property of the text items.


This should work.


Cheers
CoolP
Title: Re: Asterisks not getting displayed along with fact in the Crosstab fact cell
Post by: ravikrsingh on 04 Mar 2013 04:59:31 AM
Hi CoolP,
I am able to display the * and ** using the boolean variable. I am facing issue when I have to display the data as: Vol1*(Vol2**) in the crosstab fact cell.
Title: Re: Asterisks not getting displayed along with fact in the Crosstab fact cell
Post by: CoolP on 04 Mar 2013 05:10:29 AM
Hmmm...will it not work with the similar technique? If they are two different measures , then you can try with few more text items with '(' and ')' in the front and back of the second measure and also follow the same procedure to display * and **.



[size=78%]Cheers[/size]
Title: Re: Asterisks not getting displayed along with fact in the Crosstab fact cell
Post by: ravikrsingh on 04 Mar 2013 05:37:12 AM
Have tried that too...Tried displaying whole in a crosstab Fact cell,but the Vol2 doesn't gets displayed. It comes as Vol1*(). Am I missing something?
Title: Re: Asterisks not getting displayed along with fact in the Crosstab fact cell
Post by: CoolP on 04 Mar 2013 04:40:56 PM
It will work if they are two different measures. all you need is 6 text items. 2 text items for '*', 2 text items for '**' and 1 text item for '(' and the other text item for ')'.
You also need 4 boolean expressions for conditional rendering of '*' and '**'.

Cheers
Title: Re: Asterisks not getting displayed along with fact in the Crosstab fact cell
Post by: ravikrsingh on 08 Mar 2013 05:10:23 AM
Thanks CoolP.