組織に属するアカウント間でのデータのクエリ公開プレビュー
Organizations で Sigma を使用して、複数のアカウントにクエリを実行します。
If you use Organizations, you can use Sigma to run queries across multiple accounts. These queries can provide insight into your customers and payments across your entire business.
Get started
開始する前に、以下の手順を実行します。
- Create an organization, adding all the accounts you want to include in your queries.
- クエリに含める各アカウントで、Sigma を有効にします。
To run and execute Sigma queries, you must be assigned an organization-level role with permissions to view reports, such as Analyst.
複数のアカウントに対して Sigma クエリを実行する
組織の複数のアカウントに渡る Sigma クエリを実行するには、以下の手順を実行します。
From the Dashboard, use the account picker to select your organization. Expand Reporting, then click Sigma.
新しいクエリを作成し、保存されたクエリから選択するか、テンプレートのリストから選択します。
To specify the accounts you want to run your query on, click Run on accounts, then Select accounts.
選択したアカウント全体にクエリを実行します。
アカウントごとに結果を返す
By default, queries return results that include data across all selected accounts. To return results for each account, you can group results by merchant_
. For example, the following query returns the sum of Payment Intents in the last 14 days for each account and currency:
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_ | currency | total_ |
---|---|---|
acct_zOFoZeTl82Au5AR | USD | 4934823 |
acct_j8A07SfOWgbkCPQ | CAD | 2235991 |
acct_1cTI8wMTBbKkTqD | GBP | 1870021 |
acct_GVbNVUXziuHr4Er | EU | 9008212 |
クエリ内のアカウントをフィルタリングする
merchant_
フィールドを使用して、クエリで結果を特定のアカウントに直接フィルタリングするには、WHERE merchant_
句を追加します。たとえば、以下のクエリは、特定のアカウントの支払い総額を返します。
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_ |
---|---|
USD | 8833809 |
CAD | 9008212 |