next()

シリアル化された行セットの現在の行の後にある、オフセット位置にある行の列の値を返します。

構文

next(, [ offset,default_value ])

構文規則について詳しく知る。

パラメーター

名前 必須 説明
column string ✔️ 値を取得する列。
offset int 現在の行から移動する行の量。 既定値は 1 です。
default_value スカラー (scalar) 次の行に値がない場合の既定値。 既定値が指定されていない場合は、 null が使用されます。

隣接する行間の比較に基づいてデータをフィルター処理する

次のクエリでは、 の呼び出しの間に 1 秒の 4 分の 1 を超える休憩を示す行が sensor-9返されます。

TransformedSensorsData
| where SensorName == 'sensor-9'
| sort by Timestamp asc
| extend timeDiffInMilliseconds = datetime_diff('millisecond', next(Timestamp, 1), Timestamp)
| where timeDiffInMilliseconds > 250

出力

Timestamp SensorName PublisherId MachineId timeDiff
2022-04-13T00:58:53.048506Z sensor-9 0.39217481975439894 fdbd39ab-82ac-4ca0-99ed-2f83daf3f9bb M100 251
2022-04-13T01:07:09.63713Z sensor-9 0.46645392778288297 e3ed081e-501b-4d59-8e60-8524633d9131 M100 313
2022-04-13T01:07:10.858267Z sensor-9 0.693091598493419 278ca033-2b5e-4f2c-b493-00319b275aea M100 254
2022-04-13T01:07:11.203834Z sensor-9 0.52415808840249778 4ea27181-392d-4947-b811-ad5af02a54bb M100 331
2022-04-13T01:07:14.431908Z sensor-9 0.35430645405452 0af415c2-59dc-4a50-89c3-9a18ae5d621f M100 268
... ... ... ... ... ...

隣接する行間の比較に基づいて集計を実行する

次のクエリでは、 の sensor-9呼び出し間の平均時間差をミリ秒単位で計算します。

TransformedSensorsData
| where SensorName == 'sensor-9'
| sort by Timestamp asc
| extend timeDiffInMilliseconds = datetime_diff('millisecond', next(Timestamp, 1), Timestamp)
| summarize avg(timeDiffInMilliseconds)

出力

avg_timeDiffInMilliseconds
30.726900061254298

次の行のデータを使用して行を拡張する

次のクエリでは、シリアル化 演算子を使用したシリアル化の一環として、次の行のデータを含む新しい列 next_session_type が追加されます。

ConferenceSessions
| where conference == 'Build 2019'
| serialize next_session_type = next(session_type)
| project time_and_duration, session_title, session_type, next_session_type

出力

time_and_duration session_title session_type next_session_type
5月6日(月)午前8:30~10:00 ビジョン 基調講演 - Satya Nadella Keynote 万博セッション
5月6日(月)1:20~1:40 Azure Data Explorer: 高度な時系列分析 万博セッション ブレイク アウト
5月6日(月)2:00~15:00 Azure のデータ プラットフォーム - ペタバイト 規模で最新のアプリケーションとクラウド スケール分析を強化する ブレイク アウト 万博セッション
5月6日(月)午後4:00~4:20 BASF での Azure Data Services の使用方法 万博セッション 万博セッション
5月6日(月)6:50~19:10 Azure Data Explorer: ML モデルを運用化する 万博セッション 万博セッション
... ... ... ...