ok,
thanks.
I have TableList query like here:
let
Source = Excel.CurrentWorkbook(){[Name="TableList"]}[Content],
#"Changed Type" = Table.TransformColumnTypes(Source,{{"TableName", type text}, {"ColumnName", type text}}),
#"Grouped Rows" = Table.Group(#"Changed Type", {"TableName"}, {{"Table", each _, type table [TableName=nullable text, ColumnName=nullable text]}}),
#"List" = Table.AddColumn(#"Grouped Rows", "List", each Table.Column(,"ColumnName"))
in
Listas you can see i am getting a List of columns for each table here
Next i have fnGetColumnsToKeep function where i am just filtering Table to get proper list:
(TableName)=>
let
Source = TableList,
#"Filter" = Table.SelectRows(Source, each ([TableName] = TableName))
in
#"Filter"And i finally did it!:
let
Source = Table1,
TableName = "Table1",
ColumnsToKeep = Table.Column(fnGetColumnsToKeep(TableName), "List"){0},
LastShape = Table.SelectColumns(Source, ColumnsToKeep)
in
LastShapethe problem was with the source which i didnt have. I had only STRING "Table1".
Just a question, it is possbile to make the source and use string?
Something like TableSourceName = Evaluate("Table1") and get table from string?
Best,
JacekPosted : 09/06/2021 6:07 amSee post 8 above, I already gave you the answer:
TableName="Table1"
Source= Excel.CurrentWorkbook(){[Name=TableName]}[Content] --> this returns a table based on the table name.But this is a basic thing, you get this code from ANY query from a table.
Posted : 09/06/2021 6:19 amTopic starterThank you very much for help Catalin,
Best !
JacekPosted : 09/06/2021 6:22 amPage 2 / 2 Prev0