Dear All, I found this question here (http://bbs.pinggu.org/thread-6513949-1-1.html). The data is
and the purpose to transform the data to be something like
Basically, the data one the same date should be on the same row! Any suggestion is appreciated.
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input int id str10 date float vol 22 "2016-03-21" .052813 22 "2016-03-22" .052454 22 "2016-03-23" .052408 22 "2016-03-24" .047639 153 "2016-03-22" .050336 153 "2016-03-23" .050088 153 "2016-03-24" .043589 153 "2016-03-25" .042855 521 "2016-03-20" .037602 521 "2016-03-21" .03761 521 "2016-03-22" .037194 521 "2016-03-23" .03 end
Code:
input int id22 str10 date22 float vol22 int id153 str10 date153 float vol153 int id521 str10 date521 float vol521 . "" . . "" . 521 "2016-03-20" .037602 22 "2016-03-21" .052813 . "" . 521 "2016-03-21" .03761 22 "2016-03-22" .052454 153 "2016-03-22" .050336 521 "2016-03-22" .037194 22 "2016-03-23" .052408 153 "2016-03-23" .050088 521 "2016-03-23" .03 22 "2016-03-24" .047639 153 "2016-03-24" .043589 . "" . . "" . 153 "2016-03-25" .042855 . "" . end
Comment