LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Find newest element in 2D array according time

Solved!
Go to solution

@Jonathan_Rao wrote:

Hi,I attached VI here .Willing to get your proposal.

LV version 2020.


This is now a different problem because you have more than two columns! Which column should be the key? Do you want all column elements at the end?

0 Kudos
Message 11 of 15
(375 Views)

See if this works for you.... (Not fully tested, though)

 

 

altenbach_0-1606413720567.png

 

0 Kudos
Message 12 of 15
(372 Views)

Of course a lot of simplifications would be possible if we have more information about the data. For example, is the first column always sorted by time? How about the last column?

0 Kudos
Message 13 of 15
(365 Views)

@altenbach wrote:

Of course a lot of simplifications would be possible if we have more information about the data. For example, is the first column always sorted by time? How about the last column?


Well, your first column is NOT sorted in time, but if we still can assume that for each unique element in the second column, the newest is last, we can still simplify. Here are two possibilities. (all give the same result with your current sample data).

 

The map version scales better for very large inputs, of course.

 

altenbach_0-1606415979287.png

 

0 Kudos
Message 14 of 15
(361 Views)

Hi,altenbach

I can not appreciate you more on helping this topic .

This reorder thougts and your snaps helped a lot.

Now I can solve test value reorder issue .

Great work!!!

0 Kudos
Message 15 of 15
(347 Views)