Unions versus JOINS
Unions are used to combine the result set of two or more SELECT
statements. It's always tempting to JOIN two analytic views when measures from more than one table are required. This should, however, be avoided for performance reasons. It is more beneficial to use a Union in a calculation view. Technically, a Union is not a JOIN type.
Points to remember:
- Union is not supported in the attribute or analytical view but can only be used in calculation views.
- Union with constant values are supported within graphical calculation views and the Union operator can accept 1..N input sources.
- Script-based calculation views can only accept two input sources at a given time.
- Do not JOIN analytical views (to be discussed later), as you might have performance issues. Instead, use Union with constant values when working with multiple fact tables.