01-13-2020 08:02 AM
Hi all,
I've got a difficulty to build a 3D table.
Basically, I have a 2D table with many data and I need to build a 3D table where in each page I'll have all the rows combining the conditions (same year, same class). After the treatment will be done page by page on an other loop.
So far, I extract the first row of the table and then I check row by row the rest of the table. If a line is OK with the conditions I exclude it from the table and I concatenate it to all the other rows following the conditions in the inside loop. The shift register is supposed to actualize the table loop after loop. After the inside loop I add the row exclude at the beginning of the first loop to gather all the data following its condition.
At the end, I index the data in order to build the 3D table.
The point is that it is not working at 100%. I can have pages with a couple of rows (ok) with many rows (still ok) but sometimes a row appears alone in its on page despite the fact that he should be in another page, with others rows.
Do you have an idea to enhance this?
Thanks,
Here, the loop with the 'True case':
False case:
Solved! Go to Solution.
01-13-2020 11:44 AM - edited 01-13-2020 11:49 AM
@Caracatos wrote:Do you have an idea to enhance this?
Please attach your code. Pictures are insufficient to debug and test.
Also make sure the input has typical default data. Then tell us what the desired output should be.
You are talking about a 3D array of strings. (A "table" in LabVIEW is always 2D).
Overall, you code seems way to convoluted (index array is resizeable, constant array resizing operations, prepending instead of appending, etc.)...
01-13-2020 03:21 PM
It could be an array of table results. That would be 3D.
01-13-2020 03:24 PM
@billko wrote:
It could be an array of table results. That would be 3D.
Since a table is just a 2D array of string (data wise), You cannot create an array of tables (i.e. an array of arrays) unless you jump through some hoops (e.g. create a 1D array of clusters, each containing a table). 😉
01-13-2020 04:00 PM - last edited on 01-10-2025 01:56 PM by Content Cleaner
Consider using Conditional Tunnels:
Conditionally Writing Values to Loop Output Tunnels
It will allow you to have a cleaner code.
01-13-2020 04:17 PM - edited 01-13-2020 04:31 PM
@Guillermo.O wrote:
Consider using Conditional Tunnels ...It will allow you to have a cleaner code.
It will take much more than conditional tunnels to clean up that code. 😄 (I think they are probably not even needed here).
I am sure it all could be done with code the size of a postage stamp. 😉
(maps/variant_attributes come to mind... ;))
01-13-2020 04:32 PM
@altenbach wrote:
@Guillermo.O wrote:
Consider using Conditional Tunnels ...It will allow you to have a cleaner code.
It will take much more than conditional tunnels to clean up that code. 😄 (I think they are probably not even needed here).
I am sure it all could be done with code the size of a postage stamp. 😉
https://www.thefactsite.com/largest-postage-stamp/
01-13-2020 05:35 PM
Yes, here's one possible solution using maps (note that the various output tables can be different in size. Also note the scrollbars, not all elements are shown).
Maybe not the size of a postage stamp, but definitely smaller than a postcard. 😉
01-21-2020 02:25 AM
Thank you !
I'm using this approach and it's works for me.
Great answer!