lmo*_*ale 6 azure-application-insights
我正在尝试编写一个查询,该查询将获取两个自定义事件之间的平均时间(按用户会话排序)。我在整个应用程序中添加了自定义跟踪事件,我想查询用户从“设置”事件到“处理”事件所需的时间。
let allEvents=customEvents
| where timestamp between (datetime(2019-09-25T15:57:18.327Z)..datetime(2019-09-25T16:57:18.327Z))
| extend SourceType = 5;
let allPageViews=pageViews
| take 0;
let all = allEvents
| union allPageViews;
let step1 = materialize(all
| where name == "Setup" and SourceType == 5
| summarize arg_min(timestamp, *) by user_Id
| project user_Id, step1_time = timestamp);
let step2 = materialize(step1
| join
hint.strategy=broadcast (all
| where name == "Process" and SourceType == 5
| project user_Id, step2_time=timestamp
)
on user_Id
| where step1_time < step2_time
| summarize arg_min(step2_time, *) by user_Id
| project user_Id, step1_time,step2_time);
let 1Id=step1_time;
let 2Id=step2_time;
1Id
| union 2Id
| summarize AverageTimeBetween=avg(step2_time - step1_time)
| project AverageTimeBetween
Run Code Online (Sandbox Code Playgroud)
当我运行此查询时,它会产生以下错误消息:
'' 运算符:无法解析名为“step1_time”的表或列或标量表达式
我对使用人工智能编写查询相对较新,并且没有找到很多资源来帮助解决这个问题。预先感谢您的帮助!
我不确定这些let 1id=step1_time线的用途是什么。
这些行试图声明一个新值,但 step1_time 不是一个东西,它是另一个查询中的一个字段
我也不确定你为什么要这样做pageviews | take 0并将其与事件结合起来?
let allEvents=customEvents
| where timestamp between (datetime(2019-09-25T15:57:18.327Z)..datetime(2019-09-25T16:57:18.327Z))
| extend SourceType = 5;
let step1 = materialize(allEvents
| where name == "Setup" and SourceType == 5
| summarize arg_min(timestamp, *) by user_Id
| project user_Id, step1_time = timestamp);
let step2 = materialize(step1
| join
hint.strategy=broadcast (allEvents
| where name == "Process" and SourceType == 5
| project user_Id, step2_time=timestamp
)
on user_Id
| where step1_time < step2_time
| summarize arg_min(step2_time, *) by user_Id
| project user_Id, step1_time,step2_time);
step2
| summarize AverageTimeBetween=avg(step2_time - step1_time)
| project AverageTimeBetween
Run Code Online (Sandbox Code Playgroud)
如果我删除我不理解的东西(比如与 0 页面浏览量的联合,以及让,我得到结果,但我没有你的数据,所以我不得不使用“设置”和“进程”之外的其他值,所以不知道是不是你所期待的呢?
您可能想查看查询结果step2而不进行摘要,以便仅查看您得到的结果是否与您的期望相匹配。
| 归档时间: |
|
| 查看次数: |
20471 次 |
| 最近记录: |