Dynamically execute a string as query
The below query will create a string that represents an executable query. I want the ability to then execute that string. This way I can dynamically generate a query based on an existing Schema.
| where ColumnName endswith 'duration'
| summarize Columns = makelist(ColumnName)
// Make the query
| project strcat('SomeTable | summarize avg(', arraystrcat(Columns, '), avg('), ') by Day = startofday(EventReceivedTime)')
Closing this as completed, this already exist: