Working with Views to Combine Data

Objective

After completing this lesson, you will be able to use views to combine data in SAP Datasphere.

Combine Data with Views

The propagation layer sits on top of the inbound and harmonization layer and is responsible for providing data in a highly harmonized, consistent, and complete form for further distribution and multiple use cases. Let's explore how graphical views and SQL Views can be used in this layer to combine data from different sources.

Combining Data with Graphical Views

The figure shows a screenshot of a graphical view with unions.

Views in the propagation layer are typically used to join or union views or tables from the harmonization layer to bring data together from multiple source systems into a single, unified dataset.

When you combine data sets in a union, you can choose from the following options:

  • UNION: Removes duplicate rows from the combined result. After merging, it performs a distinct sort, so every row in the output is unique.
  • UNION ALL: Keeps all rows, including duplicates. No de-duplication step is performed.

In SAP Datasphere specifically, UNION ALL is the more common choice in the graphical view union node when combining data from multiple sources (like combining CSV files, SAP S/4HANA, and SAP BW/4HANA sales data), because the source systems are distinct and you want every row preserved for aggregation downstream.

You typically use a view with semantic usage relational dataset when the entity has no direct analytical or reporting requirement.

Combining Data with SQL Views

The figure shows a screenshot of creating a SQL View.

Operations to combine data are also available when using SQL Views.

In a SQL View you use the SQL editor. You can choose between writing a standard SQL query using SELECT statements with operators such as JOIN, UNION and UNION ALL, or use SQL Script to produce a table function.

Note

SQL Views can also be used in various modeling scenarios. They are not limited to the propagation layer.

Combine Views Using a Union in a SQL View

In this demonstration, objects are combined using a union in a SQL View.

Combine Objects Using a Union in a Graphical View

Scenario Overview

Let's have a look at the scenario overview:

The figure shows an overview of all objects to be created in the sales data scenario.

After all data is acquired from the sources and prepared accordingly, another data model is required to combine the sales orders from the three sources.

The combination of objects using a union in a graphical view is divided into two simulations (parts 1 and 2).

In the following simulation, part 1 is covered.

In the following simulation, part 2 is covered.