book
Article ID: KB0070367
calendar_today
Updated On:
Description
Let us assume that we have two different tables (Table 1) and (Table 2) and want to insert columns from "Table 2" into "Table 1" using "Cross Join"
* Spotfire does not have "Cross Join" as an option (Refer to the below screen shot)
Issue/Introduction
Implementing Cross Join on two different tables in Spotfire
Resolution
Let’s look at the workaround to implement Cross Join in Spotfire.
Step 1: When importing the tables (Table 1 and Table 2) in Spotfire, add the "Transformation" > "Calculated new column" to each table(refer to screenshot named Step1).
Step 2: Name the new calculated column "matching_column" and for the expression of calculated column just enter 1, create this calculated column in both the tables (refer to screenshot named Step2).
Note: You need to add the calculated columns when importing the data because Spotfire won't allow you to use a calculated column made after the data has been imported as a join condition
Step 3: Once the two tables Table 1 and Table 2 are brought into Spotfire and calculated columns are created, you are ready to do the cross join and add your desired columns from Table 2 to Table 1.
Using Spotfire 7.14 or lower:
Click "Insert" > "Columns" mention the tables in the "Insert Columns" window. When you match columns, make sure that the only ones you're matching in both tables is “matching_column” and choose “Full Outer” as the Join method(refer to screenshot named Step3).
Using Spotfire 10.0 or higher:
Click "Data" > "Add data..."
Under Other, select "Linked copy to data table in analysis", and select the table to add column from - Table 2
Select "Add as columns to", with Table 1 as the target.
Click the cogwheel icon to open the add columns settings.
In the Match columns section, match on "matching_column"
In the settings, select "Full Outer Join"