Forum Discussion
dahund79
Feb 03, 2020Former Employee
unable to use let in log analytics query "No tabular expression statement found"
Creating a simple variable using let fails with "No tabular expression statement found" my code,
let myvar=4;
why can i not do this
- Feb 03, 2020https://ms.portal.azure.com#@72f988bf-86f1-41af-91ab-2d7cd011db47/blade/Microsoft_Azure_Monitoring_Logs/DemoLogsBlade/resourceId/%2FDemo/source/LogsBlade.AnalyticsShareLinkToQuery/q/H4sIAAAAAAAAA8tJLVHIrSxLLLI1seZyLUvNK%252BGqUSgoys9KTYZKcAEAlbG6ViMAAAA%253D/timespan/P1D
let myvar=4;
Event
| project myvar
This works, what are you trying?
ScottAllison
Feb 03, 2020Iron Contributor
dahund79 Can you be more explicit? How are you using 'myvar' in the query?
dahund79
Feb 03, 2020Former Employee
Hey, i am not Really using it just trying to create a variable, for testing.
- ScottAllisonFeb 04, 2020Iron Contributor
dahund79 Simply declaring the variable will fail since it's not being used in a query. CliveWatson 's example above shows how to potentially use the variable in a query.
- dahund79Feb 04, 2020Former Employee
ScottAllison apparently so its working now thx.
- CliveWatsonFeb 03, 2020Former Employeehttps://ms.portal.azure.com#@72f988bf-86f1-41af-91ab-2d7cd011db47/blade/Microsoft_Azure_Monitoring_Logs/DemoLogsBlade/resourceId/%2FDemo/source/LogsBlade.AnalyticsShareLinkToQuery/q/H4sIAAAAAAAAA8tJLVHIrSxLLLI1seZyLUvNK%252BGqUSgoys9KTYZKcAEAlbG6ViMAAAA%253D/timespan/P1D
let myvar=4;
Event
| project myvar
This works, what are you trying?