Sigma for Organizations招待のみ
組織に属するアカウント全体のデータをクエリします。
If you use Stripe Organizations to unify your business across multiple Stripe accounts, you can run Sigma queries across multiple accounts with Sigma for Organizations. Using Sigma queries allows you to gain insights about your customers and payments across your entire business in the Dashboard.
始める
開始する前に、以下の手順を実行します。
- 組織を作成し、クエリに含めるすべてのアカウントを追加します。
- クエリに含める各アカウントで、Sigma を有効にします。
- Make sure that you’re assigned a role at the organization-level with permissions to view reports (such as Analyst) to run and execute Sigma queries.
複数のアカウントに対して Sigma クエリを実行する
組織の複数のアカウントに渡る Sigma クエリを実行するには、以下の手順を実行します。
- ダッシュボードで、アカウントの選択機能から組織に切り替え、Sigma をクリックします。
- 新しいクエリを作成し、保存されたクエリから選択するか、テンプレートのリストから選択します。
- To specify the accounts in scope of your query, click the Run on accounts dropdown in the top right corner, then click Edit business accounts.
- 選択したアカウント全体にクエリを実行します。
アカウントごとに結果を返す
デフォルトでは、クエリでは、選択されたすべてのアカウントに関するデータが含まれた結果が返されます。アカウントごとに結果を返すには、merchant_id
で結果をグループ化します。たとえば、以下のクエリは、各アカウントと通貨について、過去 14 日間の支払いインテントの合計を返します。
select merchant_id, currency, sum(amount) as total_payment_volume_last_14d from payment_intents where created >= date_add('day', -14, current_date) group by 1, 2
merchant_id | currency | total_payment_volume_last_14d |
---|---|---|
acct_6kwrIvBSEETWvNK | USD | 4934823 |
acct_WK5eNvwmYqXFmUq | CAD | 2235991 |
acct_0FPHJNnz6T2ubcR | GBP | 1870021 |
acct_PY0ucJQJTZCXWS2 | EU | 9008212 |
クエリ内のアカウントをフィルタリングする
merchant_id
フィールドを使用して、クエリで結果を特定のアカウントに直接フィルタリングするには、WHERE merchant_id = 'acct_id'
句を追加します。たとえば、以下のクエリは、特定のアカウントの支払い総額を返します。
select currency, sum(amount) as total_payment_volume_last_14d from payment_intents where created >= date_add('day', -14, current_date) AND merchant_id in ( 'acct_d8upQPPBbFtSIe1', 'acct_1fCSEPk3waoDZox' ) group by 1
currency | total_payment_volume_last_14d |
---|---|
USD | 8833809 |
CAD | 9008212 |