LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I need to filter a 2D array based on 2 columns

Solved!
Go to solution

Hello,

I have an API call that returns all this information (the array on the left), and it returns the description, document number, and version of this document (it returns all versions of the same document).

I need to output only the most recent version of each document.
Could you help me?

leandrofeder_0-1757422648861.png

 

0 Kudos
Message 1 of 4
(200 Views)

Simplest would be to use a map (if you are on LabVIEW 2020+). Iterate through your 2D array and only add the item to the map if the version is higher than the one already in the map (or if it doesn't exist yet of course). The output is just the map itself.

0 Kudos
Message 2 of 4
(179 Views)
0 Kudos
Message 3 of 4
(106 Views)
Solution
Accepted by topic author leandrofeder

Assuming the highest version is at the top you can solve it like this:

Yamaeda_0-1757604410506.png

 

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Message 4 of 4
(66 Views)