KUSTO - Time Range parameter usage error

Haroun Bouhdid 1 Reputation point
2022-04-11T15:29:31.953+00:00

Hello everyone,
Kusto Time Range parameter
Time Range parameter with type «Drop down» I have no problem. Everything works very well.
But when I use Time Range parameter with the type "Time range picker" the parameter {timeRange} does not accept any operator. And it blocks with the error «Query could not be parsed at '>' on line [5,16] Token: '>' Line: 5 Postion: 16»
Example:
1- Parameter "TimeRangeStatGeneraleCustom" of type "Time range picker"
2- Query:

let timerange = {TimeRangeStatGeneraleCustom}
let lenght = strlen(tostring(timerange));
let maxlenght = (lenght-9);
let nbrjour = substring(timerange,0,maxlenght);
let QMoyenneParjour = union pageViews, customEvents, requests
| where timestamp > ago(timerange)
and session_Id !=""
| summarize Nombre = bin(todouble(dcount(session_Id) / todouble(nbrjour)),0.01)

//| summarize Nombre=count(session_Id)
| extend Description = strcat("Moyenne des sessions par jour (sur"," ", nbrjour," ","jours)")
//| extend Metrique = "Session"
| extend Ordre =2
| project-reorder Description;
//----------------------------------
let ExecuteQuery = QMoyenneParjour;
ExecuteQuery;

3- Erreur:
Query could not be parsed at '>' on line [5,16] Token: '>' Line: 5 Postion: 16

Do you have a solution please Thank you.

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
36,307 questions
0 comments No comments
{count} votes