The value of the parameterChoice is chosen by the end user of the add-in that I am trying to create.
It doesnt solve the problem and I think that the root is not in the Select Where command. Even if I use:
dtImp << show window(1);
it gives the same error. It seems that it doesn't allow to use << operator to the DatatTble.
But to be more analytical. I have 2 scripts:
Main.jsl: Creates a window that gives the end user the capability to choose the dataset using a button
bboxImp = button box( "Select data to import", importData())
where the importData()
function reads the data:
importData = Function({},
// Function that is used to select which data to import for the analysis
// Prompt the user to select input file
importFile = Pick File( "Select Excel data to import" );
if(importFile == "",
// No file was selected - we skip the rest
New window("Message", modal,
Text Box("No file has been selected for import")
),
// A file was selected - we continue
// Import data
dtImp = Open( importFile,
Worksheets( "Details" ),
Use for all sheets( 1 ),
Concatenate Worksheets( 0 ),
Create Concatenation Column( 0 ),
Worksheet Settings(
1,
Has Column Headers( 1 ),
Number of Rows in Headers( 1 ),
Headers Start on Row( 31 ),
Data Starts on Row( 32 ),
Data Starts on Column( 1 ),
Data Ends on Row( 0 ),
Data Ends on Column( 0 ),
Replicated Spanned Rows( 1 ),
Replicated Spanned Headers( 0 ),
Suppress Hidden Rows( 1 ),
Suppress Hidden Columns( 1 ),
Suppress Empty Columns( 1 ),
Treat as Hierarchy( 0 ),
Multiple Series Stack( 0 ),
Import Cell Colors( 0 ),
Limit Column Detect( 0 ),
Column Separator String( "-" )
)
);
// Select rows where "Component" column is empty
dtImp << Select Where( Is Missing( :Name( "Component" ) ) );
// Delete the selected rows
dtImp << Delete Rows;
// Grey out import botton and make Reimport and analysis botton available
wait(1);
dtImp << show window(0);
bboxImp << enable(0);
bboxRe << enable(1);
bboxAn << enable(1);
);
);
ImportRedo = Function({},
// Function that is used to remove imported datasets and allow for another import
// Close imported datafile and ungrey import and analysis botton
Close(dtImp, NoSave);
bboxImp << enable(1);
bboxRe << enable(0);
bboxAn << enable(0);
);
end then if you press the Run analysis button, it calls the Analysis.jsl script that creates a window where the end user makes some choices to filter the data choosing various unique values. In this script after the end user makes his choices I am trying to use:
ConfirmFiltering = Function({},
show(dtImp);
dtImp << Select Where(!Contains(parameterChoice, :Parameter));
);
to filter out the DataTable dtImp.