Pages

Sunday, March 17, 2013

How to produce normalized output or Convert rows into columns


I/P:  
ID
Month
Sales
1
Jan
100
1
Feb
120
1
March
135
2
Jan
110
2
Feb
130
 2
March
120
O/P:
IDJanFebMarch
1100120135
2110130120
Ans:
Use the aggregator group by ID and use First function
FIRST(AMOUNT, MONTH='JAN')

FIRST(AMOUNT, MONTH='FEB')
FIRST(AMOUNT, MONTH='MAR')

No comments:

Post a Comment