COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: learnflower on 01 Feb 2012 02:00:37 AM

Title: Cross Tab Data displaying extra rows and columns
Post by: learnflower on 01 Feb 2012 02:00:37 AM
 Hi ,
I have problem in the crosstab columns and rows which is based on some conditions following my rows are based on the Region_code . My crosstab consists of 5 rows and few columns. First row consists of all the Region_code (10,11,12,13) , second row is based on Region_code =10, third row is based on Region_code =11, fourth row is based on Region_code =12 , fifth row is based on Region_code =13 .

expression we have used for the rows :
First row:
CASE
WHEN (Region_code in (10,11,12,13)) THEN (' All Region')
END

second row :
CASE
WHEN (Region_code ='10') THEN (' aaa')
END

third row :
CASE
WHEN (Region_code ='11') THEN (' bbb')
END

fourth row :
CASE
WHEN (Region_code ='12') THEN (' ccc')
END

fifth row :
CASE
WHEN (Region_code ='13') THEN (' ddd')
END

We are getting  2 rows of data for each row
for eg : for First row:
I am getting proper data and along with it another row with rowname blank and with some data.

And this is happening for all the remaining rows and columns .

Please guide us on this.
Title: Re: Cross Tab Data displaying extra rows and columns
Post by: blom0344 on 02 Feb 2012 03:03:59 AM
The missing ELSE part in your case will default to null and these will be shown. Use a filter to fetch only region_codes 10,11,12,13
Title: Re: Cross Tab Data displaying extra rows and columns
Post by: learnflower on 03 Feb 2012 03:49:46 AM
Hi blom,

I have given the filters which fetch only region_codes 10,11,12,13 , still the problem is present.

Please tell me what shall I do.
Title: Re: Cross Tab Data displaying extra rows and columns
Post by: blom0344 on 03 Feb 2012 03:28:31 PM
Did you check the tabular data?
Title: Re: Cross Tab Data displaying extra rows and columns
Post by: learnflower on 06 Feb 2012 11:26:16 PM
Tabular data is coming fine , but while running the report the display of the data is getting 2 rows of the data for a particular row
Title: Re: Cross Tab Data displaying extra rows and columns
Post by: learnflower on 07 Feb 2012 07:12:52 AM
Please help me on this its really urgent
Title: Re: Cross Tab Data displaying extra rows and columns
Post by: blom0344 on 07 Feb 2012 08:06:40 AM
I am a bit at a loss what you are trying to achieve here. Each row in the rowset will have a specific Regioncode , but your CASE constructions make little sense to me.

If you want seperate results for the regioncodes and a fifth result for the group of 4 regioncodes then the easiest way is to build the crosstab against a union set:

Set1:  [filter :  Region_code in (10,11,12,13)]

'All Region'

Set2: [filter :  Region_code in (10,11,12,13)]


CASE
WHEN (Region_code ='10') THEN (' aaa')
WHEN (Region_code ='11') THEN (' bbb')
WHEN (Region_code ='12') THEN (' ccc')
WHEN (Region_code ='13') THEN (' ddd')
END
Title: Re: Cross Tab Data displaying extra rows and columns
Post by: absriram on 07 Feb 2012 06:56:57 PM
As blom0344 suggested in the first reply, add ELSE clause to your all your case statements.

E.g.
CASE
WHEN (Region_code in (10,11,12,13)) THEN (' All Region')
ELSE cast([Region_Code],char(10))
END


This will tell you what those null values are.

Sriram
http://www.cognosonsteroids.com
Title: Re: Cross Tab Data displaying extra rows and columns
Post by: learnflower on 08 Feb 2012 12:10:50 AM
Hi All,

I need my output to be as the attached image , That is my I am taking each dataitem for each Region code . So please guide me by taking the attached image as refrence.
Title: Re: Cross Tab Data displaying extra rows and columns
Post by: blom0344 on 08 Feb 2012 03:37:14 AM
You are possibly  trying too much within one crosstab this way. AFAIK you can use multiple measures for the fact by dragging them under each other or side by side. You are trying to do both at the same time which may be the cause of the multiple rows generated.

My 2 cents - that is the way we build these things - is to use union sets to make sure data distribution in the columns is driven by dimensional values instead of seperate measure definitions. Our unions may  have sometimes as much as 10 sets, but we still build much more complex reports than your example
Title: Re: Cross Tab Data displaying extra rows and columns
Post by: learnflower on 17 Feb 2012 03:42:02 AM
But this is the requirement , can anybody help me on this .

This really needed ..  :(
Title: Re: Cross Tab Data displaying extra rows and columns
Post by: blom0344 on 17 Feb 2012 04:37:43 AM
We made a number of suggestions  but throwing the 'requirement' phrase at us will not help.  Did you understand the notion of using seperate sets to build the layout you need?