question

Ranggi M avatar image
0 Likes"
Ranggi M asked Andrew O commented

Flexsim SQL Max value of a join table

Hey need example how i can get a max value from a join table where only several row should be showed.

I tried to create this one :

Table result2 = Table.query("SELECT MAX(tabel1.[Line] FROM table1,table2\

WHERE table2.[Package] = table1.[Package ID]");

got error said : exception: FlexScript exception: Could not parse query


Where table 2 is actually a query table without being dump/clone to global table

FlexSim 19.2.4
sql query
· 2
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Jason Lightfoot avatar image Jason Lightfoot ♦♦ commented ·

For a start you have a missing close parenthesis for the MAX function but also where are you passing in the reference to table2 ? It should be the first parameter referenced as $1 I think - and you may need to dump/clone it if it isn't already.

If those tips don't help, post your model or just the parts relevant to this question, and we'll take look

0 Likes 0 ·
Andrew O avatar image Andrew O commented ·

Hi @Ranggi M,

We haven't heard back from you. Were you able to solve your problem? If so, please add and accept an answer to let others know the solution. Or please respond to the previous comment so that we can continue to help you.

If we don't hear back in the next 3 business days, we'll assume you were able to solve your problem and we'll close this case in our tracker. You can always comment back at any time to reopen your question, or you can contact your local FlexSim distributor for phone or email help.

0 Likes 0 ·

0 Answers