Filter or remove respondents

673d23dd68cf08627e90e16be103471a

Updated at January 28th, 2020

Copy and paste the code below in "Pre-calculate." Within the code, make sure you enter the correct respids to filter out the relevant respondents. Hit save. 

The logic is straight forward; edit the "if" statement to return false for respondents that you want to remove, and return true for those you want to keep. This code can work either in the pre-calculate or as a data process.

var rows = data["main"];

rows = rows.filter(function(row) { 
    if (row.respid == "101") return false      // remove respondent with respid ="101"
    if (row.respid == "102") return false      // remove respondent with respid ="102"
    if (row.status == "INCOMPLETE") return false // remove incomplete respondents

    return true                                // do not remove anyone else
})

return rows;


Was this article helpful?