我有这张金融交易表..
PersonID | SeqId | FundId | PortfolioDbu | Date
----------------------------------------------------------
456 | 1 | B | 0.1 | 2012-04-03
456 | 1 | F | 0.5 | 2012-04-03
456 | 1 | H | 0.3 | 2012-04-03
456 | 1 | Z | 0.1 | 2012-04-03
8 | 1 | B | 0.5 | 2012-03-23
8 | 1 | A | 0.5 | 2012-03-23
8 | 2 | C | 0.3 | 2011-03-24
8 | 2 | X | 0.3 | 2011-03-24
8 | 2 | F | 0.4 | 2011-03-24
6001 | 1 | J | 0.5 | 2008-01-01
6001 | 1 | R | 0.5 | 2008-01-01
76 | 1 | A | 0.25 | 2010-09-26
76 | 1 | B | 0.25 | 2010-09-26
76 | 1 | C | 0.25 | 2010-09-26
76 | 1 | D | 0.25 | 2010-09-26
321 | 1 | X | 0.2 | 2012-02-21
321 | 1 | Y | 0.2 | 2012-02-21
321 | 1 | U | 0.2 | 2012-02-21
321 | 1 | P | 0.2 | 2012-02-21
321 | 1 | W | 0.2 | 2012-02-21
456 | 2 | Y | 1 | 2012-11-01
我需要将其转换为“宽”格式,就像这样..
Date | PersonId | SeqId | Fund1 | Fund2 | Fund3 | Fund4 | Fund5 | Dbu1 | Dbu2 | Dbu3 | Dbu4 | Dbu5
----------------------------------------------------------------------------------------------------------
2012-04-03 | 456 | 1 | B | F | H | Z | . | 0.1 | 0.5 | 0.3 | 0.1 | .
2012-03-23 | 8 | 1 | B | A | . | . | . | 0.5 | 0.5 | . | . | .
2012-03-24 | 8 | 2 | C | X | F | . | . | 0.3 | 0.3 | 0.4 | . | .
2008-01-01 | 6001 | 1 | J | R | . | . | . | 0.5 | 0.5 | . | . | .
2010-09-26 | 76 | 1 | A | B | C | D | . | 0.25 | 0.25 | 0.25 | 0.25 | .
2010-02-21 | 321 | 1 | X | Y | U | P | W | 0.2 | 0.2 | 0.2 | 0.2 | 0.2
2012-11-01 | 456 | 2 | Y | . | . | . | . | 1 | . | . | . | .
即使我不想以任何方式聚合数据,这是否可能?