Union and Selecting Required Columns

Posted on by By Sohail, in Pentaho | 0

A union can be done on SQL but how can we do it on PDI without the use of SQL “UNION” Keyword
this is possible with the use of “APPEND STREAMS” in PDI transformation. And just like SQL union we need the same number of columns otherwise it will return an Error.

Make data easy with Helical Insight.
Helical Insight is the world’s best open source business intelligence tool.

Example

Let’s say we have two queries coming from two different source and you want to union the output, then the below Transformation can help you accomplish this.



We can add a SORT ROWS component to help you order the data before inserting or making a flat file.

Bonus: Selecting ALL columns

In SQL let’s say a table returns 26 columns but out of the 26 columns we only need 25, defining each columns is what needs to be done, which is time consuming. In PDI that can be done with the use of “SELECT VALUES”

Make data easy with Helical Insight.
Helical Insight is the world’s best open source business intelligence tool.

Click Here to Free Download


Lets say we don’t need the updatets, then in the remove tab we can opt to remove that.

Select OK and you are done.

Make data easy with Helical Insight.
Helical Insight is the world’s best open source business intelligence tool.

Click Here to Free Download

Now this component I talk about are helpful components as they save a lot of time.

logo

Best Open Source Business Intelligence Software Helical Insight is Here

logo

A Business Intelligence Framework

In case if you have any queries please get us at support@helicaltech.com

Thanks
Sohail Izebhijie
Helical IT Solutions Pvt Ltd

0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments