Using Quick Transforms to Apply Analytical Functions to Data Fields


With Quick Transforms, you can easily apply the most commonly used analytical functions to measure fields in your chart. This allows you to quickly specify a function for a field as you create your chart, expanding your options for incorporating aggregated data.

Quick Transforms are robust and support a variety of functions. Quick Transforms create post-aggregation (COMPUTE) virtual fields. A calculated value (COMPUTE) is evaluated after all of the data that meets the selection criteria is retrieved, sorted, and summed. This means that the calculation is performed using the aggregated values of the fields.

For example, you can perform an aggregation or standard deviation (both COMPUTEs) on a measure field. This makes it easy to perform the calculations you need with just a few clicks. You can do this from the shortcut menu on the measure field that you have placed in the Vertical bucket (placing a measure in the Horizontal bucket creates entries for each underlying value). In this case, you do not have access to the Quick transform option.

Other examples include the use of the correlation function, which calculates the correlation between two numeric fields. This is often used to display how strongly two variables are related to each other. In addition, the cluster (KMEANS) function partitions observations into a specified number of clusters based on the nearest mean value. The goal of cluster analysis is to group, or cluster, observations into subsets based on their similarity of responses on multiple variables.

Performing a basic aggregation with a Quick transform allows you to convert a field value from its raw state into a calculated field. With the Discount field, you can create a rolling Sum that shows the sum of the field as it exists in the chart. The Quick transform option is shown in the following image.

Note: You can perform multiple Quick Transforms using the same originating field.

Here, you can specify the type of aggregation (for example, Sum, Average, Count, or otherwise) and indicate whether you want to keep the original field. The Keep original field option is selected, by default, and serves the purpose of preserving the original field for other use in your chart. You can also choose to replace the field in favor of the transformed field, by deselecting this check box.

When you perform a Quick Transform on a field, a new, unique field is created and placed in the same bucket as the originating field, as shown in the following image.

The transformed field is now a COMPUTE, which is a post-aggregation function. It is a separate field, labeled with the aggregation that was applied.

Procedure: How to Apply a Moving or Rolling Average Using Quick Transforms

You can apply a Quick Transform (for example, aggregation or standard deviation) to change the function of a field and determine its use in your chart.

  1. Create a chart in WebFOCUS Designer or open an existing chart that was created in WebFOCUS Designer.
  2. Add a measure field (for example, Discount or Gross Profit) to the Vertical bucket.
  3. Right-click the field and from the menu that displays, point to Quick transform, as shown in the following image.

  4. Point to Rolling aggregate and from the Aggregation menu:
    1. Select a type of aggregation (Sum, Average, Count, Min, Max, First, or Last).
    2. Keep Break on set to None. This is the default value.
    3. Keep original field controls if the field on which you are basing the calculation is retained in the bucket. This check box is selected, by default. If you leave it checked, both the original field and the new calculated field will share the bucket. If you do not want to keep the original field, you can replace the field with the new calculated field by deselecting the box. Single-field buckets, such as Size, Animate, and Multi-Page will always replace the original field, regardless of this option.
  5. Click OK.

    The field is placed in the Vertical bucket and displays on the chart, by default. The legend is also updated to reflect this new field, as shown in the following image.

    Note: For information on the PARTITION_AGGR functions, see the Developing Reports With WebFOCUS Language manual.