question

Ankur A3 avatar image
0 Likes"
Ankur A3 asked Ankur A3 commented

How to provide calaculated table cell reference?

Hi Team,

I have collected statistics using calculated table. Now, I want to show it as KPI in performance measure.

1666934676305.png

I am trying to link calculated table cell in performance measure, but it is showing errors.

Is it possible to do the same?

Thank you!

FlexSim 21.1.5
performance measurecalculated table cell reference
1666934676305.png (158.6 KiB)
5 |100000

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

1 Answer

Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered Ankur A3 commented

When using the sampling tool to select the calculated table choose the lower entry. This will add the "Table value" option into the Value field.

1666937012691.png

Your code isn't working because you first need to cast the treenode reference into a table class variable in order to use the [row][col]-syntax to read entries. You can see how this is done by inspecting the code of the "Table value" option.

1666936998541.png


1666936998541.png (38.1 KiB)
1666937012691.png (41.6 KiB)
· 3
5 |100000

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

Ankur A3 avatar image Ankur A3 commented ·

Hi @Felix Möhlmann,

Got your point.

But I have 1 question here:

When we provide table keyword while referring "Table" in custom code all the table gets populated including calculated tables. So why we need to convert it in table format again to print the cell value?

Thank you!

0 Likes 0 ·
Felix Möhlmann avatar image Felix Möhlmann Ankur A3 commented ·

Because "reference" points to the node of the calculated table, not the data table. If you want to use the reference variable, you thus have to convert it first.

You can of course just not use the reference and access the table cell directly by refering to it by name, as you describe, with the Table() constructor.

1666940035643.png

0 Likes 0 ·
1666940035643.png (23.8 KiB)
Ankur A3 avatar image Ankur A3 Felix Möhlmann commented ·
Ok @Felix Möhlmann!

Thanks a lot for explanation!

0 Likes 0 ·