How to delete a row in 2 dimensional Matrix

Generic selectors
Exact matches only
Search title only
Search in content
Search in all posts
Search in pages
Solved318 viewsFormulas and Functions2D matrix formula modeler

If I have a 2 dimensional matrix :
Qtr1   Product
Row1   Q1       Tesla
Row2   Q2        Ford
What command should I write to delete all the rows that have product “Ford” ?


Selected answer as best

Are you kidding?…
If you have to delete Rows based on Criteria in separate (selectable) Fields you may write an A-script using this Algorithm:
1. Prompt the User to select a Category Item from the List as a pointer to a Range of Criteria Values.
2. Prompt the User to select one unique Criterion Value from the List.
3. Delete Rows from M1 matrix according to User-selected Criteria.
That’s exactly what I did. See Version of the A-script for such Case.

Selected answer as best

Hi all.
Shrishank, this is the simple A-script that solves your problem. It need to remember that A-script will not remove Rows if all rows contain only ‘Ford’ in the Product field. The reason for this: any category in QM must have at least one Item.

Answered question

Thank you for the reply and for sharing the model. The script works.
Quick follow up question.
If I have to delete rows based on criteria in seperate column do I write the function twice example:
|M1::RowLst|.items.each {
if (|M1|.getSelection(it, |M1::Product|).value.equals(“Ford”))
|M1::RowLst|.items.each {
if (|M1|.getSelection(it, |M1::Qtr|).value.equals(“Q1”))

This does work but seems to be inefficient.

Answered question

Latest Questions

Complex Queries in Quantrix 1 Answer | 0 Votes
DataLink / JDBC / EXEC 3 Answers | 0 Votes
Wrong calendar calculations 1 Answer | 0 Votes
Script to delete rows 3 Answers | 0 Votes