Using components: Cube and Rollup

Use the Cube and Rollup component to group the input dataset by combinations of fields and use aggregate functions such as Count, Average, Minimum, Maximum, etc.

Cube will produce results of the functions for each combination of expressions selected. Rollup will limit the results to the combinations for the hierarchical combination of expressions.

For example, you may want to calculate total profit in a chain of stores for time period, region and department. Using rollup with fields in that order will yield results for:
  • Subtotals for each combination of time period, region and department
  • Subtotals for each time period and region
  • Subtotals for each time period
  • Grand total
Note there are results for combinations of time period with the other fields based on the hierarchy of fields, but no results for combinations of time period and department or of each combination of region or department with the other fields. Use cube instead of rollup if results for every possible combination is desired.

To aggregate records with cube or rollup:
  1. Add a Cube component where required in your package.
  2. Open the component and name it.
  3. Under group by, select cube or rollup aggregation and then select the fields on which to perform the summary functions. The results will be returned for combinations of the selected fields.
  4. Add another cube or rollup aggregation if required.
  5. Under aggregation functions, select the aggregate function you want to apply as follows:
    • Count - returns the number of non-null values in the field you specify in the field column, according to the groupings.
    • Count Distinct - returns the number of unique values in the field you specify in the field column, according to the groupings.
    • Count All - returns the number of records, according to the groupings.
    • Average - returns the average for numeric fields you specify in the field column, according to the groupings.
    • Sum - returns the sum for numeric fields you specify in the field column, according to the groupings.
    • Min - returns the minimum value for the field you specify in the field column, according to the groupings.
    • Min By - for the minimum value in the field you specify in the field column, and according to the groupings, returns the value defined by projected field.
    • Max - calculates the maximum value for the field you specify in the field column, according to the groupings.
    • Max By - for the maximum value in the field you specify in the field column, and according to the groupings, returns the value defined by projected field.
    • VAR - returns the statistical variance for all values in the field you specify in the field column and according to the groupings.
    • VARP - returns the statistical variance for the population of all values in the field you specify in the field column and according to the groupings.
    • STDEV - returns the statistical standard deviation for all values in the field you specify in the field column and according to the groupings.
    • STDEVP - returns the statistical standard deviation for the population of all values in the field you specify in the field column and according to the groupings.
  6. You can use functions in the field column to manipulate field data (see Using functions in components).
  7. Type an alias for the field that contains the resulting values for the function.
  8. Add another function if required.

Impact of null value

Null values are used in columns to represent subtotals in cube and rollup operations. In order to differentiate the legitimate null values that already exist in records, any null values in the records are converted to "unknown" value before performing the cube or rollup operation.

Creating packages

  1. Creating a new package
  2. Create a package from a template
  3. Working in the package designer
  4. Using Components: Facebook Ads Insights Source (Beta)
  5. Using components: File Storage Source
  6. Using components: Database Source
  7. Using components: Google AdWords Source
  8. Using components: NetSuite Source
  9. Using Components: Google Analytics Source
  10. Using Components: Google BigQuery Source
  11. Using components: Google Cloud Spanner Source
  12. Using Components: Bing Ads Source
  13. Using components: MongoDB Source
  14. Using components: Amazon Redshift Source
  15. Using Components: Rest API Source
  16. Using Components: Salesforce Source
  17. Using components: Select
  18. Using components: Sort
  19. Using components: Rank
  20. Using components: Limit
  21. Using components: Sample
  22. Using components: Join
  23. Using components: Cross Join
  24. Using components: Clone
  25. Using components: Cube and Rollup
  26. Using components: Union
  27. Using components: Filter
  28. Using Components: Window
  29. Using components: Assert
  30. Using components: Aggregate
  31. Using components: Distinct
  32. Using components: File Storage Destination
  33. Using components: Amazon Redshift Destination
  34. Using Components: Salesforce Destination (Beta)
  35. Using components: Google BigQuery Destination
  36. Using components: Google Cloud Spanner Destination
  37. Using components: Database Destination
  38. Using components: MongoDB Destination
  39. Using and setting variables in your packages
  40. Validating a package
  41. Using pattern-matching in source component paths
  42. Using ISO 8601 string functions
  43. Using Expressions in Xplenty
  44. Xplenty Functions

Feedback and Knowledge Base