Forum Discussion
ThomasLundgren
Apr 27, 2020Copper Contributor
Create mapping between two fields
Hi! I'm trying to write a query in Application Insights that returns the slowest element (buttons, fields, etc) rendering times from custom events and group these by the component/view they belon...
- Apr 27, 2020
I don't have any test data but in KQL, the last line maybe:
) on $left.ComponentID == $right.ComponentNameMaybe you also can change the default JOIN kind from innerunique? https://docs.microsoft.com/en-us/azure/data-explorer/kusto/query/joinoperator?pivots=azuredataexplorer
CliveWatson
Apr 27, 2020Former Employee
I don't have any test data but in KQL, the last line maybe:
) on $left.ComponentID == $right.ComponentName
Maybe you also can change the default JOIN kind from innerunique? https://docs.microsoft.com/en-us/azure/data-explorer/kusto/query/joinoperator?pivots=azuredataexplorer
ThomasLundgren
Apr 27, 2020Copper Contributor
Thanks for your quick reply!
As with many things, the solution just came to me after taking a break from it for a while. Here's the solution:
customEvents
| project ComponentName = tostring(customDimensions["componentName"]), ComponentID = tostring(customDimensions["componentId"])
| where ComponentName != "" and ComponentID != ""
| distinct ComponentName, ComponentID
| join
(
customEvents
| project UpdateTime = toint(customDimensions["serverUpdateTime"]), ComponentID = tostring(customDimensions["componentId"]), Property = tostring(customDimensions["elementName"])
| where UpdateTime != 0 and ComponentID != "" and Property != ""
)
on ComponentID
| summarize avg(UpdateTime) by ComponentName, Property