question

Mischa Spelt avatar image
0 Likes"
Mischa Spelt asked Jordan Johnson answered

Calculated Table with aggregation not updating

Hi,

I had the wild idea to use a Calculated Table to do aggregation, as in the attached model, where I have a script that uses the "Add row and data to global table" option to write data to a table, and then a query like the following to sum how often each value occurs in the first column:

SELECT [Col 1], COUNT(*)
 FROM GlobalTable1
 GROUP BY [Col 1]

However, I cannot get the table to update. Not with Update Mode "Always", but even with an interval or when clicking the "Update" button in the interface it will count all rows as having value zero.

The only way to get the correct data is changing the query: for example adding a space character at the end of the SQL clause will recalculate the data correctly.

I found the bug in 19.0.3 and confirmed it's still present in 19.0.5.

FlexSim 19.0.5
calculated tablesql queries
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

·
Jordan Johnson avatar image
1 Like"
Jordan Johnson answered

I suspect this is an issue with COUNT(*). I will add it to the dev list. You can work around this by changing your query to use COUNT([Col 2]). The COUNT aggregation totals the number of non-null values in an expression.

5 |100000

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

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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