Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Transposing data elements
Message
De
14/02/2009 08:35:47
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01381685
Message ID:
01381734
Vues:
40
I don't quite understand, what are the rules to create table2 based on table1?

>Is there a more clever way to "transpose" the data in table 1 into table 2? Currently I am scanning table 1 and then evaluating each row using a do case / end case statement in order to identify accounts and creating a mv to hold the more understandable field names in table 2.
>
>Thank you in advance,
>Gary De Lecce
>
>
>Table 1
> Account Emp Ckno Date DrCr
>recno1 560 1 122 12/1/2008 5,500.00
>recno2 220 1 122 12/1/2008 -854.52
>recno3 221 1 122 12/1/2008 -552.30
>recno4 223 1 122 12/1/2008 -36.52
>recno5 140 1 122 12/1/2008 -1,500.00
>recno6 597 1 122 12/1/2008 -150.00
>recno7 102 1 122 12/1/2008 2,406.66
>recno8 560 3 124 12/1/2008 4,251.00
>recno9 220 3 124 12/1/2008 -652.21
>recno10 221 3 124 12/1/2008 -958.00
>recno11 223 3 124 12/1/2008 -55.41
>recno12 224 3 124 12/1/2008 -62.51
>recno13 140 3 124 12/1/2008 -850.00
>recno14 597 3 124 12/1/2008 0.00
>recno15 102 3 124 12/1/2008 1,672.87
>
>Table 2
> Ckno EMP Gross WH1 WH2 WH3 WH4 WH5 WH6 Net
>recno1 122 1 5,500.00 -854.52 -552.30 0.00 -36.52 -1,500.00 -150.00 2,406.66
>recno2 124 3 4,251.00 -652.21 -958.00 -55.41 -62.51 -850.00 0.00 1,672.87
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform