Langsung ke konten utama

Row Normaliser - Transform Column to Row

 

Skip to end of metadata

The Row Normaliser step normalizes data back from pivoted tables. For example, below is a sample table of product sales data:

Month

Product A

Product B

Product C

2003/01

10

5

17

2003/02

12

7

19

...

...

...

...

The Row Normaliser step converts the data into the format below
so that it is easier to update your fact table:

Month

Product

sales

2003/01

A

10

2003/01

B

5

2003/01

C

17

2003/02

A

12

2003/02

B

7

2003/02

C

19

...

...

...

Options

The following options are available for the Row Normaliser Step:

Option

Description

Step name

Name of the step; this name has to be unique in a single transformation.

Typefield

The name of the type field (product in the example above)

Fields table

A list of the fields you want to normalize; you must set the following properties for each selected field:

  • Fieldname: Name of the fields to normalize (Product A ? C in the example).
  • Type: Give a string to classify the field (A, B or C in our example).
  • New field: You can give one or more fields where the new value should transferred to (sales in our example).

Get Fields

Click to retrieve a list of all fields coming in on the stream(s).

Normalizing multiple rows in a single step

The example below illustrates using the Row Normaliser step to normalize more than one row at a time starting with the following data format:

DATE

PR1_NR

PR_SL

PR2_NR

PR2_SL

PR3_NR

PR3_SL

20030101

5

100

10

250

4

150

...

...

...

...

...

...

...

You can convert the data to a table similar to the one shown below:

DATE

Type

Product Sales

Product Number

20030101

Product1

100

5

20030101

Product2

250

10

20030101

Product3

150

4

...

...

...

...

Below is the setup you use to create the table:

Metadata Injection Support

You can use the Metadata Injection supported fields with ETL Metadata Injection step to pass metadata to your transformation at runtime. The following Value fields of the Row Normaliser step support metadata injection:

  • Fieldname
  • Type
  • New Field
https://wiki.pentaho.com/display/EAI/Row+Normaliser

Komentar

Postingan populer dari blog ini

CREATE CROSS TAB QUERY IN MYSQL

MySQL Multi-Aggregated Rows in Crosstab Queries MySQL’s crosstabs contain aggregate functions on two or more fields, presented in a tabular format. In a multi-aggregate crosstab query, two different functions can be applied to the same field or the same function can be applied to multiple fields on the same (row or column) axis. Rob Gravelle shows you how to apply two different functions to the same field in order to create grouping levels in the row axis. Today’s topic of discussion is crosstabs, which contain multiple aggregate functions in the row axis of a tabular resultset. Recall from the the  All About the Crosstab Query  article that an aggregate function is one that summarizes a group of related data in some way. Examples of aggregate functions include COUNT, SUM, AVG, MIN, and MAX. In a multi-aggregate crosstab query, two different functions can be applied to the same field or the same function can be applied to two or more fields. Today we’ll create a query...

Mysql Import data from CSV File

  Microsoft Windows [Version 10.0.15063] (c) 2017 Microsoft Corporation. All rights reserved. C:\Users\PSI011>cd C:\xampp\mysql\bin C:\xampp\mysql\bin> mysqld 2017-08-22 14:24:49 15428 [Note] mysqld (mysqld 10.1.25-MariaDB) starting as process 16352 ... C:\xampp\mysql\bin> mysql -u root -p Enter password: Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 9 Server version: 10.1.25-MariaDB mariadb.org binary distribution Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]> use pkh; Database changed MariaDB [pkh]> LOAD DATA LOCAL INFILE 'D:/2017/PKH_FOR_BPKP/PKH_FOR_BPKP_01.csv' -> INTO TABLE pkh_bpkp -> FIELDS TERMINATED BY ',' -> OPTIONALLY ENCLOSED BY '"' -> ESCAPED BY '"' -> LINES TERMINATED BY '\n...

Pentaho Data Integration: Membuat Koneksi ke database MSSQL Server 2008 R2

Untuk terhubung ke database SQL Server langkah-langkah berikut harus dilakukan:   Download Driver Microsoft JDBC di https://www.microsoft.com/en-us/download/details.aspx?displaylang=en&id=11774  Tutup Spoon atau Kettle project  Unzip/extract paket dalam direktori temporer (bebas) Copy '<temp directory> \ sqljdbc_6.0\enu\auth\x64\ sqljdbc_auth.dll' ke 'C:\Program Files\Java\jre1.8.0_131' atau sesuaikan dengan path java runtime terinstall  Copy '<temp directory>\ sqljdbc_6.0\enu\jre8\sqljdbc42.jar' ke '<Kettle folder instalasi> \ data-integration \ lib' Buka Spoon atau Kettle project Uji koneksi dalam Spoon Hapus direktori temporer karena sudah tidak digunakan lagi Jika kita meng-upgrade Kettle, Java, JDBC Driver ke versi yang lebih tinggi, maka serangkaian langkah-langkah di atas harus diulang lagi.