LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Filter rows from an array, based on criteria in two of the columns

Solved!
Go to solution
Highlighted

Is there an easy way to filter a 2d array, based on the values of two of the columns? For example in my VI attached the output array has the following format:

 

10:57:07.776

0 Kudos
Message 1 of 3
(960 Views)
Highlighted
Solution
Accepted by topic author chuck72352

Quick answer:

 

Convert your 2d array to an array of cluster where the order of the cluster defines how tie-breakers are handled (first fields are equa so serach on second item in cluster)

 

Run that thru a Sort 1d array and convert back to a 2d array.

 

Faster approach:

 

Only bundle up the serach fiels along with an index. Do the search then use the index to re-order the original array.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 2 of 3
(951 Views)
Highlighted
I used the function "Build Cluster Array" and "Sort 1 D Array" as you suggested, then I dumped that to a file so that I can do the processing with a C routine. My plan is to write the filter routine in C then access it with Labview.
0 Kudos
Message 3 of 3
(940 Views)