Compare

It is possible to compare data points from accounts either individually or as aggregated anonymized datasets of peers, through either the built-in compare dashboard, or API end points.

Each data point is associated to

  • an account
  • a question
  • a date

Questions typically represent different metrics that do not make sense to aggregate together, even when they have the same unit. Results are also typically retrieved for one specific date range. In the products djaopsp is used, most of the variation in comparaison queries stem from how accounts are selected.

The overall workflow of a compare query can be represented as such:

Compare API endpoints follow this basic URL structure:

endpoints
GET /api/accounts-selector-algorithm/{accounts-selector-id}/{questions-prefix}?start_at=start-date&ends_at=end-date

returns

      {
        "labels": [
            "{accounts-selector-id}"
        ],
        "results": [
          {
              "path": "{question-path}",
              "values": [
                [
                  {
                    "unit": "{unit-slug}",
                    "measured": {value},
                    "created_at": "date"
                  }
                ]
              ]
          }
        ]
      }
      

The above JSON schema makes it straightforward to display the response returned by a compare API endpoint as a table where questions are in rows, accounts are in columns, and each cell contains the individual value, or the value aggregated over a time period.

The different ways to select accounts, pick a subset of questions, and specify a time period are detailed below.

Selecting accounts

Selecting an individual account

The simplest is when you are interested in an individual account. Assuming that account has shared their answers with your profile, you can retrieve those answers with the following API end points:

Selecting an individual account

The first API call returns the list of accessible responses. The second API call returns a specific response.

Selecting a nominative set of accounts

When you have multiple accounts explicitely selected to be part of a group, you would first need to create a group, then add specific accounts to be part of the group.

This translates into the following API end points:

Creating a set of nominative accounts
# 1. Create the group
POST /api/{profile}/filters/accounts
# 2. Add accounts to the group
POST /api/{profile}/filters/accounts/{editable_filter}
# 3. Retrieve the aggregated answers for the group
GET /api/{profile}/benchmarks/{editable_filter}

Selecting accounts by affinity

You have access to annonimized aggregated datasets. For example, one such dataset is "accounts engaged through an alliance your profile belongs to".

The following affinity datasets are available:

Engaged
Profiles you have requested a response from at a specified point in time. These are profiles that typically appear on the Engage dashboard.
Tracked
Profiles for which you have access to their responses on the platform. These are profiles that typically appear on the Track dashboard.
Subscribed to {plan}
Profiles which have an active subscription to a plan your profile provides. This dataset is typically useful when you want to assess the performace of a certain subset of members in your alliance.
Federated through {alliance}
Profiles which have been engaged through one of your member peers in an alliance This dataset is typically useful when you want to assess the performace of your organization against other members.
All
All profiles which responsed on the platform.

Selecting accounts by answers

You can create a filter to select all accounts that have a specific answer to a question. For example: "all Small and Medium Business (SMB) suppliers".

This translates into the following API end points:

Creating an implicit set accounts based on answers
# 1. Create the implicit set
POST /api/{profile}/filters/questions
# 2. Add selectors to the implicit set
POST /api/{profile}/filters/questions/{question_filter}
# 3. Retrieve the aggregated answers for the implicit set of accounts
      GET /api/{profile}/reporting/segmented/{question_filter}/{campaign}/{path}?start_at,ends_at
      GET /api/{profile}/reporting/federated/{alliance}/segmented/{question_filter}/{campaign}/{path}?start_at,ends_at
      GET /api/{profile}/reporting/subscribers/segmented/{question_filter}/{campaign}/{path}?start_at,ends_at
      GET /api/{profile}/reporting/subscribers/plan/{plan}/segmented/{question_filter}/{campaign}/{path}?start_at,ends_at

Selecting questions

- individual - campaign/prefix

Selecting dates

- by date range - by age


Need help?
Contact us
Curious how it is built?
Visit us on GitHub