A Script to Reference All Visible Rows Filtered by Cell Value
Hello,
I have a fairly large 2-dimensional matrix that I would like the user to filter on one or more columns to isolate the rows and set the check box to 1 for all the selected rows. I expect the selection process to be iterative, meaning the user will try different sets of filters and sorts and then select the rows. There will be quite a few rows found in each selection process. So, I would like to have a script that can set the value of the check box for all visible rows (from filtering) to 1 using a script to make the process more efficient. Also, I will be publishing the model on Quantrix Enterprise. So, the script will need to work in QE. Thanks for your help! Much appreciated.
I tried to attach a sample model. But, I get an error message that says “File type not allowed”…..
Henry
Hi all!
Henry, here’s my way of solving your problem. Suppose there is a flat data table M0.
*

*
Let’s sort the M0 records by three fields and pay attention to the changed order of the records.
*

*
Let’s apply to the sorted flat data table M0 also filtering of records, for example, by field Dept. Again, let’s pay attention to both the order of the records and their number.
*

*
These are the record’s numbers that need to be flagged according to your request. To do this, I will enter the auxiliary field flrRec in the Fields category.
*

*
The values of the flrRec field can now be copied to the Report matrix and the selected record numbers of the flat data table can be marked with 1.
*

*
The A-script shown in the figure above does all the work. Excessive copying of filtered and sorted record numbers of the flat data table M0 in the SOplusFilter field does not prevent you from getting the solution you need in the ftrFlag field.
NOTES.
1. The Recs and rptRecs categories are unrelated.
2. The SOplusFilter field in the Report matrix cannot be collapsed, otherwise A-script will not copy.
3. The size of the rptRecs category depends parametrically on the size of the Recs category.
4. The SOplusFilter field holds record’s sorting order of the M0 table, so If necessary, it can be used in the model.
To hide the numbers of the unselected records in the Report matrix, we apply filtering by the value 1

Animated demonstration of the A-script action
*

*
Good luck
SAU,
Brilliant! :-) I think your solution is exactly what I was looking for! I will try implementing your solution and see how it goes. Thank you.
You have to *.zip the model files to be able to upload them. Uploading a model file greatly helps to understand your question!