Forum Discussion
tomand05
3 years agoRegular Visitor
Dynamic filename in folder and 30000 row limit
Hi! I got a query that connects to the “newest” *.xlsx file in a folder, that is automatically created every night. Its easy to filter out the latest file due to the naming. “Excel2023050506 00 36....
Payeras_BI
Solution Sage
3 years agoHi tomand05 ,
How does your query look like? Could you share it?
Do you get an error for that particular file, if so which one?
Regards,
tomand05
3 years agoRegular Visitor
Hi!
I hoop this is the correct parts of the query
Exempelfil meta [IsParameterQuery=true, BinaryIdentifier=Exempelfil, Type="Binary", IsParameterQueryRequired=true]
let
Källa = Folder.Files("\\aaa\bbb\ccc\ddd\AXIntegration\CSandWHD\Reports"),
#"Filtrerade rader" = Table.SelectRows(Källa, each not Text.StartsWith([Name], "~")),
#"Sorterade rader" = Table.Sort(#"Filtrerade rader",{{"Name", Order.Descending}}),
#"Behåll första rader" = Table.FirstN(#"Sorterade rader",1),
Navigering1 = #"Behåll första rader"{0}[Content]
in
Navigering1
let
Källa = (Parameter1 as binary) => let
Källa = Excel.Workbook(Parameter1, null, true),
#"Ax Data_Sheet" = Källa{[Item="Ax Data",Kind="Sheet"]}[Data],
#"Upphöjda rubriker" = Table.PromoteHeaders(#"Ax Data_Sheet", [PromoteAllScalars=true]),
#"Ändrad typ" = Table.TransformColumnTypes(#"Upphöjda rubriker",{{"ItemId", Int64.Type}, {"Deleted part", type text}})
in
#"Ändrad typ"