3

Transformation Summary in SAP data service ( BODS) – Part2 – Merge and Query Tra...

 8 months ago
source link: https://blogs.sap.com/2023/12/28/transformation-summary-in-sap-data-service-bods-part2-merge-and-query-transformation/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
December 28, 2023 2 minute read

Transformation Summary in SAP data service ( BODS) – Part2 – Merge and Query Transformation

In this blog I am going to discuss the  Merge Transformation and Query Transformation in SAP Data Services :

Merge Transformation :

Merge Transformation is used to merge multiple data sources i.e. tables or files into a single data source. But the field all the sources need to have a similar number of fields, the same data type, and sequences.

Basically, merge transformation acts as a UNION.

For example, if we want to merge  below source tables of Indian and Pak employees for an organization that exists in two countries:

Table 1: IND_EMP :

IND_EMP.png

Table 2: PAK_EMP :

PK_EMP.png

Design of a Merge Scenario :

Merge-1.png

The target table EMPLOYEE should contain all the data due to the union.

RESULT.png

Query Transformation :

Query transform is the most used transformation in BODS dataflow. It projects the data source fields to a subset or the same set.  it is used in single or with other transformations based on the business scenario.

It is used to –

  1. Narrow down the column subset by projection.
  2. Narrow down the data using the filter.
  3. Merge data from multiple sources using join or union.
  4. Perform other operations also.

For example, if there are two data sources like the below –

Data Source Table 1 : 

EMP.png

Data Source Table 2 : 

INDEMP.png

The business wants to know the highest salary of an employee outside India region. We can use query transformations for this –

Query-1.jpg

Now double click on the Query transform and it will let you go to the query editor.

Query-Editor-1.png

Now in the FROM tab put the joining condition.-

JOIN.png

In the Where Tab editor add the below filter.

PAK_EMP.SAL >=10000.

Save the Job and execute it. The Data preview of the target table should look like the below –

EMP_T.png

# Which scenarios Merge and Query Transformation is preferable?

Merge transform only can merge data from data sources having  the same number of fields, the same data type, and the same sequences. It acts like an UNION operation.

But Query transformation can combine any set of datasets, project a subset of data, filter data, and add parameter to data.  The usage of query transformation is a very large set of utilities. It is commonly used with other transformation also.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK