Join Data in Query

You can combine data from multiple Datamarts. Two types of joins are available:

  • Inner Join

  • Left Outer Join

  1. Go to Analytics > Dashboard Manager > Queries.

  2. Click New Query.

  3. Click on the default Series (S1) building block.

    Default Series building block labeled S1 in the query editor, with a plus button below it for adding the next building block.
    Default Series building block
  4. In the Source Data section:

    1. Select Source from the drop-down menu.
      info Since the release of Paloma 17.1 the following Data Sources are supported.

    2. Select Column or multiple Columns in Select Column(s).
      info No columns are preselected when you select the Source. You must explicitly select each column you want to include in the query. To use every column of the source, click Select all. Select only the columns that the query needs, because fetching all columns can slow the query down.

    3. Select Currency.
      info Defines which currency the money data will be converted into.

      Series settings panel showing the Source Data section. Source is set to Testing Actin Data. Customer Id, Customer Class, Product Id, Quantity columns are selected, and Currency is set to EUR.
      Source Data settings for S1
  5. Close the series setting section.

  6. In the Building Blocks panel select Series.

  7. Add the new Series (S2) building block.

  8. Click on the default Series (S2) building block.

    1. In the Source Data section:

      1. Select Source from the drop-down menu.

      2. Select Column or multiple Columns in Select Column(s).

      3. Select Currency.

        Series settings panel showing the Source Data section. Source is set to Testing Actin Data. Customer ID, Country, Product Label columns are selected, and Currency is set to EUR.
        Source Data settings for S2
  9. Close the series setting section.

    Two unconnected Series building blocks in the query editor, S1 with the Testing Actin Data source and S2 with the Meatball_customer source.
    Two Series building blocks
  10. In the Building Blocks panel select Join.

  11. Add the Join (J1) building block.

  12. Connect the Join (J1) block with Series blocks (S1, S2).

    Series building blocks S1 and S2 both connected to the Join building block J1.
    Series building blocks connected to Join
  13. In the Join settings section:

    1. Select the Join Type.
      info How rows from the two branches are combined. Inner Join keeps only rows that find a match on the other side. Left Outer Join also keeps every row from the left side that matches nothing. The right side's columns stay empty for those rows.

      1. Inner Join

      2. Left Outer Join

    2. Select the Join Keys.
      info Rows are matched where these fields are equal on both sides. Only grouping fields (dimensions) can be used as keys. Add another key to make matches more specific.

      Join Keys section that matches Customer Id in S1 with Customer Id in S2. Below the key is the Map on button.
      Join Keys settings
    3. In Calculated fields section:
      info New columns computed with a formula over the joined columns. A calculated field is available downstream like any other column.

      1. Click Add Calculated Field (Optional).

      2. Define Calculated Field in Expression Editor.

      3. Click OK.

    4. In Output Fields section:

      1. In the Select Fields drop-down define output fields for the Join block. (Optional)
        info Columns coming from the two joined series. By default every one of them is passed on. Select columns to pass on only those. A column left out stays available to calculated-field formulas.

    5. Close the Join settings section.

  14. Click + under the Join (J1) building block.

  15. In the Add building block menu:

    1. Select Output.

      Add building block menu listing Join, Filter, Summary, and Output, with Output selected.
      Add building block menu
  16. Click Save.

  17. In the Save Query menu:

    1. Enter a Label.
      info Title used for display and translations.

    2. Enter a Name.
      info Mandatory and unique identifier. Changing it can break dependencies. Prefer using the Label for naming visible to users.

    3. In the Save to Folder section, select the folder where the query will be saved.

    4. Click Save.

Demo Query Join in the query editor. Series S1 with Testing Actin Data and Series S2 with Meatball Transaction DM are both connected to Join J1, which matches S1 CustomerId with S2 CustomerID. The Join is connected to Output, and a Valid label appears at the top of the editor.
Query with joined data

Example

In our example we are joining the following two Datamarts:

  • Testing Actin Data

  • Meatball Transaction DM

Field Selection

  • Testing Actin Data

    • Customer Id

    • Customer Class

    • Product Id

    • Quantity

  • Meatball Transaction DM

    • Country

    • Product Label

Output preview table with the joined data. Each row combines the Customer Id, Customer Class, Product Id, and Quantity columns from Testing Actin Data with the Country and Product Label columns from Meatball Transaction DM. All visible rows are for customer CD-00003 in class C, with products MB-0001 to MB-0003, country USA, and product label Meatball BS.
Data after join