Skip to main content
In case you want to plot two measures from different cubes on a single chart, or create a calculated measure based on it, you need to create a join between these two cubes. If there’s no way to join two cubes other than by time dimension, you can consider using the data blending approach. Data blending is a pattern that allows creating a cube based on two or more existing cubes, and contains a union of the underlying cubes’ date to query it together. Data blending could be faster than joining on date when the record count is very large, because with this pattern, aggregation happens before joining, which can be more efficient for large volumes of data. The other situation in which data blending could be a better approach than joining on date is when the two tables have mostly the same columns, such as in the example below. For an example, consider an omnichannel store which has both online and offline sales. Let’s calculate summary metrics for revenue, customer count, etc. We have a retail_orders cube for offline sales:
An online_orders cube for online sales:
Given the above cubes, a data blending cube can be introduced as follows:
Another use case of the Data Blending approach would be when you want to chart some measures (business related) together and see how they correlate. Provided we have the aforementioned tables online_orders and retail_orders let’s assume that we want to chart those measures together and see how they correlate. You can simply pass the queries to the Cube client, and it will merge the results which will let you easily display it on the chart.