If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
"Unnormalize" table
Hello
I have a table which looks like this: DRG Patient Costs ================== A a 10 A b 20 A c 15 B a 30 and so on. Now I have to convert it to something like this: DRG Costs1 Costs2 Costs3 ============================ A 10 20 15 B 30 Very ugly but I need it this way for Excel. How can I do that? |
#2
|
|||
|
|||
"Unnormalize" table
julius.fuchs wrote: Hello I have a table which looks like this: DRG Patient Costs ================== A a 10 A b 20 A c 15 B a 30 and so on. Now I have to convert it to something like this: DRG Costs1 Costs2 Costs3 ============================ A 10 20 15 B 30 Very ugly but I need it this way for Excel. How can I do that? It really depends on what your data really looks like (and what you really want)... for example, using your data (if table.name="yurtable") TRANSFORM First(t.Costs) SELECT t.DRG FROM yurtable AS t GROUP BY t.DRG PIVOT "Costs_" & t.Patient; above crosstab would produce DRG Costs_a Costs_b Costs_c ============================ A 10 20 15 B 30 My guess is that your data and wanted-results are more complicated? good luck, gary |
Thread Tools | |
Display Modes | |
|
|