Interactive Charts: This query could not run because some parameters are not set

Viewed 593

I want to create an azure application-insights workbook with a Bar chart and a grid. The idea is, when the user clicks on a bar in the chart that the grid filters for exactly that row in the grid. The query for the bar chart is (Set Visualization to Bar Chart in the settings for the query):

let Orders = externaldata(OrderDate:datetime, Fruit:string, Weight:int, Customer:string, Sell:int)
[@"https://gist.githubusercontent.com/Castaldio86/a12123a7f0e251a324b176d62deef9b8/raw/02da1d82bc548afc0cf45f7732b456f25d4d8080/Sentinel-Render-SampleData"
]
with(format="csv")
;
Orders
| summarize count() by bin(OrderDate, 1d), Fruit

For this, I added a parameter to the bar chart:
parameter configuration
The parameter will contain all information about the selected row.
In the next query I need that parameter. The query:

let row = dynamic({Operation});
let Orders = externaldata(OrderDate:datetime, Fruit:string, Weight:int, Customer:string, Sell:int)
[@"https://gist.githubusercontent.com/Castaldio86/a12123a7f0e251a324b176d62deef9b8/raw/02da1d82bc548afc0cf45f7732b456f25d4d8080/Sentinel-Render-SampleData"
]
with(format="csv")
;
Orders
| where OrderDate == row.OrderDate and Fruit == row.Fruit

The problem is, when I don't select any value in the chart it gives message: "This query could not run because some parameters are not set. Please set: Operation". If I select a value in the chart then the query returns "The query returned no results.". Would it be possible to have multi-select for the parameter?

Can someone please advice?

1 Answers

Yes, you can have a multiselect parameter, which will produce arrays of values (possibly an empty array, which you'll need to account for in the query),

OR, in your screenshot you can fill in the "default value" field to give the parameter a default value when an item is not selected.

OR, you can declare the parameter up front (before the chart), and explicitly make it "optional" there (and also "hidden in reading mode"), so that no value resolves to an empty string and things downstream know that is allowed to be empty

Related