Skip to content

Help make the extensions Marketplace better for everyone. Take this survey!

| Marketplace
Sign in
Visual Studio Code>Snippets>GoodData (beta)New to Visual Studio Code? Get it now.
GoodData (beta)

GoodData (beta)

GoodData

gooddata.com
|
60 installs
| (0) | Free
GoodData extension for VS Code. Create and manage analytics from code.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

GoodData for VS Code

GoodData for VS Code is available for you to try out and provide feedback. Avoid using GoodData for VS Code in a production environment.

Manage your analytics as code directly from Visual Studio Code.

GoodData for VS Code consists of two components:

  • GoodData Visual Studio Code Extension.
  • GoodData Command-line Interface.

Together these tools allow you to:

  1. Retrieve analytical objects from a GoodData server.
  2. Create or update analytical objects in Visual Studio Code.
  3. Test analytical objects locally in Visual Studio Code.
  4. Deploy analytical objects to a GoodData server of your choice.

The analytical objects you can work with include datasets, which form the logical data model, and metrics. Additionally, we have plans to incorporate support for visualizations in the near future.

By adopting a code-based approach to your analytics, you gain the following benefits:

  • Version your analytics by committing your code to a git version control system.
  • Implement automatic tests to ensure the quality and reliability of your analytics solutions.

Prerequisites

Before getting started, ensure that you have:

  • A running instance of GoodData. Ensure you have the following information on hand:
    • API access token.
    • Workspace ID of a workspace you want to clone and edit.
    • Data source ID of the data source the workspace is connected to
  • Visual Studio Code installed.
  • Node.js version 16.17 or newer installed.

Install VS Code Extension

Start by installing GoodData Visual Studio Code Extension (VS Code Extension) that provides tools for developer effectiveness, such as IntelliSense, syntax highlighting, and validation.

Steps:

  1. Open extensions tab in your VS Code.
  2. In the search bar, look for "GoodData".
  3. Select the GoodData extension and install it.

Install CLI

Now you will install GoodData Command-line Interface (CLI) that will let you sync your local working directory with the GoodData server. In terminal, run npm i -g @gooddata/code-cli. You should have a new CLI command available, try running gd -v or gd --help.

Initialize Project

Once the CLI is installed you are able to initialize your project locally.

Steps:

  1. Open a terminal and navigate to a folder where you want to build and store your analytics.
  2. To initialize your project, run gd init and follow the instructions to create a gooddata.yaml definition file.
  3. Create a .env file in the same folder as gooddata.yaml and add an environmental variable that stores your API access token. For example:GD_API_TOKEN="fd6f9a71541856b4c9617f74a8576e131".
  4. To clone your GoodData analytical environment to your local machine, run gd clone.

Make sure you do not store the .env file in you version control system (like Git). For example, you can add the file to .gitignore.

You should now have an analytics folder that contains your datasets and metrics.

Create and Test a New Metric

Create a new analytical object and run it directly from VS Code.

Steps:

  1. Create a new yaml file in your metrics folder to represent your new metric. For example revenue_per_customer.yaml.
  2. Define a metric:
    type: metric
    id: revenue_per_customer
    
    title: Revenue per Customer
    description: The average revenue generated by each customer
    
    maql: SELECT AVG(SELECT {metric/revenue} BY {label/customer_id})
    
    Notice the Run button appearing above the type property in the YAML file.
  3. Click the Run to run your metric on the data source that you defined when initializing your gooddata.yaml project configuration file to verify your metric works as designed.
  4. Save the file.

Deploy Your Changes

To deploy your project to a GoodData server, ensure all your changes are saved and run gd deploy.

Your changes will be deployed to the hostname and workspace you defined in the gooddata.yaml definition file.

  • Contact us
  • Jobs
  • Privacy
  • Terms of use
  • Trademarks
© 2023 Microsoft