Hello,
I have two columns of array data type in a global table. How to write the subtraction value of those columns values in the third column?
Regards.
Hello,
I have two columns of array data type in a global table. How to write the subtraction value of those columns values in the third column?
Regards.
Hi @sara S2, There isn't a built in way to do this, so you will have to code it. When do you want the subtraction to occur? We will have to program the code on that trigger.
@Benjamin W2, thank you for your reply.
I want it to occur when a bin (tote) enters to the rack (On Entry Trigger, then write to global table). To be noted that the both arrays have the same length. Would you please gives some instructions on how to write this code?
Regards.
Table table = Table("GlobalTable1"); Array array1 = table[1][1]; Array array2 = table[1][2]; Array difference = [array1[1]-array2[1], array1[2]-array2[2], array1[3]-array2[3]]; table[1][3] = difference;
Alternatively, if you want it to work for arbitrary array sizes without specifying each index individually:
Table table = Table("GlobalTable1"); Array array1 = table[1][1]; Array array2 = table[1][2]; Array difference; for (int i = 1; i <= array1.length; i++) { difference.push(array1[i] - array2[i]); } table[1][3] = difference;
Note that this will throw an exception if the second array is shorter than the first.
8 People are following this question.
FlexSim can help you understand and improve any system or process. Transform your existing data into accurate predictions.
FlexSim is a fully 3D simulation software environment. FlexSim can be used to simulate any process in any industry.
FlexSim®, FlexSim Healthcare™, Problem Solved.®, the FlexSim logo, the FlexSim X-mark, and the FlexSim Healthcare logo with stylized Caduceus mark are trademarks of FlexSim Software Products, Inc. All rights reserved.
Privacy | Do not sell or share my personal information | Cookie preferences | Report noncompliance | Terms of use | Legal | © Autodesk Inc. All rights reserved