我只想在图表上显示工作日期(例如,我想从聊天中排除第二个、第四个星期六和所有星期日日期。)
我有一个数据,需要将其投影到图表上...我创建了一个表格,其中指定了整个周末,现在我只想在图表上投影工作日日期,不想在图表上看到周末。
| where name has "samplelog"
| extend Eventdate = strcat(datetime_part("day",timestamp))
| extend day_strg = tostring(Eventdate)
| extend day_num = dayofweek(timestamp) / 1d
| extend Week_Num = case(day_strg in (range(1, 7, 1)), "1", day_strg in (range(8, 14, 1)), "2",day_strg in (range(15, 21, 1)), "3",day_strg in (range(22, 31, 1)), "4", "0")
| extend weekend = iff(Week_Num in (2,4) and day_num == 6 or day_num == 0, "weekend", "working day")```
i have a data which i need to project it on chart...i have created a table where i have specified the all weekend now i want only to project working days dates on chart and dont want see weekend on chart.
| where name has "samplelog"
| extend Eventdate = strcat(datetime_part("day",timestamp))
| extend day_strg = tostring(Eventdate)
| extend day_num = dayofweek(timestamp) / 1d
| extend Week_Num = case(day_strg in (range(1, 7, 1)), "1", day_strg in (range(8, 14, 1)), "2",day_strg in (range(15, 21, 1)), "3",day_strg in (range(22, 31, 1)), "4", "0")
| extend weekend = iff(Week_Num in (2,4) and day_num == 6 or day_num == 0, "weekend", "working day")```
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
要过滤某些特定值,您必须使用 Where 条件
遵循解决方法
在您的代码中,我添加了 Where 条件 来过滤
查询中添加的更改
我
可以看到仅工作日结果
For filtering some specific values you have to use the Where condition
Follow the workaround
In your code, I have added the Where condition to filter
Changes added in your query
Results
I can see only the working days result