Вы находитесь на странице: 1из 7

Creating NRDM structure with BODI/BODS

At a first glance, the corresponding Data Flow looks like a join of the two source tables and a row
generation.

But as we said NRDM means dealing with table datatypes. Here at the root level we will use the
master table and the sub schemas would have other required details. For here DIM_COUNTRY is
the master table and DIM_LOCATION will be used as detail table.
Let us move inside the Query to look at the NRDM structure and the data flow to NRDM from
tables.

Here we have World at the root node, notice we do not have any attribute mapped inside the
world but we have sub node continent. Inside Continent we have sub node Country and in turn
Country has a sub node City.
For the current purpose we do not have continent name in any of the table and hence we would
use a generic value as World. Does not make sense to have this but this will help us in dealing
with a static value in attribute which is not coming from table and we will learn how to control
NRDM final data flow even if the value is static.
Let us start with the value mapping from Query.
Right Click Query and Click Make Current if not already:

After clicking on Make current GO to From tab of the query:

In the above screen we can see that all the source tables are selected but as we need the root
node only once in the final output the DIM_LOCATION and DIM_COUNTRY should be removed.
If this is not done root node would be repeated multiple times in the output, which is what we
dont want. Please try this to see the output.
After un checking we will have below from Tab for the root node:

As for the World too we dont have any attributes, repeat the same as Query node for World
Node. Refer below

As for the Continent too we dont have any attributes coming from the source tables, repeat the
same as Query node for Continent Node. Refer below:

However there is an attribute Continent_name and we can assign value World in the mapping.
Refer below:

Now let us move to country Node. Please remember Country node is fetching data from master
table DIM_COUNTRY and is no way depending to DIM_LOCATION. Thus when choosing source
the for Country node should be only DIM_COUNTRY. Refer below:

Assign values to Country_name and code from dim_country table. Please note you cannot assign
values from any other source even if you try as the source data is not fetched for the node and
the source is not available in higher nodes as well. Refer below:

Now let us move to City Node. Please remember city node fetches data from only dim_location
table for the country in the above node and hence the same set up would be done as follows:
In the from node select only DIM_LOCATION table
In the where node join DIM_LOCATION and DIM_COUNTRY as per the join condition between 2
tables.

From Tab

Where Tab

Assign values to the attributes in side city node. Please remember now we need to assign values
only from dim_location table and not from any other source. In case you have data coming from
multiple sources for a single node. Build a source as query transform before the actual NRDM
build and then use source from the query transform.

Let us now go back and map the result in xml file:

Open the xml file and select destination folder for the file. Refer below:

After executing the job we can see below xml file built up:

In the above xml everything looks good except that the results have got repeated for the city
node. The same can be suppressed using the distinct selections. Refer below:

Let us execute the job again:

Please see all the duplications have been removed.

Вам также может понравиться