Power Query - Remove top Xrows for each file in a folder

RBGDaboys

New Member
Joined
Jul 18, 2007
Messages
33
Hello,
I have a query setup for a folder. I want to remove the top 10 rows for ALL files in the folder. Can this be done?
Thank you
 
You choose "Combine" and PQ generates 2 main queries, one function and one parameter. A temporary query is made called Sample File - for analysing the contents by the look of it.
pNY1fD3.png


- there's a query for the WHOLE folder (named after the folder name - in my case "sample" ) - it's in the Other Queries group.
- there's a query for individual files (called "Transform file from sample").
- This file level query is used to "Generate a function" for you "fx Transform file from sample"
- the parameter needs to exist in order to generate a function (which is done for you). Beyond that it's only used for test purposes.

You now modify the query called "Transform Sample File from sample" to apply whatever file-level modifications you want (like removing the first 10 rows).

You modify the "sample" query to perform whatever transformations you want once all the data is combined (new columns, filtering, sorting etc)
 
Last edited:
Upvote 0

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Thank you for the reply. I did this but the issue is when I add more files to the folder only the top 10 rows on the first file are removed. I need it on every file.
 
Upvote 0
You need to edit "Transform Sample File from sample", as I stated.

What do you then want to do with the files, not read them into one?
 
Last edited:
Upvote 0

Forum statistics

Threads
1,216,077
Messages
6,128,674
Members
449,463
Latest member
Jojomen56

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