08-31-2020 03:15 AM - edited 08-31-2020 03:16 AM
Hi,
i want to create excel sheets by referencing different dates (from an array) but as some dates are repeated, there will be an error whereby the sheet can't be created. This means that there should be some kind of comparison and elimination to be done but i can't seem to figure it out. Attached are photos for reference. Would appreciate some advice, thank you!
08-31-2020 03:43 AM
Hi jvvvv,
@jvvvv wrote:
This means that there should be some kind of comparison and elimination to be done but i can't seem to figure it out.
Yes, you need some kind of comparison!
What about this:
To sort the array you will find a VIM in the array functions palette, atleast in LV2020 (and maybe starting from LV2017). For (much) older LabVIEW versions you will find similar VIs in OpenG…
08-31-2020 04:10 AM
Hi GerdW,
Thanks for the prompt reply! I have sorted it according to dates already but the problem is the repeated dates. I think it would be better if i attach the whole vi and the error.
08-31-2020 04:22 AM - edited 08-31-2020 04:23 AM
Hi jvvvv,
sorting the same array in the loop again and again is just Rube-Goldberg.
You also forgot to implement point 2 of my previous suggestion!
(You also should not use a "csv" file as template when you want to create an Excel workbook containing several worksheets…)
08-31-2020 04:36 AM
Hi GerdW,
I have done all of the suggestions you provided. However, I am not able to achieve what I want, which is to create a sheet for each date while eliminating the error caused by repeating. Do pardon me as I am still new to LV.
08-31-2020 05:16 AM
Hi jvvvv,
you don't use ArraySubset to get a block of rows of the same "Date" value until now!
You are using Sort2DArray.VIM twice: what is the result of those operations?
After sorting the 2D array you should use the "Date" column to determine each block of rows for each of the "Date" values:
08-31-2020 11:31 PM
Hi GerdW,
After I have sorted it by the date columns, I have to put the output through an index array of column 2 to get the date array. Then after that, I have to do the 5 steps you mentioned. I am trying to do that using while loop, end the loop when the date is different and repeat till end of array.