How to Use the Universal Template
  • 03 Jan 2024
  • 10 Minutes to read
  • Contributors

How to Use the Universal Template


Article Summary

A guide to the Universal Template and how to optimize your feature experience.

NOTE

The Universal Template is a beta feature that is continuously being improved upon. Some capabilities have yet to be added, and we are taking ongoing suggestions from users as they try out this feature. You can add to the discussion on our community post.

The Universal Template is a single experience to build analyses seamlessly. It allows you to switch between visualization types by decoupling query and visualization of the data. The Universal Template supports all analysis types and Tulip data sources (Completions, Table data, and Machine data).

Universal Template Option

Using Queries and Visualizations

The query is like an instruction you give the system detailing what you want it to do with your “raw” data from an App, a machine or in a Tulip Table. The query result is a tabular representation of data created by Tulip Analytics based on how you configured the query. You configure the query on the left side panel of the Analytics Editor.

You can visualize the data from that query with different visualizations, showing all or just selected parts of it. The visualization is selected on the top of the Analytics Editor and further configured in the right side panel of the Analytics Editor.

You can always see the query result below the visualization if you click on Show Query Result unless you have the “Table” visualization selected.

Query Building

Data Source

A data source is what the analysis is built on. You can choose from an app’s completion data, table data, or machine data.

If you are building an analysis for App Completion data, you can select multiple apps. This will make the analysis consider completion records from all selected Apps.

Note that if multiple Apps are selected, data will not be joined, but each completion will be treated as a separate row. This means you will be able to jointly analyze the "Fields" of the completions (e.g. User, Start Time and Station). Other data like App Variables will be treated separately for each App and have “null” as the value for the completion records of all other apps.

If you are building an analysis for machines, you can select one or multiple machine types. If you want to build an analysis for a specific machine, add an additional filter.

Groupings and Operations

Groupings and operations are the core areas of building your query. This is where you define which of your data options you want to show and in what form.

Groupings

Groupings give an instruction in order to combine the groups as much as possible. If you are familiar with the GROUP BY function in common QL and BI tools, the grouping process behaves nearly identically. Groupings determine the fields and types of data to find similar values. They enable you to get a more and more granular view of the data that you want to see.

Groupings give more control to define which rows should be combined. A grouping can be any field of any type. Depending on which operations you have configured, adding one or multiple groupings will lead to different outcomes.

Let’s go through a few grouping combinations.

One GroupingMultiple Groupings
Only Distinct ValuesOne row for each row in the source data showing the values for the grouping field and the distinct values for that rowOne row for each row in the source data showing the values for the grouping fields and the distinct values for that row
Only AggregationsOne row for each distinct entry in the grouping field with that value for the grouping and the aggregated values of all rows from the source data with that grouping valueOne row for each combination of the groupings fields distinct entries with the respective values for the groupings and the aggregated values of all rows from the source data with the respective grouping values
Distinct values and aggregationsOne row for each row in the source data showing the values of the groupings and the distinct values and the aggregated values of all rows from the source data with that grouping value (i.e. the aggregated values are the same across all rows with the same grouping value)One row for each row in the source data showing the values of the groupings and the aggregated values of all rows from the source data with the respective grouping values (i.e. the aggregated values are the same across all rows with the same grouping values)

It’s important to note that data will only be shown if a row with any relevant information exists. If there is no data in the source data for a specific day, the analysis will appear blank.

Let’s look at an example of how groupings work:
Universal Template Groupings Table Ex

Data from this table shows that there are 10 records labeled “sample_0”. All but one of those sample_0 data points have no defects.
If we want to group this data into a visualization that only shows different sample_0 points where the defect count differs, we can use groupings to combine like data sets.

Universal Template Groupings Ex

Operations

Operations can either be an aggregation which combines multiple records or a field, which does not.

Operations come in two general categories:

  1. Distinct values
    Distinct values represent individual data points from your source data. In the simplest case this is one value of a variable from a completion record, a field from a table, or a machine attribute.

But this can also be a more advanced data point, like the sum of two fields from the same record, a combination of multiple strings, or an expression that does not include an aggregation function.

Using a table containing a field of values (numeric) and a field of timestamps (datetime), we can visualize the values by timestamp to appear as such:

Universal Template Operations Distinct Values Ex

  1. Aggregations

Aggregations are functions that take data from multiple rows and combine them based on set logic. There is a set of aggregation functions available as preconfigured selections, or you can also use aggregation functions within the expression editor to build your own advanced aggregations. Different aggregation functions work for different data types. See below which functions are available and which data types they support.

