Build an OLAP Cube in SSAS from Alchemy Data

Jerod Johnson
Jerod Johnson
Director, Technology Evangelism
Establish a connection to Alchemy data data from SQL Server Analysis Services, and use the Alchemy Data Provider to build OLAP cubes for use in analytics and reporting.

SQL Server Analysis Services (SSAS) serves as an analytical data engine employed in decision support and business analytics, offering high-level semantic data models for business reports and client applications like Power BI, Excel, Reporting Services reports, and various data visualization tools. When coupled with the CData API Driver for ADO.NET, you gain the capability to generate cubes from Alchemy data, facilitating more profound and efficient data analysis.

In this article, we will guide you through the process of developing and deploying a multi-dimensional model of Alchemy data by creating an Analysis Services project in Visual Studio. To proceed, ensure that you have an accessible SSAS instance and have installed the ADO.NET Provider.

Creating a Data Source for Alchemy

Start by creating a new Analysis Service Multidimensional and Data Mining Project in Visual Studio. Next, create a Data Source for Alchemy data in the project.

  1. In the Solution Explorer, right-click Data Source and select New Data Source.
  2. Opt to create a data source based on an existing or new connection and click New.
  3. In the Connection Manager, select CData API Driver for ADO.NET, enter the necessary connection properties, and click Next.

    Start by setting the Profile connection property to the location of the Alchemy Profile on disk (e.g. C:\profiles\Alchemy.apip). Next, set the ProfileSettings connection property to the connection string for Alchemy (see below).

    Alchemy API Profile Settings

    Alchemy uses API key authentication. The API key is supplied in the request URL path. To obtain an API key:

    1. Sign in to your Alchemy account at https://dashboard.alchemy.com.
    2. Open an existing app or create a new one.
    3. Copy the app's API key from the API Key dialog.

    After obtaining your API key, set the following connection properties:

    • AuthScheme: Set this to APIKey.
    • Network: Optional. The blockchain network slug for NFT API requests (for example, eth-mainnet, base-mainnet, polygon-mainnet). Defaults to eth-mainnet.

    Set the following in the ProfileSettings connection property:

    • APIKey: Set this to your Alchemy app API key.

    When you configure the connection, you may also want to set the Max Rows connection property. This will limit the number of rows returned, which is especially helpful for improving performance when designing reports and visualizations.

    Setting the Connection properties (Salesforce is shown.)
  4. Set the impersonation method to Inherit and click Next. Setting the impersonation method.
  5. Name the data source (CData Alchemy Source) and click Finish.

Creating a Data Source View

After you create the data source, create the data source view.

  1. In the Solution Explorer, right-click Data Source Views and select New Data Source View.
  2. Select the data source you just created (CData Alchemy Source) and click Next.
  3. Choose a foreign key match pattern that matches your underlying data source and click Next. Selecting the Foreign key match pattern.
  4. Select Alchemy tables to add to the view and click Next. Selecting Tables (Salesforce is shown).
  5. Name the view and click Finish

Based on the foreign key match scheme, relationships in the underlying data will be automatically detected. You can view (and edit) these relationships by double clicking Data Source View.

Discovered relationships in the data source view (Salesforce is shown).

Note that adding a secondary data source to the Data Source View is not supported. When working with multiple data sources, SSAS requires both sources to support remote queries via OpenRowset which is unavailable in the ADO.NET Provider.

Creating a Cube for Alchemy

The last step before you can process the project and deploy Alchemy data to SSAS is creating the cubes.

  1. In the Solution Explorer, right-click Cubes and select New Cube
  2. Select "Use existing tables" and click Next.
  3. Select the tables that will be used for measure group tables and click Next. Selecting measure group tables (Salesforce is shown).
  4. Select the measures you want to include in the cube and click Next. Selecting measures (Salesforce is shown).
  5. Select the dimensions to be created, based on the available tables, and click Next. Selecting dimensions (Salesforce is shown).
  6. Review all of your selections and click Finish.

Process the Project

With the data source, data source view, and cube created, you are ready to deploy the cube to SSAS. To configure the target server and database, right-click the project and select properties. Navigate to deployment and configure the Server and Database properties in the Target section.

Configuring the target server and database.

After configuring the target server and database, right-click the project and select Process. You may need to build and deploy the project as a part of this step. Once the project is built and deployed, click Run in the Process Database wizard.

Now you have an OLAP cube for Alchemy data in your SSAS instance, ready to be analyzed, reported, and viewed. Get started with a free, 30-day trial of the CData API Driver for ADO.NET.

Ready to get started?

Connect to live data from Alchemy with the API Driver

Connect to Alchemy