
上QQ阅读APP看书,第一时间看更新
Combining the data
During the import process, we will combine the data in the Countries and Regions file with the Child mortality and population growth file into a single data table.
The process is pretty much identical for the Analyst and web clients:
- Click the + icon on the left-hand side of the application and click Browse local file...:

- Navigate to where you downloaded the data files.
- Select the Child-mortality-and-population-growth and Countries and Regions data files and open them.
- Accept the default column types for both files (Analyst clients only).
- Expand the import panel for the Countries and Regions file (by clicking Countries and Regions.csv) and select Add as columns to:

You will notice a red warning—that is because there isn't an obvious match between the column names in the two columns:

- To fix this, click the cog wheel icon to open the match columns dialog.
- Click the Add match button.
- Select the Code (String) and alpha-3 (String) columns in each data table, respectively. Notice how Spotfire gives a helpful preview of the values in each of the columns to give a hint as to which columns you should choose to match on:

- Click the Add button.
- Now, look at the resulting preview—you can see how the columns have been matched and the resultant structure of the data that will be brought into Spotfire:

- Click OK to accept the settings and then OK again to load the data.
Notice that we used the default join settings—this is for a left-outer join. Spotfire explains the join types nicely if we were to open the join settings and explore them further. In most cases, however, a left-outer join is what's required —it's absolutely ideal for adding columns to one data table from another data file.
So far in this example, we have learned how to load two data files and combine, or join, them into a single data table. The original population growth versus child mortality data did not contain any information about regions, so we have added columns from the countries and regions data to augment it. We can now go ahead and build a visualization that shows the combined data.