Sunday, January 5, 2014

How to make text appear on a discontinuous crosstab

Please see sample below, where text was put in discontinuous crosstab based on variance.. Please see report specification (version 10.2) for review



Query



Max: maximum ([Sales (analysis)].[Sales].[Revenue] within set  [Sales (analysis)].[Products].[Products].[Product line])


Avg: average([Sales (analysis)].[Sales].[Revenue] within set  [Sales (analysis)].[Products].[Products].[Product line])


Variance:  ([Max]-[Avg])/[Avg]


Variance 1:  Variance


There are two methods to get text appear on in discontinuous crosstab. But first of all, we should NOT use default measure in any query items. We should directly use measure expression.


  1. Add new query item for Cognos version before 10.2


Add Query Item Variance1, and then add it as a new Row, select intersection and mark define contents as Yes
Unlock sell, and Drag Layout calculation into cell, and defined as


case when ([Query1].[Variance1]>0.9)
then ('Variance > 0.9')
else ('Variance <= 0.9') end



  1. Add Cross space for Cognos version for 10.2


Instead of adding new Query Item, we can simply drag crosstab space there select intersection and mark define contents as Yes. Unlock sell, and Drag Layout calculation into cell, and defined as
case when ([Query1].[Variance]>0.9)
then ('Variance > 0.9')
else ('Variance <= 0.9') end

No comments:

Post a Comment