キャンペーン NQL の例
キャンペーンを組織内で計画、承認取得、テストおよび開始する際のガイドラインは、キャンペーンプログラムの開始ドキュメントを参照してください。
このNQLクエリの例のリストは、キャンペーンに関連するユーザーを選択するのに役立ちます。 以下のクエリを確認し、あなたのユースケースに最も似ているクエリをコピーして、適宜調整してください。
スケジュールされたキャンペーンでユーザーをターゲットにするためのクエリ例\
Retrieve users with installed Collector (xTray) that has been running on their device in the last 24 hours.
users
| include execution.events during past 24h
| where binary.name == "nxtray*"
| compute c1 = binary.name.count()
| where c1 > 0過去1日にMS TeamsまたはZoomをインストールしたユーザーを取得する。
users
| with package.installations during past 1d
| where package.name in [ "MS Teams", "Zoom" ]Retrieve the last user of a device that has had 3 system crashes in the past 7 days.
devices past 7d
| with device_performance.system_crashes past 7d
| compute nb_crashes = count()
| where nb_crashes >= 3
| with session.events past 7d
| compute user_sid = user.sid.last()
| list user_sidIT部門に所属しない、バッテリーの健康状態が悪いデバイスの最後のユーザーを取得する。
devices past 7d
| where remote_action.get_battery_status.execution.outputs.BatteryHealth < 0.3
| with session.events past 7d
| where user.ad.department != "*IT*"
| compute user_sid = user.sid.last()
| list user_sidDEXキャンペーンをスケジュールする
異なる従業員サンプルをランダムに選択して感情データを継続的に収集するために、以下のクエリを設定してください。 #dex_campaign_nameをキャンペーンのNQL IDに置き換え、下記の50として設定されている新しいユーザー数の制限を調整して、キャンペーンが毎時間ターゲットにする新しいユーザーの数を指定してください。
注意が必要な点は以下の通りです:
一般タブでスケジュールトリガーメソッドを定義します。
ターゲット従業員がキャンペーンを受け取るセクションから再度後選択し、従業員ごとの応答間で必要な最小日数を設定します。
以下のNQLクエリを使用する前に、少なくとも一度キャンペーンを保存してください。 これにより、システムがあなたのキャンペーンを認識し、NQLクエリの検証中に_テーブルが存在しません_エラーを回避できます。
users
| include campaign.#dex_campaign_name.responses
| compute number_of_requests = count()
| sort number_of_requests asc
| limit 50キャンペーン結果を検査するためのクエリ例\
すべての応答
Remote Work Demoキャンペーンのすべての応答を表示し、ユーザー名、時間、状態、および状態詳細をそれぞれのユーザーごとに表示する。
campaign.responses
| where campaign.name == "Remote Work Demo"
| list user.name, response.time, state, state_details概要表示
Remote Work Demoキャンペーン応答の概要表示には、キャンペーンのトリガーメソッド、時間、状態、状態詳細とユーザーに対する回答数が含まれる。
campaign.responses
| where campaign.name == "Remote Work Demo"
|list response.trigger_method, user.name, response.time, campaign.response.first_planned, campaign.response.first_targeted, campaign.response.first_displayed, state, state_details, response.number_of_answered_questions状態ごとに応答をカウントする
Remote Work Demoキャンペーンにおける、ユーザー、状態、および状態詳細ごとのキャンペーン応答をカウントする。
campaign.responses
| where campaign.name == "Remote Work Demo"
| summarize cnt = count() by user.name, campaign.response.state, campaign.response.state_details
| list user.name, cnt, campaign.response.state, campaign.response.state_details 特定のユーザーの応答をカウントする
特定のユーザーのキャンペーン、状態および状態詳細`ごとのキャンペーン応答をカウントする。
{% code lineNumbers="true" %}
`
`` campaign.responses | where user.name == "johndoe@DOMAIN" | summarize cnt = count() by campaign.name, user.name, campaign.response.state, campaign.response.state_details | list user.name, campaign.name, cnt, campaign.response.state, campaign.response.state_details
</div>
</details>
<details>
<summary>履歴状態</summary>
`Remote Work Demo`キャンペーンにおけるキャンペーン応答の履歴状態を表示する。
<div data-gb-custom-block data-tag="code" data-lineNumbers='true'>
campaign.responses | where campaign.name == "Remote Work Demo" | list response.historical_time, response.historical_state, response.historical_state_details
</div>
</details>
<details>
<summary>回答または拒否された応答の数をカウントする</summary>
`#my_campaign` NQL IDを持つキャンペーンの回答または拒否された応答の数をカウントする。
<div data-gb-custom-block data-tag="code" data-lineNumbers='true'>
campaign.#my_campaign.responses | where state in [answered, declined] | summarize cnt_responses = request_id.count() by state | list state, cnt_responses
</div>
</details>
<details>
<summary>質問の選択肢ごとに応答の数をカウントする</summary>
`vpn_quality`質問IDを持つ単一選択、意見スケール、またはNPS質問の質問選択肢ごとに応答数をカウントする。
<div data-gb-custom-block data-tag="code" data-lineNumbers='true'>
campaign.#my_campaign.responses | summarize cnt = request_id.count() by answers.vpn_quality.label, state, state_details | sort cnt desc
</div>
</details>
<details>
<summary>特定のキャンペーンに回答したユーザーのリスト</summary>
`#my_campaign` NQL IDを持つキャンペーンに回答したユーザーのリスト。
<div data-gb-custom-block data-tag="code" data-lineNumbers='true'>
campaign.#my_campaign.responses | where state == answered | list user.name, state, state_details, number_of_answered_questions
</div>
</details>
<details>
<summary>特定の選択肢で回答したユーザーのリスト</summary>
List users who answered with the choice labeled as `always` for the question with the `how_often` NQL ID for the campaign with the `#my_campaign` NQL ID.
<div data-gb-custom-block data-tag="code" data-lineNumbers='true'>
campaign.#my_campaign.responses during past 30d | where answers.how_often.label = "always" | list user.name, time
</div>
</details>
<details>
<summary>感情キャンペーンに対する最後の回答を持つユーザーのリスト</summary>
`#service_sentiment` NQL IDを持つ感情キャンペーンに関連する`sentiment`質問IDに対する最後の回答を持つすべてのユーザーのリスト(該当する場合)。
<div data-gb-custom-block data-tag="code" data-lineNumbers='true'>
users | include campaign.#service_sentiment.responses | where state == answered | compute last_satisfaction = answers.sentiment.label.last(), last_answer_on_device = device.name.last() | list user.name, last_satisfaction, last_answer_on_device
</div>
</details>
<details>
<summary>パラメトリックキャンペーンの特定の値を持つパラメータに対する最後の回答を持つユーザーのリスト</summary>
List users with their last answer and comment to the question with the `sentiment` question ID and the `ticket_number` parameter associated with the request for the parametric campaign with the `#ticket_satisfaction` NQL ID, where the parameter value with the `issue_type` ID is `Incident`.
<div data-gb-custom-block data-tag="code" data-lineNumbers='true'>
users | with campaign.#ticket_satisfaction.responses | where state == answered and parameters.issue_type == "Incident" | compute last_satisfaction = answers.sentiment.label.last(), last_comment = answers.sentiment.comment.last(), ticket_number = parameters.ticket_number.last() | list ticket_number, last_satisfaction, last_comment, user.name
</div>
</details>Last updated
Was this helpful?