doing some conversion of a csv table in Powerpivot and could use some help!

harperjo

New Member
Joined
Aug 13, 2009
Messages
7
I have a csv table that I have to do some converting on to be used as an import for a database load. An example would be similar to the table below. of course I have 225 attributes in the table to deal with.

IDdescriptiontypeattrib1attrib2attrib3attrib4
1EXFAN223fan0117505bladebelt
2SUPFAN01fan02230025"squirreldirect
3EXFAN109fan0117503bladebelt

<tbody>
</tbody>


the conversion question is this.....I have to take this csv above and turn it into the one below.



IDdescriptiontypeattributevalue
1EXFAN223fan01attrib11750
1EXFAN223fan01attrib35blade
1EXFAN223fan01attrib4belt
2SUPFAN01fan02attrib12300
2SUPFAN01fan02attrib225"
2SUPFAN01fan02attrib3squirrel
2SUPFAN01fan02attrib4direct
3EXFAN109fan01attrib11750
3EXFAN109fan01attrib33blade
3EXFAN109fan01attrib4belt

<tbody>
</tbody>


the attributes headers and the values get transposed (if they exist)

any ideas on how to get this working?
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
In Power Query you find a function called Unpivot.OtherColumns: Select your first 3 columns and choose - UnpivotOthers, so you're flexible when new attributes come in.

HTML:
let
    Quelle = Excel.CurrentWorkbook(){[Name="Data"]}[Content],
    UnpivotOthers = Table.UnpivotOtherColumns(Quelle, {"type", "description", "ID"}, "Attribut", "Wert")
in
    UnpivotOthers
 
Upvote 0
I have not used power query as of yet.....just the cursory walk through. I was looking at that also to to produce a record set for each of the attribute columns and then merge the lot at the end...........

I am not certain how to pull all of this together but I will give it a look............thanks.

If you can give a little more explanation of you solution that would be very helpful.

Thanks again for the reply.....appreciated.
 
Upvote 0
Let's give it a try :)

Select your table, format as table (if it isn't already) and name it "Data".
Go to: Power Query - Get external data - From other sources - down below: Blank Query.
Replace everything you see by my code from above.
 
Upvote 0

Forum statistics

Threads
1,215,635
Messages
6,125,942
Members
449,275
Latest member
jacob_mcbride

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