LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Remove similar lines and saving different information of an array

Solved!
Go to solution

Good afternoon,

I'm trying to make the Actual list look the shape of the ideal list, but to no success

I need to check in the table is if the Equipment ID already exists

If there is, check if the seller is already on the same line

If it exists, it doesn't do anything on the list

But if the Equipment ID exists and the seller is not on the list, it must be added to the line in this format ;NameOfSeller concatenating with the name of the other sellers

I attached a print of the VI and attached the VI



Thank you for your help

 

leandrofeder_0-1705953115180.png

 

Download All
0 Kudos
Message 1 of 8
(1,123 Views)

Here is one way to do it. 

 

1) I started with a blank table, so you need to add the items from "actual" once you run the VI. I'm assuming this is how the VI would have to work in real life.

2) You are comparing strings, so you need to make sure you are handling case properly. For the seller pattern match I'm setting everything to lowercase first. That is probably what you want, but you'll have to determine if that works for you.

Message 2 of 8
(1,082 Views)

I would probably keep the data a MAP, e.g. as follows:

 

 

altenbach_0-1705960200894.png

 

(this processes the original list but it will be easy to maintain the map with each new entry in similar fashion.

 

And no, you don't need any sequence structures or local variables for any of this!

Message 3 of 8
(1,066 Views)

Altenbach, can you send the VI to me so I can test it out?

I tried to replicate it, but I couldn't find some components of the print

0 Kudos
Message 4 of 8
(1,021 Views)

@leandrofeder wrote:

I tried to replicate it, but I couldn't find some components of the print


Since your LabVIEW version was too new for my current PC, I currently have it only a VM on a different computer so this will have to wait until later.

 

A few questions, that might require modifications:

 

  • For any ID, are the second and third column guaranteed to be the same? If not, what should be done?
  • For a given ID, can we guarantee that each vendor only occurs once? If not, we should use a "set" for the vendors of each entry.
  • etc..

 

Message 5 of 8
(1,011 Views)

Okay, alright

 

  • For any ID, are the second and third column guaranteed to be the same? If not, what should be done?
    For me the second and third column doesn't matter, but for the end user visualizing it is important.

Basically, what is needed is to check the equipment ID column, and if there are repetitions, group them into a single row


If there are 5 times the equipment with the same ID (e.g., 1212), it must be grouped on the same line and the name of the sellers must be concatenated, without repeating the names


And don't allow other lines with the same equipment ID

0 Kudos
Message 6 of 8
(994 Views)
Solution
Accepted by topic author leandrofeder

Here's a quick draft. (it allows duplicate sellers in one entry. Would be easy to fix.)

 

 

Message 7 of 8
(939 Views)

Thank you very much!

That's exactly what I was trying to build

0 Kudos
Message 8 of 8
(918 Views)