Directly Accessible Aggregation Functions
These allow the combining of rows:

  • Average
  • Median
  • Sum
  • Minimum
  • Maximum
  • Mode
  • Standard Deviation
  • 95th Percentile
  • 5th Percentile
  • Ratio
  • Ratio Complement

Aggregation Functions Available in the Expression Editor

Aggregation functions in the expression editor can provide more granular data based on your specific requirements. For a complete guide to all the available expressions you can use in your analyses, see Full List of Expressions in the Analytics Editor.

Limit and Sorting

You can define the maximum number of rows that the query result contains by adding a limit. With limits, you can focus on specific data or cap the amount of data shown in a chart. For example, you can add a limit to show the three production lines which had the most defects in the past month.

The sorting data defines which rows are included when evaluating the limit. You can add ascending or descending sorting for any field that’s part of the query result. If you add multiple fields for sorting, the data will be sorted by the first one first. The resulting groups for each value of the first field will then be sorted by the second etc.

Note that if you do not define sorting explicitly, the sorting of your query result might vary based on the available data. When using limiting or charts with ordinal axes, this can lead to varying visualizations. We recommend adding an appropriate sorting in those cases.

The following example uses the graph we saw using Operations. Here, we limit the results to 100 data points and sort them in descending order based on their datetime.

Universal Template Limit and Sorting Ex

As the data source (the table) updates with new records, the visualization will only show the 100 most recent ones.

Date Range

The date range defines what data is included in the evaluation of the analysis. Think of this like a filter for a datetime value in the data set. The date range restricts the analysis to the data that is relevant for a specified period of time.
For performance reasons, we recommend using the shortest date range possible for your use case instead of adding additional filters later to narrow down the time.

The following datetime values are used for the Date Range for the various data sources:

  • App Completion Data
    • “Start Time” of the app Completion
  • Table Date, user selectable
    • Date Created
    • Date Updated
  • Machine Data
    • Start Time of machine activity entry

Filters

Filters define which data to include in the query result.
Typical use cases include:

  • Showing data for only a specific production line
  • Excluding a specific machine from an analysis
  • Showing only data points with a value higher than a specific threshold

Filters are configured like a condition. All data that fulfills the condition is included in the analysis. Let’s look at some examples:

  • Production Line equals A

    • Will include all records that have “A” in the “Production Line” field
  • Machine ID does not equal “Machine 1”

    • Will include all machines that are not equal to “Machine 1”
  • Testing Duration > 55

    • Will include all records where the testing took longer than 55 seconds

Filters can be defined in two different ways:

  1. Using the preconfigured filter functions in combination with a field from your source data
  2. Configuring an expression that evaluates to a boolean.

Visualization Options

Bar/Line/Scatter

QueryVisualization
One numeric operationSingle series chart. Row index on x-axis.
One grouping and one numeric operationSingle series chart. Grouping values on x-axis.
Two groupings and one numeric operationMulti-series chart. 1st grouping on x-axis, operation is on the y-axis, and 2nd grouping used to split operation in series.
Two or more numeric operationsMulti-series chart. One series per operation. Row index on x-axis.
One grouping and two or more numeric operationsMulti-series chart. One series per operation. Grouping values on x-axis.

With a bar chart, you can toggle between a stacked or unstacked chart to create a comparison view.

Histogram

QueryVisualization
One numeric operationHistogram of the resulting values for that operation
One numeric operations and one other operationsHistogram of the resulting values for the first operation grouped by the values of the second operation

Donut

QueryVisualization
One numeric operationDonut chart of values of numeric operation. Row index as labels.
One groupings and one numeric operationDonut chart of values of numeric operation. First grouping as labels

Gauge or Single Value

QueryVisualization
One operationValue from first row of first operation
One groupingValue from first row of first grouping

Box

QueryVisualization
One numeric operationBox Plot of values of operation
One grouping and one numeric operationBox plots by values of grouping
NOTE

This chart does not regard the sorting defined in the query.

Slideshow

Image fields/variables selected for operations are shown in the slide show, whereas any other fields/variables are shown below the slideshow for each image.

Pareto

QueryVisualization
One numeric operationPareto chart of operation, using row index for x axis
One grouping and one numeric operationPareto chart of operation, using grouping for x axis
NOTE

This chart does not regard the sorting defined in the query.

Table

Shows all values from the query.


Did you find what you were looking for?

You can also head to community.tulip.co to post your question or see if others have faced a similar question!


Was this article helpful?