Pivoting data into one line from a long list of data. Help!
I'm hoping one of you guys could help me with this.
Attached is some sample data I need transforming. When the file is opened our supplier provides the data in the format at the bottom of the sheet and the data needs to look like the top part to be able to get the data into our system.
Could the data be changed in the Power Query Editor?
I know there isn't much details here as this is hard one to explain but easy to see in the data provided.
Re: Pivoting data into one line from a long list of data. Help!
How did you do this task as it looks nearly spot on?
Only last problem is the Web Image....Some of the SKUs have multiple Web image rows. Before the above is done, would it be possible to change the text in the File Type Column to Web Image 1, Web Image 2, Web Image 3 etc based on how many duplicate lines there is for that particular SKU?
IF you notice in the example you have sent the web image isn't in the data because there is 3 lines which has Web Image as the file type.
Re: Pivoting data into one line from a long list of data. Help!
Here is the file.
1. Bring data into PQ Editor
2. Pivot the data on the File Type
3. Select File Path as the data to Pivot
4. I did not change the column names but you can by clicking on the header and renaming.
5. Close and Load
Power Query is a free AddIn for Excel 2010 and 2013, and is built-in functionality from Excel 2016 onwards (where it is referred to as "Get & Transform Data").
It is a powerful yet simple way of getting, changing and using data from a broad variety of sources, creating steps which may be easily repeated and refreshed. I strongly recommend learning how to use Power Query - it's among the most powerful functionalities of Excel.
- Follow this link to learn how to install Power Query in Excel 2010 / 2013.
- Follow this link for an introduction to Power Query functionality.
- Follow this link for a video which demonstrates how to use Power Query code provided.
Re: Pivoting data into one line from a long list of data. Help!
Understand what you are looking for. I believe that you will need to do that prior to loading into PQ. Probably need some VBA to do that. I don't have a solution for you, but will ask others to assist on this.
Re: Pivoting data into one line from a long list of data. Help!
I added an index column, then duplicated that query. In the duplicate I filtered for Web Image type, and then grouped by SKU returning the lowest index number for that SKU. Linking that into the original query on SKU number, we can then, for any Web Image column, subtract the lowest index number from the existing index number and add 1, so that we get a counter of 1, 2, 3 etc for each Web Image entry within an SKU number, then we append that to the type column, and pivot as Alan did originally. Make sense?
Bookmarks