write sql query following table
amount year quarter
1000 2003 first
2000 2003 second
3000 2003 third
4000 2003 fourth
5000 2004 first
6000 2004 second
7000 2004 third
8000 2004 fourth

i want the output
year q1_amount q2_amount q3_amount q4_amount
2003 1000 2000 3000 4000
2004 5000 6000 7000 8000

can anybady help me to achieve the aboue result by using informatica.

thanks in advance.

Answer Posted / qlikstar

Select year,
sum(case when quarter = 'first' then amount end) AS q1_amount,
sum(case when quarter = 'second' then amount end) AS q2_amount,
sum(case when quarter = 'third' then amount end) AS q3_amount,
sum(case when quarter = 'fourth' then amount end) AS q4_amount

from table
group by year order by year

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is workflow? What are the components of the workflow manager?

652


Can some one explain me about Telecommunications(wireless) project in Informatica? Thanks in advance

1566


What are the static cache and dynamic cache in informatica?

729


What does refresh system mean, and what are its distinctive choice?

578


How do you load first and last records into target table?

680






What is the difference between power center and power mart? What is the procedure for creating independent data marts from informatica 7.1?

623


COL1,COL2 ABC,1 XYZ,2 HERE IN COL2 VALUES 1,2 NOT STSANDARD(IE MEANS NOT FIXED VALUES LIKE OTHER SOME VALUES LIKE 10,20) O/P IS COL1,COL2 ABC,2 XYZ,1

1547


What is a pre-defined event and user-defined event?

585


If informatica has its scheduler why using third party scheduler?

790


What is Cognos script editor?

3797


in u flatfile some of fact records are missed then u load the diminision records are not if u load diminsion records what about fact table records

1743


Is it possible to use a client with different version than that of its Informatica server?

653


What is the Rank index port in Rank transformation?

678


Briefly define a session task?

599


what is the difference between informatica6.1 and infomatica7.1

1729