COGNOiSe.com - The IBM Cognos Community

ETL, App Development and other tools => COGNOS DecisionStream/Data Manager => Topic started by: forseil on 07 May 2007 01:25:19 AM

Title: Joining datasources
Post by: forseil on 07 May 2007 01:25:19 AM
Hello,
If I have two datasources, can I get the only the "label" value from the other. Normally I would, of cource get it from the same sql joining those two tables, but  now it is very slow to do that way because there are lot's of data in the fact data. I have two datasources. First one contains all the fact data and the other on contains only one label for the fact data(And the code I can you for a join). How can I combine the "label" to the fact datasource or can I?

Thanks for your help
Title: Re: Joining datasources
Post by: MFGF on 14 May 2007 11:28:19 AM
Hi,

You have at least 3 choices as I see it...

1. Within a single data source, code a SQL query to join the two tables (which you say is very slow).

2. Add two datasources - one to collect your fact data, and the other to collect your label values.  Map them to the same set of datastream items, and make sure that in the Transformation model, your key value(s) are the only dimensional elements, then finally, in the properties of the build, go to the input tab and turn on the option to merge duplicate rows. [Be aware that depending on the data volumes being read, this may drastically increase the memory consumption of the build, and may end up being slower than your original SQL join]

3. Code two separate builds - the first one to deliver the core fact data and a null value for the label, and the second build to deliver the label data to the same table using Update/Insert refresh type.

Let us know what you find...

Best regards,

MF.
Title: Re: Joining datasources
Post by: vetteheadracer on 09 Jul 2007 10:10:08 AM
within the database set up a grant to the other source there by allowing one SQL statement to see both of the tables.

the From part of the statement should look like this:

From db1.table1, db2.table2

hope this helps.