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

Under what condition selecting sorted input in aggregator may fail the session?

0 Answers  


What is fact table? Explain the different kinds of facts.

0 Answers  


MY SOURCE IS LIKE THIS VENKATESH,101||RAJESH,102||SIVA,103||SWATHI,104 MY REQUIRMENT IS NAME ID VENKATESH 101 RAJESH 102 SIVA 103 SWATHI 104 PLEASE PROVIDE ME THE SOLUTION

4 Answers  


Plz can anybody send Informatica and Cognos FAQ Plz To thid ID anil643@gmail.com (or) kumar643@gmail.com

0 Answers  


What are the different components of powercenter?

0 Answers  






What is checksum termnology in informatica? Where do you use it ?

3 Answers   Chase, Cognizant, Deloitte,


The structure of source file is as below: Source structure(two fields) Name, Card NUmber A, 111111111(SSN) A, 01010101(Creditcard number) A, 34343434(Debit card number) B, 55555555(Creditcard number) C, 77777777(Debit card number) Target Structure(4 fields) Name,Credit card,SSN,Debit card A,01010101,111111111, 34343434 B,55555555,, C,,,77777777 Corresponding to one name there can be maximum 3 rows and minimum zero rows. Given that I do not know which record might have a particular type of number. How can I handle above requirement with informatica transformations?

1 Answers   Amdocs,


how do u move the code from development to production?

3 Answers  


What is sq transformation?

0 Answers  


I want expect first and last record remaining all records will be loaded into target? which transformations we can use?

6 Answers   Cap Gemini, CTS,


write a query to get maximum salary from the employers table without duplicates....kindly help me

5 Answers   CTS,


what are the enhancements made to Informatica 7.1.1 version when compared to 6.2.2 version?

1 Answers  


Categories