Forum Discussion
Loganalytics - Query not able to create a chart?
Hi Mattias260, sorry for not helping you resolve the matter, but today i encounter the same problem running this query :
So i got results, however, when I switch to chart view, I got the same error as you:
Does anyone know what's going on?
I'm assuming that this is something related to the type of the fields/columns in log analytics, or the chart not looking to the correct values.
When i have done this the fields are has "text" fields....
So im guessing this is the problem with log analytics, its looking into it, but it sees the field as a "text" colunm instead of the "decimal Number" type of row...
I'm assuming that is is somehow related to a issue that log analytics reported a few weeks about a "missing" colunm...
I hope someone at microsoft, look at it and fix it.
- loadedlouie270Mar 26, 2021Copper Contributor
And here is a quick fix,
Add the following line for each of your decimal values,
|extend cpu = todecimal(avg_cpu_percent_s)Explaining what it does:
(extend command, follow by the name of the new colunm, in this case "cpu", provide a equal "=", and the command, "todecimal(nameofthecolumn).
this will create a new column and convert the avg_cpu_percent_s, to a decimal value, allowing the chart in log analytics to process it since it sees it in the new column as a number.
Hope it helps, and microsoft solve this, i manage a few subscriptions, and i got the same error in all of them, so its a wide spread bug to my opinion, and there will be more people complaining over time.
Hope this helps.