« Return to Thread: Help restructuring a data file, TIA!

Help restructuring a data file, TIA!

by Gonzalo Kmaid :: Rate this Message:

Reply to Author | View in Thread

Colleagues,

I need some help restructuring a data file. I tried some options without luck, but I think it is a simple problem.

Original data file looks something like this:

AREA    LOC      CANDIDATE       VOTES
A                1        JON               2
A                1        MARY              3
A                1        PETER             4
A                2        MARY              3
A                2        PETER             8
B                1        JON              7
B                1        LOUIS             7
B                2        PETER             5
B                2        BILL              3        
..

There are more than 60.000 files in the original data file.

I would like a new data file like this:

         VOTESJON         VOTESMARY        VOTESPETER       VOTESLOUIS      VOTESBILL
A1      2                 3                 4                 0                 0                 
A2      0                 3                 8                 0                 0
B1      7                 0                 0                 7                 0
B2      0                 0                 5                 0                 3
...

Each combination of AREA and LOC identifies one electoral district, and I want to get the number of votes per candidate within each district. Not all districts have the same candidates.

I tried several combinations of aggregate and the restructuring wizard. No luck. Any help really appreciated. TIA!

Gonzalo Kmaid

Gonzalo Kmaid
PhD Cornell University.

============================
CIFRA
Gonzalez, Raga y Asociados
707 06 77 (Telephone / Fax)

www.cifra.com.uy
cifra@...
Av. Brasil 2446/Ap 201
Montevideo-Uruguay
============================

 « Return to Thread: Help restructuring a data file, TIA!