Create data subsets

A data set is a collection of test data that you've added to Tosca Cloud. These data sets can be quite expansive. If you want to provide your testers with smaller, more manageable data pools, you can create one or more subsets from your data set. This topic tells you how.

Create your subset

It's easy to create a new subset. Simply go to the Test data page and create a query that filters for the data you want in your subset.

You can choose different ways to create queries: 

  • With the search bar. This is a good option if you're experienced with data queries or just need a quick, simple filter. The search bar offers dropdowns and auto-complete to help you craft your query, but you need an understanding of query syntax, especially for nesting groups.

    To use the search bar, simply start typing your query. Select Filter view to see the results, and—if you're happy with them—select Save subset.

  • With the subset builder. This is a good option if you're newer to data queries or have complex, nested queries. Building a query is as simple as choosing options from dropdowns. For an easy overview, the subset builder visualizes filters, groups, and hierarchies in a tree structure.

    To use the subset builder, select Build subset and define your query. Select Filter view to see the results, and—if you're happy with them—select Save subset. Alternatively, if you're confident in your query, you can skip the filter preview and select Save subset directly in the subset builder.

Understand queries

Test data queries consist of filters that define the criteria your data must meet. For example, "Value in column Country is Austria".

You can also create groups of filters. Within these groups, you use conditions to specify how the data should match the filters. For example, if you have three filters, does the data have to match all three filters or—at the very least—one of them?  

Tosca Cloud supports the following conditions:

  • AND defines that data must match all filters in a group. 

  • OR defines that data must match at least one filter in the group. This condition also returns data that matches multiple or all filters.

Filter syntax

To define a filter, use the following syntax:

<column header> <operator> "<expected value>"

The data type of your value determines which operators are available. For example, the operator < is only available for numeric fields.

If you use the subset builder, you don't need to enter quotation marks into the value field. Tosca Cloud adds them automatically. 

Group syntax

How you define a group depends on where you create your query:

  • In the search bar, always start your group with a filter: <filter A> <condition> <filter B>. For example, [City] equals "Vienna" OR [City] equals "Salzburg".

    You can also nest groups. To do so, add parentheses (). For example, [Country] equals "Austria" AND ([City] equals "Vienna" OR [City] equals "Salzburg").

  • In the subset builder, always start your group with a condition. Then, add your filters.

    You can also nest groups. To do so, add a new group to the same level as the element where you want to nest it. This image shows what [Country] equals "Austria" AND ([City] equals "Vienna" OR [City] equals "Salzburg") looks like in the subset builder:

Click to enlarge: A group of City filters is nested in the Country filter

Examples

Let's take a look at a few examples for creating subsets. All examples are based on the following data set:

Example data set in Tosca Cloud

Edit subsets

You can edit subsets in the same way that you can edit data sets. Note that Tosca Cloud applies all changes you make to the subset also to its parent data set. For example, if you delete a row from your subset, Tosca Cloud also deletes the row from the data set.

Additionally, you can add a short description of your subset in the subset's details view. To open the details view, hover over the subset name and select Edit details from thedropdown menu.

What's next

If your test data is good to go, link it to your test cases.