COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Framework Manager => Topic started by: jaymoore1756 on 29 Oct 2013 08:39:43 AM

Title: Appending two columns into one column in Framework Manager
Post by: jaymoore1756 on 29 Oct 2013 08:39:43 AM
I have two columns account number and person number. Both are numbers
example -

Account Number        Person Number
7032286                    123456

I want to append the columns so that it looks like this --

Data element
7032286
123456

Thanks for your help in advance
Title: Re: Appending two columns into one column in Framework Manager
Post by: Lynn on 29 Oct 2013 09:24:32 AM
You can unlock the report and arrange the items in blocks or in a 1-column/2-row table to achieve the display.

Oooh. Just realized this is in the Framework Manager board and you are looking for a modeling solution. I'm not sure how you could manage inserting a CRLF between your elements, but this sort of requirement strikes me more as a reporting requirement than a modeling requirement.
Title: Re: Appending two columns into one column in Framework Manager
Post by: jaymoore1756 on 30 Oct 2013 09:23:20 AM
We are treating this as a modeling requirement because of the relationship requirements. Is it possible union the files ?
Title: Re: Appending two columns into one column in Framework Manager
Post by: cognostechie on 30 Oct 2013 02:22:53 PM
Yes, it is possible to union if you write a custom SQL but I don't understand why you would want to do it? What's the purpose? They remain seperate and appear in two different lines so how are they related?

Select
  AccountNumber  as 'ID'
  AccountName     as 'Name'
from DBname.dbo.table1
UNION
Select
  PersonNumber  as 'ID'
  PersonName     as 'Name'
from DBname.dbo.table2

Title: Re: Appending two columns into one column in Framework Manager
Post by: jaymoore1756 on 07 Nov 2013 01:00:44 PM
The purpose of this process is to create a join/relationship in framework manager between the account file and the alerts file.
The account file contains two separate columns to house the account number and the person number. The alerts file contains a column called the alert key. The alert key can be either the account number or the person number depending on where the alert is triggered. So the idea was to create a data element in the accounts file that appended the account number and the person number and then join the data element to alert key column in the alerts file, allowing the user to create letters and reports regarding alerts regardless from where they were triggered.

Thanks in advance for your help
Title: Re: Appending two columns into one column in Framework Manager
Post by: blom0344 on 22 Nov 2013 12:24:50 PM
You can manually override the standard join by any expression you want by selecting the  ....  button in the relationship GUI, like:

[table1].[account] = [table2].[alert] or [table1].[person] = [table2].[alert]

= a theta join
Title: Re: Appending two columns into one column in Framework Manager
Post by: jaymoore1756 on 25 Nov 2013 09:16:00 AM
Excellent  ... This worked. Issue resolved