June 29, 2013
Hello!
I have a spreadsheet with two sheets. Each sheet has monthly and yearly fuel import information for 2 years (total: 4 years) by company. The header of the sheets have combined cells (month/year and FOB US/Net Kg.)
Each company can import more than a type of fuel, that's why the name of a company can be repeated.
Is it possible to join the two sheets, eliminate yearly data and join all monthly FOB US columns together and all monthly Net Kg together?
Thank you very much for your ideas
Best regards,
Juan
July 16, 2010
Hi Juan,
Probably, but it's difficult to say without seeing a sample file or images. e.g. you say there are two sheets, but I don't know what each sheet represents...a different company? Also, you mention "Each company can import more than a type of fuel, that's why the name of a company can be repeated", repeated where?
A picture or sample file will tell a thousand words 🙂
Mynda
Trusted Members
October 18, 2018
Trusted Members
October 18, 2018
An issue I have with your layout is that you have two header rows. If you change your header rows to
Jan 03 FOB US and Jan 03 Net kg, etc for each of the columns. Then you can pivot the results in a pivot table. I have done this for Jan and Feb of 05. Fix up your tables and if you still need assistance, post back. You can merge both tables into one pivot table.
Delete the top header row and only use the newly formed header.
July 16, 2010
Hi Juan,
Thanks for providing the workbook and an example of the desired outcome. As Alan said, this makes it much clearer and we can be sure when we help that we fully understand.
In the attached file I've used Power Query to unpivot your data (see link for tutortial on unpivoting with Power Query). From there you can then append your two tables and create the desired PivotTable.
Note: in the attached file the final query (Append1) is loaded directly to the Data Model (Power Pivot) and from there the PivotTable was created.
Mynda
Answers Post
June 29, 2013
Hello Mynda and Alan,
Thank you very much for your valuable insights, I really appreciate all your support.
What a fantastic tutorial, Mynda, the example 3 is exactly my case!. I will watch the video at home later (I have blocked Youtube at work) .
I have some questions:
1) Does Power Query unify the 2-row header into one?
2) When you created the Pivot table, did it group all FOB USD monthly columns and then all Net Kg monthly columns automatically?
I think I will need to delve into Power Query and Power Pivot, I am sure they will help me achieve results I have never imagined.
All the best,
Juan
June 29, 2013
Mynda, a curiosity, how much time did you take to do all the process and create the final Pivot table?
A coworker did the process manually and took him an entire afternoon to join the yearly tables and group all the columns by categories.
As he spent much time in the process, I decided to post a message to know if there is a more efficient way to do this in order to suggest him and fortunately, I am impressed to know it's possible It's awesome!!
July 16, 2010
Hi Juan,
Glad it helped. From memory it took me about 10 minutes to prepare your file. It probably took me longer than it should have because I wasn't familiar with your data.
To answer your other questions:
1. You merge the two headers after transposing so that they can be placed into one row.
2. I arranged the Columns so that the values were grouped (FOB and Net Kg.) together, you can see in the Column area in the PivotTable field pane the 'Values' is at the top of the list above Date (Year) and Date (month). You can drag them to change the grouping.
I have a Power Query course if you'd like to learn more.
Mynda
June 29, 2013
Hello Mynda,
Thank you very much for your valuable support. It's awesome to know I took so little time to prepare the file, a great evidence the amount of time that can be saved by using the most efficient tools
I will be considering your Power Query Course, I am sure it will be a enriching experience! Hope the US dollar rate decreases a little soon.
Kind regards,
Juan
1 Guest(s)