File Folder Queries - Fewer results in the Parent Folder than in the Child Folder

johnny51981

Active Member
Joined
Jun 8, 2015
Messages
366
Hi All:
I am extracting information from a collection of PDF files on a Network Drive in order to use the data in Excel. I can get this to work out with no issues.

The problem that I am running into is now I have to move up a folder on that same Network Drive, causing there to be far fewer results than if pointing directly to the folder that is further drilled down.

Example
\\NetworkDrive\PrimaryFolder\SecondaryFolder provides me with 3000 results in my Power Query.
\\NetworkDrive\PrimaryFolder, however only provides me with 250 results in my Power Query.

What would be the best way to get all 3250 to come in together?

Here is is some of the Power Query steps that I am using. Note, "NTPFolder" is a Named Range that houses the Network Drive address

NTP-Job Info:
Power Query:
let
    FilePath = Excel.CurrentWorkbook(){[Name="NTPFolder"]}[Content]{0}[Column1],
    Source = Folder.Files(FilePath),
    #"Filtered Rows" = Table.SelectRows(Source, each  Text.Contains([Name], "ntp", Comparer.OrdinalIgnoreCase) or Text.Contains([Name], "work order", Comparer.OrdinalIgnoreCase)),
    #"Removed Columns" = Table.RemoveColumns(#"Filtered Rows",{"Extension", "Date accessed", "Date modified", "Date created", "Attributes", "Folder Path"}),
    #"Renamed Columns" = Table.RenameColumns(#"Removed Columns",{{"Name", "NTP File Name"}}),
    #"Filtered Hidden Files1" = Table.SelectRows(#"Renamed Columns", each [Attributes]?[Hidden]? <> true),
    #"Invoke Custom Function1" = Table.AddColumn(#"Filtered Hidden Files1", "Transform File", each #"Transform File"([Content]))
in
    #"Invoke Custom Function1"
**Note: There is more, but it is just moving things about in the format and structure that I am needing.

"Transform File" Custom Function
Power Query:
let
    Source = (Parameter1 as binary) => let
        Source = Pdf.Tables(Parameter1, [Implementation="1.3"]),
        Table001 = Source{[Id="Table001"]}[Data]
    in
        Table001
in
    Source

Thank you in advance for any help that comes my way. And let me know if there is any further information that may be needed to help us get to a solution.
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).

Forum statistics

Threads
1,215,436
Messages
6,124,869
Members
449,192
Latest member
MoonDancer

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