I’ve been working on a query with lanquage M that takes a table and gives me the column count the problem is in the query Edito it looks fine but when I load and close the query in the table view I don’t see that value .
Here’s the code:
let
// Function to count columns in a table
CountColumnsFunction = (inputTable as table) as number =>
let
ColumnCount = Table.ColumnCount(inputTable)
in
ColumnCount,
// Get the table reference directly
TableReference = Record.Field(#sections[Section1], "REF Credit Limit"),
ColumnCount = if TableReference <> null then CountColumnsFunction(TableReference) else null,
// Profile the table with only the column count
ProfileTable = [
DB_Name = "DB1",
Table_Name = "REF Credit Limit",
Column_Count = ColumnCount
],
// Convert to table
TableProfiling = Table.FromRecords({ProfileTable}, type table [
DB_Name = text,
Table_Name = text,
Column_Count = Int64.Type
])
in
TableProfiling
That the table showing in Query editor
That’s the table showing in the table view after loading the query and in the column Count Column you can seee the value 4 is gone
adam Nadir is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.