Craigc3814
Board Regular
- Joined
- Mar 7, 2016
- Messages
- 217
I have a spreadsheet that my company gets monthly for usage. The spreadsheet has 4 worksheets in it. East, West, Central, RTC. I am using Ken Puls FnGetContents function to pull in each one separately (so I created the function 4 times). Then I append them all after the fact. Is there a way to clean the spreadsheet up and have the FnGetContents only run 1 time, append each worksheet in a workbook then append all workbooks in the folder?
Here is one of my FnGetContents functions
(filepath)=>
let
Source = Excel.Workbook(File.Contents(filepath)),
EAST1 = Source{[Name="EAST"]}[Data],
#"Promoted Headers" = Table.PromoteHeaders(EAST1),
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"Usage(Gallons)", type number}, {"Available (Gallons)", type number}, {"Level (Ft)", type number}})
in
#"Changed Type"
Here is one of my FnGetContents functions
(filepath)=>
let
Source = Excel.Workbook(File.Contents(filepath)),
EAST1 = Source{[Name="EAST"]}[Data],
#"Promoted Headers" = Table.PromoteHeaders(EAST1),
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"Usage(Gallons)", type number}, {"Available (Gallons)", type number}, {"Level (Ft)", type number}})
in
#"Changed Type"