cancel
Showing results for 
Search instead for 
Did you mean: 

How to create a table using partial data from two row

0 Kudos

Hello I have a table that has data from two sources but have same ID

IDABCD
123xyzxxyxxdxxa
123abcabddefxxr

I want to create a table that uses partial data from both rows

123xyzxxydefxxr

How can i Do this?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

it depends on how you want to get the valueas for the rows. In your example your getting , for A column, the value from the first row, but in column C, you´re getting from the second one.

Regards,

Rogerio

0 Kudos

yes that is how i wanted.. I need few fields from one row and few from the other row.

former_member207052
Active Contributor
0 Kudos

The most easiest way you can achieve this is to create a derived table in your universe and you can choose which columns from which table to include in the result with a join over the IDs.

Regards,

Naras

0 Kudos

Hello Naras,

Thank you very much for replying to my questions.

Do you mind explaining this in little more detail?

former_member207052
Active Contributor
0 Kudos

If you are new to the derived table concept, it is good to know and in the future you can solve many of your problem with this : find details here

Your derived table will have the SQL code as outline below :


SELECT

  Table_A.ID,

  Table_A.A,

  Table_A.B,

  Table_B."C ",

  Table_B.D

FROM

  Table_A INNER JOIN Table_B ON (Table_A.ID=Table_B.ID)

Regards,

Naras

former_member207052
Active Contributor
0 Kudos

Follow the above method, if you can get the data in two tables and you want the result set in one view.

But what if you have only one table for both the sources(combined data). It is a kind of reverse engineering but for some reason if you have no control over the tables from the source, follow the below method (note, you will need to have a column "datasource" to check from where the data is coming)

Create two alias tables (just one is enough but to keep the original table intact, create two) and insert a self join with filter on Datasource. Now drag and drop the objects that you want and you will get the desired results.

Answers (0)