COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: sacjeanie on 15 Jul 2015 11:14:23 AM

Title: Use Arrays to flattening multiple lines of data to 1 entry per person?
Post by: sacjeanie on 15 Jul 2015 11:14:23 AM
I work in a University and we are consistently being asked to provide lists where they want only one line of data per person.  For a simple example, imagine a list of students with some biographic information (e-mail, class level, status) along with columns of courses they are taking with that semester.  if they are only taking two courses, there would be data in the first two course columns.  If they were taking six courses, there would be six columns of data. 

I was reading through the documentation and was wondering if I can generate this uniquely for each student record by creating an array of registered classes and displaying the contents of that array within the student line in multiple columns. 

This is just one of many examples that I would like to learn a better technique to do this.  An array may not be the tool to tackle this problem.  Our data tables are relational and not dimensional. We are on Cognos 10.2.1.

My go to method has been to link multiple queries, one at a time and I know it is not the most elegant solution.

Any and all suggestions would be appreciated.

Jeanie Krieger
Sac State University
Title: Re: Use Arrays to flattening multiple lines of data to 1 entry per person?
Post by: bdbits on 15 Jul 2015 05:56:26 PM
I think the sort of thing you are looking for can be done with repeaters embedded inside a list report and a master detail relationship. Does that make sense?
Title: Re: Use Arrays to flattening multiple lines of data to 1 entry per person?
Post by: Robl on 16 Jul 2015 05:31:18 AM
Another vote for a repeater within a list.

Title: Re: Use Arrays to flattening multiple lines of data to 1 entry per person?
Post by: sacjeanie on 16 Jul 2015 10:30:14 AM
I will look into it.  It is not something I've done before.  I'll see if I can find documentation on it.  Thanks for looking at my questions.
Title: Re: Use Arrays to flattening multiple lines of data to 1 entry per person?
Post by: sacjeanie on 16 Jul 2015 02:35:19 PM
The repeater table/fields worked well.  However, when I export to Excel these field values are not included.

TIP:  When generating the repeater table, make sure to set the properties of the repeater table to include all of the fields from the master/detail relationship.  That was critical for making all of the values display on the report.

Tip 2: If you need to have multiple field in the repeater table, it's easiest to create a data filed with all of the elements you need concatenated. 

Thank you for this point into the right direction.