Converting data in a report into data that be loaded into a database table

DonnaRonna

New Member
Joined
Sep 11, 2018
Messages
9
Hi,

First off, I love this board! Very helpful.

I have a report (excel format) of data that has the amounts for each date in a separate column:

Descriptor Descriptor Jan-18 Feb-18 Mar-18 and so forth
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
wow, I hit a key and submitted this without finishing. sorry about that.

Descriptor Descriptor Jan-18 Feb-18 Mar-18
Widget Red $5 $10 $10

What I need, in order to load the data into a table in the database is:

Descriptor Descriptor $ Date
Widget Red $5 Jan-18
Widget Red $10 Feb-18
Widget Red $12 Mar-18

Any ideas?

Thanks in advance

DonnaRonna
 
Upvote 0
If you are able to use PowerQuery aka Get&Transform, try

DescriptorDescriptor2Jan-18Feb-18Mar-18DescriptorDescriptor2ValueAttribute
WidgetRed$5$10$10WidgetRed$5Jan-18
WidgetRed$10Feb-18
WidgetRed$10Mar-18

Code:
[SIZE=1]let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(Source, {"Descriptor", "Descriptor2"}, "Attribute", "Value"),
    #"Reordered Columns" = Table.ReorderColumns(#"Unpivoted Other Columns",{"Descriptor", "Descriptor2", "Value", "Attribute"})
in
    #"Reordered Columns"[/SIZE]
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,422
Messages
6,124,811
Members
449,191
Latest member
rscraig11

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top