If you are unable to create a new account, please email support@bspsoftware.com

 

How to get a data from single column into three lines side by side, model relati

Started by xyz, 05 Nov 2015 01:34:05 PM

Previous topic - Next topic

xyz

Hi Gurus,

I have a requirement, where I need to split a data from a single column into multiple lines side by side. I am using relational model and Cognos 10.2.2.

Example as shown below.

Actual data below.


Name                Course
A                      X
A                      Y
A                      Z
B                      L
B                      M

Expected Output:

Name                Course          Course        Course
A                      X                  Y                Z
B                      L                  M



When I tried in Cognos by writing the separate data items then I am getting the output like below.

Name                Course          Course        Course
A                      X                 
                                            Y               
                                                             Z
B                      L                 
                                            M

Where I need to get the course data for Name 'A' in single row, similar for Name 'B' also I need to get the course date in a single row.

Can we able to achieve the above requirement in Cognos? please let me know your suggestions/inputs.

Thanks & Regards,
Abdul





cognostechie

Hi -

Seems like you are using a List object. If you use a Crosstab and put the Name in rows and Course in Columns then you should get the reault that you want.

Lynn


MFGF

Or if you persevere with the original approach, set the expressions to be maximum([your current course calc item] for [Name])

MF.
Meep!

xyz

Thanks All for your valuable replies.

I guess, I represented actual data wrong.

Name                Course       Course Type Category
A                      X                F
A                      Y                F
A                      Z                S
B                      L                F
B                      M               S


The need here for me is, I don't have any measure values showing here, I am showing only the string data. We don't want the course column to be placed in the columns of a crosstab, we want to place the course column in the rows itself only.

If we place the course column along with Name column in rows of a crosstab, we get the output like below.

Name                Course          Course        Course
A                      X                 
                                            Y               
                                                             Z
B                      L                 
                                            M

Which we doens't want and instead we want the output like below. Where in my previous email, I pasted the wrong expected output.




MFGF

Quote from: xyz on 11 Nov 2015 09:17:07 AM
Thanks All for your valuable replies.

I guess, I represented actual data wrong.

Name                Course       Course Type Category
A                      X                F
A                      Y                F
A                      Z                S
B                      L                F
B                      M               S


The need here for me is, I don't have any measure values showing here, I am showing only the string data. We don't want the course column to be placed in the columns of a crosstab, we want to place the course column in the rows itself only.

If we place the course column along with Name column in rows of a crosstab, we get the output like below.

Name                Course          Course        Course
A                      X                 
                                            Y               
                                                             Z
B                      L                 
                                            M

Which we doens't want and instead we want the output like below. Where in my previous email, I pasted the wrong expected output.

Hi,

I think you forgot to post up your new expected output format?

MF.
Meep!

xyz

Hi MFGF,

Thanks for your prompt reply.

Name                Course       Course Type       Mandatory/Optional
A                      X                F                     M
A                      Y                F                     M 
A                      Z                S                     O
B                      L                F                     M
B                      M               S                     O

Expected output. We wanted to display all the courses for each employee whether the course is mandatory/optional, whether the employee has taken the course or not.

Name                Course       Course
A                      X               M       
A                      Y               Z         
A                      L                         
B                      X               M
B                      Y               Z 
B                      L               

We have achieved the above expected output by doing the cross product of the course and employee name and then splitting the course based on there category type and create a list for each category type and then put all the list into single list and give master detail relationship between main list query and sub list queries using name column.

Thanks All again for your valuable suggestions.

Thanks & Regards,
XYZ