LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

count the number of repetitions of items

Solved!
Go to solution

@Nando88 wrote:
What I need is the number of repetitions for each item, not just a single column.

Where do you see only a single column?

 

My code creates the correct number of rows and columns as needed. Maybe your file is not formatted correctly? Can you attach your actual input file? (How is your file structured? How are you reading it? What are the delimiters, etc.)

0 Kudos
Message 11 of 22
(2,653 Views)

I was checking your vi, and noticed something, but I don't know if I'm correct. I noticed that you have written all the possible combinations in the spreadsheet string, but I want to be able to get the amount of repetitions of any two columns, with any values two columns, with any values that can appear in them. I don't know if this is possible, but if it is, I would really appreciate if you could show me the way.

Thanks in advance.

Download All
0 Kudos
Message 12 of 22
(2,631 Views)

All you need to do is add controls to the first index array to select the columns.

Your file needs more columns. A file with a single column is not interesting.

 

Everything is easily possible!

 

(If you attach a modified VI, please give it a new and unique name to avoid confusion. VIs ending in MODCA are my modifications, so please change the name next time.)

 

0 Kudos
Message 13 of 22
(2,627 Views)

Your VI works perfectly for the first column, but I tried to count the number of repetitions in the second column of the table, and it didn't work. I tried changing the index to the first array, but I want to count the number of repetitions of the second column with respect to the column 0, that contains the unique identifiers. I tried changing the index in both arrays, but I get repetition 0 for every unique identifier.

Can you please help me fix this problem?

Thanks in advance.

Download All
0 Kudos
Message 14 of 22
(2,605 Views)

You also need to wire the same column indices to the index array inside the for loop. Just branch the wire.

0 Kudos
Message 15 of 22
(2,585 Views)
Solution
Accepted by topic author Nando88
Message 16 of 22
(2,583 Views)

I just have one more question.

What changes would I have to make to have the number of repetitions but just in a single column?

Thanks in advance.

0 Kudos
Message 17 of 22
(2,415 Views)

Please explain in a few more words.

0 Kudos
Message 18 of 22
(2,404 Views)

I need to count the number of repetitions in a 1d array, so that I can view the number of repetitions can be viewed by category in a table.

In the code you shared before, I can view the number of repetitions in a 2d array, and I was wondering what would be the changes I have to make in order to change this vi, and go from a 2s array to a 1d array, to count the number of repetitions.

Thanks.

0 Kudos
Message 19 of 22
(2,393 Views)
Solution
Accepted by topic author Nando88

I figured it out.

I will leave the vi as an attachment.

0 Kudos
Message 20 of 22
(2,388 Views)