Combine multiple data sets into one project

A simple stack of multiple data sets

8e0d61d9a128eed248465831eee8d5de

Updated at January 28th, 2020

You can combine data files using data processing in Protobi. The code creates a simple stack of multiple data sets. The method described in this tutorial works in cases where the data sets are identical in layout (e.g., multiple waves of a survey).

To stack multiple data sets together:

  • Upload the data files
  • Create a new data process that stacks the files
  • Set the data process as "primary"

Upload data files

In the data tab of project settings, create and upload the data files that you need to combine. For example: wave1, wave2, wave3, wave4 (four different waves of data).

See how to add a new data table for more details.

New data process

Create a data process, and insert the following code:

var W1 = data["wave1"]
var W2 = data["wave2"]
var W3 = data["wave3"]
var W4 = data["wave4"]

var rows = CSV.stack_rows([W1 ,W2, W3, W4]);

return rows

Save and run the data process.

Set as "primary"

Then, set the data process as primary:

The resulting data file will have all 4 wave stacked one on top of another. 

Was this article helpful?