Hello !
I want to create a user command that query the patient source arrival of my model.
I tried running this code in the script console:
// OPTION 1 // Table tableArrivals = Model.find("Tools/ProcessFlow/Arrivals/Source>variables/arrivals");
// Table table = Table.query("SELECT SUM(D_discProv_cleanup) FROM tableArrivals WHERE id_salle = 1 AND perf_caseRank > 3"); // OPTION 2 Table table = Table.query("SELECT SUM(D_discProv_cleanup) FROM TableArrivalsSaved WHERE id_salle = 1 AND perf_caseRank > 3"); // RESULT double value = table[1][1]; return value;
Using the first two rows (option 1) resulted in the following error:
exception: FlexScript exception: No resolved tables at <no path> c: <no path> i: <no path>
Using the option 2 allowed me to obtain the expected value.
My questions are the following:
1) Is it necessary to clone the arrival table to query it?
2) Is there an easier way to get the sum value without passing by "table[1][1]" ? I tried returning the query directly and it does not work as it is in the form of a Table.
Thanks in advance,
Leah