I have a folder of files that I am querying for the files' date modified, file size, and a few other attributes. Long-story-short we have multiple versions of these files in subfolders and each "release" we make a new folder and copy the Excel files into them. So I created this query that can track which files are different from version to version (it's basically a versioning tool). However, my issue is there are more granular version numbers stored in a named range within each file that I would like to access. The cell is named the same in every file (let's called it "VersionCell"). So what I'm trying to do is add the contents of this cell to the table as a new column/attribute.
[TABLE="width: 500"]
<tbody>[TR]
[TD]Already Exists[/TD]
[TD]...[/TD]
[TD]...[/TD]
[TD]...[/TD]
[TD]Need this one added[/TD]
[/TR]
[TR]
[TD]FileName[/TD]
[TD]Date Modified[/TD]
[TD]Date Created[/TD]
[TD]Full Path[/TD]
[TD]VersionNum[/TD]
[/TR]
[TR]
[TD]File1[/TD]
[TD]10/31/2016[/TD]
[TD]10/31/2016[/TD]
[TD]C:\\Version10\File1[/TD]
[TD]10.1[/TD]
[/TR]
[TR]
[TD]File2[/TD]
[TD]10/29/2016[/TD]
[TD]10/29/2016[/TD]
[TD]C:\\Version11\File2[/TD]
[TD]11.0[/TD]
[/TR]
</tbody>[/TABLE]
The files are rather large so I'm not sure if it's possible to fit this in the same query (or if it's even possible for smaller files). The only experience I have with this type of query was super simple...
This seems like one of those things that has to be possible but I can't figure it out. I'm fairly new to Power Query so if someone can point me to a helpful resource, that would help also. Thanks in advance!
Also, here is the current query. I stripped a bunch of stuff out to make it simpler to view. Just a basic folder query but you can see where I remove the content column that stores the file.
[TABLE="width: 500"]
<tbody>[TR]
[TD]Already Exists[/TD]
[TD]...[/TD]
[TD]...[/TD]
[TD]...[/TD]
[TD]Need this one added[/TD]
[/TR]
[TR]
[TD]FileName[/TD]
[TD]Date Modified[/TD]
[TD]Date Created[/TD]
[TD]Full Path[/TD]
[TD]VersionNum[/TD]
[/TR]
[TR]
[TD]File1[/TD]
[TD]10/31/2016[/TD]
[TD]10/31/2016[/TD]
[TD]C:\\Version10\File1[/TD]
[TD]10.1[/TD]
[/TR]
[TR]
[TD]File2[/TD]
[TD]10/29/2016[/TD]
[TD]10/29/2016[/TD]
[TD]C:\\Version11\File2[/TD]
[TD]11.0[/TD]
[/TR]
</tbody>[/TABLE]
The files are rather large so I'm not sure if it's possible to fit this in the same query (or if it's even possible for smaller files). The only experience I have with this type of query was super simple...
Code:
let Source = Excel.CurrentWorkbook(){[Name="ThirdRange"]}[Content],
ThisCell = Source{0}[Column1]
in
ThisCell
This seems like one of those things that has to be possible but I can't figure it out. I'm fairly new to Power Query so if someone can point me to a helpful resource, that would help also. Thanks in advance!
Also, here is the current query. I stripped a bunch of stuff out to make it simpler to view. Just a basic folder query but you can see where I remove the content column that stores the file.
Code:
let Source = Folder.Files("path goes here"),
#"Removed Columns" = Table.RemoveColumns(Source,{"Content"}),
#"Filtered Rows" = Table.SelectRows(#"Removed Columns", each ([Extension] = ".xlsx")),
#"Expanded Attributes" = Table.ExpandRecordColumn(#"Filtered Rows", "Attributes", {"Archive", "Compressed", "Content Type"}, {"Attributes.Archive", "Attributes.Compressed", "Attributes.Content Type"})
in
#"Expanded Attributes"