I am dealing with a complex reshape wide problem.
Here is an input data:
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input float date str6 code str1(buy_sell tradercode) double tradetime long tradenumber str5 ordernumber double tradeprice long tradevolume str4 tradingreport str1(ordertype invtype) str4 ordernumber1 19725 "1512 " "B" "0" 32400000 1 "m5584" 8.8 2000 "0057" "0" "I" "476R" 19725 "1512 " "S" "0" 32400000 1 "N5683" 8.8 2000 "0307" "3" "I" "3554" 19725 "1512 " "B" "0" 32400000 2 "C5523" 8.8 8000 "1926" "0" "I" "7631" 19725 "1512 " "S" "0" 32400000 2 "N5683" 8.8 8000 "0307" "3" "I" "3554" 19725 "1512 " "B" "0" 32400000 3 "C5523" 8.8 2000 "1926" "0" "I" "7631" 19725 "1512 " "S" "0" 32400000 3 "45557" 8.8 2000 "1131" "0" "J" "7966" 19725 "0050 " "B" "0" 32400000 4 "U5556" 58.7 2000 "0298" "3" "I" "722E" 19725 "0050 " "S" "0" 32400000 4 "N5883" 58.7 2000 "0614" "4" "I" "882H" 19725 "2311 " "B" "0" 32404000 2414 "T5582" 28 1000 "1031" "3" "I" "7036" 19725 "2311 " "S" "0" 32404000 2414 "C5501" 28 5000 "0437" "3" "I" "4909" 19725 "2311 " "B" "0" 32404000 2414 "T5582" 28 4000 "1031" "0" "I" "7036" 19725 "2330 " "B" "0" 32405000 3004 "o5551" 105 3000 "2612" "0" "I" "4768" 19725 "2330 " "B" "0" 32405000 3004 "o5551" 105 2000 "2612" "4" "I" "4768" 19725 "2330 " "S" "0" 32405000 3004 "N5819" 105 5000 "0054" "6" "F" "8465" 19725 "2406 " "B" "0" 32405000 3197 "G5551" 34.3 8000 "1920" "0" "I" "3345" 19725 "2406 " "S" "0" 32405000 3197 "G5584" 34.3 25000 "1044" "3" "I" "490I" 19725 "2406 " "B" "0" 32405000 3197 "G5551" 34.3 17000 "1920" "1" "I" "3345" 19725 "0050 " "S" "2" 52200000 884583 "28269" 58.55 70 "1135" "0" "I" "001A" 19725 "0050 " "B" "2" 52200000 884583 "F5354" 58.55 70 "0920" "0" "I" "708R" 19725 "0050 " "B" "2" 52200000 884584 "F5354" 58.55 30 "0920" "0" "I" "708R" 19725 "0050 " "S" "2" 52200000 884584 "12556" 58.55 30 "0252" "0" "I" "4906" end format %tdDD/NN/CCYY date format %tc_HH:MM:SS tradetime
I have tried the following code which did not work:
Code:
reshape wide tradevolume tradeprice, i(tradenumber) j(invtype ordertype buy_sell) string Array
Thank you.
0 Response to Complex Reshape Long to Wide
Post a Comment