この文章は Salesforce 機械翻訳システムを使用して翻訳されました。詳細はこちらをご参照ください。
英語に切り替える

ウィンドウを使用して上位 5 人の営業担当を動的に表示する

ウィンドウ関数は特定の動的範囲にわたる計算を実行します。

例 - 上位 5 人の営業担当を動的に表示する

ウィンドウを使用して、国ごとに上位 5 人の営業担当を動的に表示するグラフを作成します。このグラフは商談の成立に応じて継続的に更新されます。例では、ウィンドウを使用して次の計算が実行されます。
  • 総額に対する各営業担当の貢献の割合 (国別)
  • 営業担当の貢献ランキング (国別)
これらの計算を使用して、各国の上位 5 人の営業担当を表示できます。
1q = load "DTC_Opportunity_SAMPLE";
2q = group q by ('Billing_Country', 'Account_Owner');
3
4q = foreach q generate 'Billing_Country', 'Account_Owner', 
5
6-- sum(Amount) is the total amount for a single rep in the current country
7-- sum(sum('Amount') is the total amount for ALL reps in the current country
8-- sum(Amount) / sum(sum('Amount') calculates the percentage that each rep contributed
9-- to the total amount in the current country
10((sum('Amount')/sum(sum('Amount')) 
11
12
13-- [..] means "include all records in the partition"
14-- "by Billing_Country" means partition, or group, by country
15over ([..] partition by 'Billing_Country')) * 100) as 'Percent_AmountContribution', 
16
17-- rank the percent contribution and partition by the country
18rank() over ([..] partition by ('Billing_Country') order by sum('Amount') desc ) as 'Rep_Rank';
19
20-- filter to include only the top 5 reps
21q = filter q by 'Rep_Rank' <=5;

作成されたグラフには、各国の上位 5 人の営業担当と、各営業担当のランキングが表示されます。

ミーティングデータセットを表示している図。