question

Amy M3 avatar image
1 Like"
Amy M3 asked Amy M3 commented

How to type an expression in calculated table field?

I'm having trouble with one column in a calculated table - slurry tph. I'm trying to divide a total (total slurry tons) by the model run time (hours column). It's not accepting Model.time/hours(1). It also won't let me divide my total by my hours column. If i hardcode a number in, it works (but only accurate at end of model).

FlexSim 21.1.0
calculated tableflexsim 21.1.0
calc-tbl.jpg (39.6 KiB)
stats-coll.jpg (36.1 KiB)
stats-coll.jpg (36.1 KiB)
· 1
5 |100000

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

Eric M avatar image
0 Likes"
Eric M answered Amy M3 commented

Hi @Amy M3, I think I've found a solution. I added a column to your stats collector called "TimeH" which measures the time in hours. I then use that in the Slurry Overall Totals calculated table with a "aggregated operation on two columns" dividing the slurry tons by the TimeH (see metric 6). I'm not sure why it wasn't liking the original code, but hopefully this will be a solution for you.

slurry-ohio-305 (2).fsm



· 4
5 |100000

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

Benjamin W2 avatar image
1 Like"
Benjamin W2 answered Amy M3 commented

Hi @Amy M3,

I think you are using the "Operation on column and value" option. Instead, do the "Custom expression" and wrap your flexscript in curly braces:

FlexscriptinSQL.fsm


1620682223301.png (53.3 KiB)
flexscriptinsql.fsm (86.3 KiB)
· 1
5 |100000

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