How to find from a source which has 10,000 records, find the
average between 500th to 600th record?

Answers were Sorted based on User's Feedback



How to find from a source which has 10,000 records, find the average between 500th to 600th record?..

Answer / guest

In the sql override, add a column for rownum which
generates the sequence numbers. Pass them into a filter
transformation to filter the records between 500 and 600.
And do the required aggregation through Aggregator
Transformation.

Through SQL :

select avg(sal) from (select id,name,sal,rownum r from
table_name )
where r between 500 and 600;

Hope this works..... if not please let me know

Is This Answer Correct ?    3 Yes 0 No

How to find from a source which has 10,000 records, find the average between 500th to 600th record?..

Answer / sudhar

Your answer is correct for the flat files. But the RElation
query you have given won't give any records.

the Query should like this

select avg(sal) from
(select emp_id, sal, rownum rnum from (
select emp_id,sal from emp order by sal desc) )where rnum
between 500 and 600

Might be this Query can be simplified with Rank option in
Oracle.

Is This Answer Correct ?    2 Yes 0 No

How to find from a source which has 10,000 records, find the average between 500th to 600th record?..

Answer / krishna

first u take the source,if it is flat file or relational
table then using exp t/r create one variable port.the port
like v.
increment the v value for every record .
after u write the condition in filter t/r v>=500 and v<=600

After use agg t/r and select the group by port as sal and
write the agg function avg(sal).After give the output that
port to target table

if it is relational table then use direct query in sql over
ride in source qualifier itself like


SELECT * FROM <TABLE NAME> WHERE ROWNUM>=500 AND
ROWNUM<=600

Is This Answer Correct ?    3 Yes 2 No

Post New Answer

More Informatica Interview Questions

IN SCD TYPE 1 WHAT IS THE ALTERNATIVE TO THAT LOOKUP TRANSFORMATION ?

4 Answers   HP,


1,If there are 3 workflows are running and if 1st workflow fails then how could we start 2nd workflow or if 2nd workflow fails how could we start 3rd workflow?

4 Answers   CompuSoft, EDS, TCS,


Explain your project of banking domian.

0 Answers   Cap Gemini,


How to convert multiple rows to single row (multiple columns) in informatica

0 Answers   Informatica,


i have an aggregater in my mapping and no group by port on any column and i ampassing 100 rows through aggregater,so how many rows i will get as out put from aggregater

5 Answers  






write a query to follwoing table amount year quarter 254556 2003 first 546332 2003 second 129034 2003 third 490223 2003 fourth 165768 2004 first 265443 2004 second 510412 2004 third 435690 2004 fourth i want the output year q1_amount q2_amount q3_amount q4_amount 2003 254556 546332 129034 490223 2004 165768 265443 510412 435690

2 Answers   TCS,


What are mapplets?

0 Answers  


Repository user profiles

0 Answers  


What is Target Update Override? What is the Use ?

8 Answers   Patni,


To Provide Support For Mainframes Source Data, which Files Are Used As A Source Definitions?

0 Answers   Informatica,


What is the difference between informatics 7x and 8x and what is latest version?

0 Answers  


What is the reusable transformation?

0 Answers  


Categories