I would like to create summaries for the results of a certain type of task across multiple geographic regions. I currently have the following dummy query:
datatable(env_cloud_location : string, result : string )[
"East Asia", "Passed",
"East Asia", "Failed",
"East Asia", "Error",
"East US", "Passed",
"East US", "Error",
"East US", "Passed",
"North Europe", "Failed",
"North Europe", "Error",
"North Europe", "Error",
]
| summarize
eastAsia = countif(env_cloud_location == "East Asia"),
eastUS = countif(env_cloud_location == "East US"),
northEurope = countif(env_cloud_location == "North Europe")
by result
Now, I suppose I don't know all the possible values of "env_cloud_location" and there in fact are anywhere from 5 to 12, how can I summarize such that each of these locations, however many there are, gets their own column? Expected output in the format:
| result | eastAsia | eastUS | northEurope |
|---|---|---|---|
| Passed | 1 | 2 | 0 |
| Failed | 1 | 0 | 1 |
| Error | 1 | 0 | 2 |