Building Your First Model

Get started creating your first model and preparing data.


Models complement datasets. Datasets are more suitable for ad-hoc analysis, while models are more suitable for governed-data use cases.

If you're not sure whether to use a dataset or a model for your story, this might help you decide: Models vs. Datasets.

If you're more interested in datasets, not models, see Datasets.

What is a model and why do I need to create one?

A model is a representation of large amounts of business data, using common business terminology. For example, if you run a retail clothing business, your data might include:

  • Quantities of each clothing type sold
  • Prices of the clothing items
  • Item descriptions and ID numbers
  • Order dates
  • Customer names, ID numbers, and locations
A sample of data for a retail clothing business

This figure shows a CSV file containing a very small amount of data. Typically, your business would generate thousands of rows of data. Therefore, instead of trying to work directly with large amounts of data, which might require you to use a database query language such as SQL, you define measures and dimensions that represent your business data, and you work with those in the application.

Measures represent quantities that provide meaning to your data. For example, sales revenue, salary, or number of employees. Dimensions represent categories that provide perspective on your data. For example, product category, date, or location.

For the above data sample, you could create a measure named Sales, and dimensions named Customers, Products, and Date. These measures and dimensions make up the model.

Still not clear? Keep reading to see how you'll bring your business data into SAP Analytics Cloud, and how you'll create dimensions and measures.

There are two types of models in SAP Analytics Cloud:

  • Analytics models.
  • Planning models.

Why are there two types of models?

Analytics models are full-featured models that contain your business data. They're the more flexible type of model. You'd typically use an analytics model if you want to analyze your data, looking for trends and anomalies.

Planning models are preconfigured to help you perform business planning tasks such as forecasting. When working with this type of model in a story, planning users can use a variety of features to update values in the model, and create new values.

See Planning Models and Analytic Models for more information about model types.

Now that you know a bit about models, let's get started!

Create a New Model by Importing Data From a File or From a Data Source

With SAP Analytics Cloud, you can bring in data from a wide variety of cloud-based and local data sources. For this guide, let's use the small CSV file shown above.

Download the CSV file here to follow along (unzip to find and then unzip again).

  1. From the () Main Menu, select Start of the navigation path Create Next navigation step  ModelEnd of the navigation path.

    You'll see the available options for bringing data into a model. Because we're going to import our data from a CSV file, choose Import a file from your computer.

  2. Specify whether the file you're importing is in your local system (that is, a file on your computer's hard disk drive), or is located on a network file server.

    Trial users won't see the File Server option.

    For our case, choose Local System. Then, click Select Source File, and choose the CSV file.

    CSV files can use commas or other characters as delimiters. You can tell the application which delimiter character is used in the CSV file (commas, in our case), or let the application detect the delimiter by itself.

  3. Specify whether the first row of data contains column headers. Our data does contain column headers, so select the Use first row as column headers option.
  4. Select Import to import the raw CSV data.

    You can continue to work on other tasks while the dataset is being uploaded in the background. When the draft data is finished uploading, open it from the Draft Data list.

    The data is displayed in a table, showing the imported data columns that you'll define as dimensions, measures, and attributes.

    The columns in the table represent the columns that were in the CSV file. Because we earlier selected the Use first row as column headers option, the table has a header row that matches the first row in the CSV file.

    SAP Analytics Cloud tries to figure out which types of data the columns contain. For example, you can see that the Unit_Price and Sales columns have been defined as measures .

    If the automatically selected column type isn't appropriate though, you can change the column type. We'll see an example in a later step.

Define Meaningful Dimensions and Measures

Now that the raw data is imported, we can define dimensions and measures.

  1. Have a look at the information provided in the Details panel. When it first appears, the panel shows you information about your dataset as a whole. If you select a column in the table, the Details panel shows information about just that column.

    For example, if you select the Order_Date column, you'll see the column type Dimension, and information about the data quality and distribution.

    In this case, the column has been identified as a generic dimension, which isn't correct, because this column represents dates. Let's change the column type.

    For Trial users, the Order_Date column will already be defined as a Date dimension. You can experiment with the dimension type options if you want; otherwise, skip the next step.
  2. In the Details panel, under Type, change the column type to Date.

    This defines the column as a Date dimension.

    We'll leave the dimension types chosen for the other columns unchanged for now.

Cleanse Your Data and Fix Any Mapping or Data Quality Problems

Why is there now a highlighted cell?

The highlighted cell indicates that there's an issue with the cell value. You can see in the Details panel that the time format for that cell is invalid.

  1. To resolve the issue, select the cell and choose an option for correcting the cell value. In this case, select Start of the navigation path (Smart Transformations) Next navigation step Replace value withEnd of the navigation path.

  2. Type a new value in the formula bar and press Enter.

Specify Attributes for the Dimensions

The data quality issues have now been resolved, and the dimensions and measures are correctly defined. The next thing we need to do is define a dimension attribute.

  1. The column Material doesn't represent a separate dimension; it represents an attribute of the Product_Item column. To define the column as an attribute, select the Product_Item column, and then in the Details panel, select Start of the navigation pathAdd Dimension Attributes Next navigation step PropertyEnd of the navigation path.

  2. Under the Property heading, select Material.

    If you now select the Material column in the table, you'll see in the Details panel that the column is now defined as a property of the Product_Item dimension.

Create a Hierarchy

Often, data is hierarchical. For example, in a large global organization, you might have a Location hierarchy, consisting of continents, countries, and cities.

In our example, we'll define a parent-child hierarchy for the clothing items. (For detailed information about hierarchies, including level-based hierarchies, see Hierarchies.)

  1. Select the Product_Item column. Similar to before when we defined another column as a property, this time select Start of the navigation pathAdd Dimension Attributes Next navigation step Parent-Child Hierarchy (Parent)End of the navigation path.

    For Trial users, the text may be slightly different.
  2. Under the Parent-Child Hierarchy (Parent) heading, select Product_Line.

    You'll see that the Product_Line column is now defined as the parent of the Product_Item dimension.

  3. Select Create Model, and then name and save your model.
Every model is based on an Account dimension. Since we didn't define one explicitly during the above steps, an Account dimension is set up for us automatically, but we can modify it in the Modeler later. For more information, see About Dimensions and Introduction to the Modeler.
Additional Help Resources

Congratulations! You've created your first model! Now you'll want to create stories and analyze your data. Check out our getting started guides to Creating Your First Story and Getting Started with Planning.