Hey there,

I imported data which was formatted like Q12007 and then reshaped from wide to long, eliminated the "Q". Now I want to convert the variable called quarter into a useful quarterly data that can be merged with another database.

Any idea how to do that? I tried to create a new date variable based on "quarter" but it was not working.

Here is an excerpt from the data (some data for Q is missing but that does not relate to the question).


Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input str61 Description str7 ID_S str9 Datatypes float quarter str18 Q
"DR HOENLE AG - NET PROCEEDS FROM SALE/ISSUE C" "D13410M" "WC04251A" 12007 ""    
"DR HOENLE AG - EARNINGS BEF INTEREST & TAXES"  "D13410M" "WC18191A" 12013 "1490"
"DR HOENLE AG - NET PROCEEDS FROM SALE/ISSUE C" "D13410M" "WC04251A" 22014 ""    
"DR HOENLE AG - RESEARCH & DEVELOPMENT"         "D13410M" "WC01201A" 12015 "236" 
"DR HOENLE AG - PROPERTY, PLANT & EQUIP - NET"  "D13410M" "WC02501"  22010 "6027"
"DR HOENLE AG - PROPERTY, PLANT & EQUIP - NET"  "D13410M" "WC02501"  12009 "6210"
end