0% found this document useful (0 votes)
191 views

How To Implement "Group By" and "Having" Clause in ODI - ODI PDF

The document discusses how to implement "Group By" and "Having" clauses in Oracle Data Integrator (ODI). It explains that Group By is used to group records and can be implemented using aggregate functions. It provides an example of getting average salary by job. For Having, it explains that it allows filtering of grouped records and provides an example of getting average salary greater than $1500 by job. It then outlines the steps to implement these clauses in ODI through interfaces, mappings, flows and checking the generated code.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
191 views

How To Implement "Group By" and "Having" Clause in ODI - ODI PDF

The document discusses how to implement "Group By" and "Having" clauses in Oracle Data Integrator (ODI). It explains that Group By is used to group records and can be implemented using aggregate functions. It provides an example of getting average salary by job. For Having, it explains that it allows filtering of grouped records and provides an example of getting average salary greater than $1500 by job. It then outlines the steps to implement these clauses in ODI through interfaces, mappings, flows and checking the generated code.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

12/4/2019 How to implement “Group By” and “Having” clause in ODI?

– ODI

ODI
Oracle Data Integrator

How to implement “Group By” and “Having” clause in ODI?

Hi folks,

welcome back to my blog once again after a long vacation!!!!!!

Really sorry for the delay.

To day I am gonna explain one requirement asked by one of my blog follower in detail
how to implement Group By and Having in ODI?

Before going to implement this in ODI I will explain Group By and Having functionality
.

GROUP BY:

1. Group By is mainly used to group the individual records and we can divide then
into groups
2. In ODI,if we want to implement group by  class then we have to make use of  any
“Group Function”.
3. Group function applied only on number columns.
4. The different group functions or aggregate functions that are available:

Sum
Avg
Max
Min
Count
REPORT THIS AD

https://odielt.wordpress.com/2016/06/04/how-to-implement-group-by-and-having-clause-in-odi/ 1/9
12/4/2019 How to implement “Group By” and “Having” clause in ODI? – ODI

Variance
Standard Deviation.

Now my requirement:I want to display the average salary by job wise.

This I can achieve by single SQL statement as shown in below.

After explaining Having clause I will explain how we can achieve same in ODI?

HAVING:

1. After grouping data,if we want to perform filtering on the grouped records then we
have to make use of the”Having clause”.
2. Without “having clause” the group by can exist but the existence of having demands
group by

Now here I want to display the average salary is greater than 1500 by job wise.

So I can full fill this requirement as shown below.

REPORT THIS AD

https://odielt.wordpress.com/2016/06/04/how-to-implement-group-by-and-having-clause-in-odi/ 2/9
12/4/2019 How to implement “Group By” and “Having” clause in ODI? – ODI

Now its time to implement above two requirements in ODI.

Group By

Step: 1 Go To Designer->Expand Project->Right click on Interfaces-> And click on new


interface Give the name as INF_TRG_EMP_GROUP BY

Step: 2
Go To Mappings Tab &Go To Models

Drag “EMP” To Source Pane from source models.


Drag “TRG_EMP_GROUPBY” To Target Pane from target models.

REPORT THIS AD

https://odielt.wordpress.com/2016/06/04/how-to-implement-group-by-and-having-clause-in-odi/ 3/9
12/4/2019 How to implement “Group By” and “Having” clause in ODI? – ODI

It Asks “Auto Mapping “ click on “Yes”.

While mapping to target SAL column map with AVG(SAL) in expression editor as
shown in above.

Now go to flow select appropriate KM and select options based on your requirement.

Once complete click on save.Now click on execution button you will get one pop up

as shown below

click on OK.

REPORT THIS AD

https://odielt.wordpress.com/2016/06/04/how-to-implement-group-by-and-having-clause-in-odi/ 4/9
12/4/2019 How to implement “Group By” and “Having” clause in ODI? – ODI

Now  Go To Operator Navigator


Expand Session->go to Inserts->code

In code you can observe group by clause.That’s all to implement group by.

Group By implementation 

REPORT THIS AD

https://odielt.wordpress.com/2016/06/04/how-to-implement-group-by-and-having-clause-in-odi/ 5/9
12/4/2019 How to implement “Group By” and “Having” clause in ODI? – ODI

To see the data

Now repeat all above steps to implement having clause.

Apply filter on SAL column as shown below.

Give the condition as AVG(SAL)>1500

In the above image you can observe having clause.

That’s all buddies for today.

Stay tune with my blog for new articles.

Good night!!!!!!!!!!!!!!!!!!!!!!!! REPORT THIS AD

https://odielt.wordpress.com/2016/06/04/how-to-implement-group-by-and-having-clause-in-odi/ 6/9
12/4/2019 How to implement “Group By” and “Having” clause in ODI? – ODI

Best Regards

Venkat Maguluri

Advertisements

₹ 130 ₹ 40
REPORT THIS AD
Advertisements

REPORT THIS AD

Share this:

  

Like
Be the first to like this.

Related REPORT THIS AD

https://odielt.wordpress.com/2016/06/04/how-to-implement-group-by-and-having-clause-in-odi/ 7/9
12/4/2019 How to implement “Group By” and “Having” clause in ODI? – ODI

ODI 11g Step by Step installation

In "ODI"

How to use OdiInvokeWebService tool?

In "Designer"

How to reflect changes made in one environment to other the environment using ODI?

In "Designer"

venkatmaguluri / June 4, 2016 / ODI

REPORT THIS AD

https://odielt.wordpress.com/2016/06/04/how-to-implement-group-by-and-having-clause-in-odi/ 8/9
12/4/2019 How to implement “Group By” and “Having” clause in ODI? – ODI

ODI / Create a free website or blog at WordPress.com.

REPORT THIS AD

https://odielt.wordpress.com/2016/06/04/how-to-implement-group-by-and-having-clause-in-odi/ 9/9

You might also like