question

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

How to get Location Column as it is in Calculated Table?

Hi Team,

While using query to extract Location from Location States table in Calculated Table is showing long numeric digits in place of location objects name.

How can I get location objects name as it is in location states table?

Thank you!

FlexSim 21.0.10
healthcarelocationlocation states
· 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.

Kavika F avatar image Kavika F ♦ commented ·

Hi @Ankur A3, was one of Jordan Johnson's or Felix Möhlmann's answers helpful? If so, please click the "Accept" button at the bottom of the one that best answers your question. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always unaccept and comment back to reopen your question.

0 Likes 0 ·
Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered Felix Möhlmann commented

Check that the display format is set to 'Object'.

1651673496231.png

If you need to get the name outside of the calculated table, you can get it from the number with

StatisticsCollector.getPathFromID(number)

1651673496231.png (6.4 KiB)
· 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.

Jason Lightfoot avatar image Jason Lightfoot ♦ commented ·
You should be able to place that expression in your query substituting number with Location
0 Likes 0 ·
Jordan Johnson avatar image Jordan Johnson ♦♦ Jason Lightfoot ♦ commented ·

@Jason Lightfoot you are technically correct, you can use StatisticsCollector.getPathFromID() in the query directly. However, it is usually better to query the ID as a number, and then use the display format to show the path for that number, for both performance and memory use reasons.

2 Likes 2 ·
Ankur A3 avatar image Ankur A3 commented ·
Hi @Felix Möhlmann ,

Thank you for your answer!

I am able to get object name with display format but I am not able to write query using object name. To use corresponding number every time seems little time consuming.

I would like to know if there is any way to write query based on object name instead of number?

Thank you!


0 Likes 0 ·
Felix Möhlmann avatar image Felix Möhlmann Ankur A3 commented ·
Similar to how 'getPathFromID()' gives you the name when putting in the number, you can use 'StatisticsCollector.getID()' to get the number from the name.
0 Likes 0 ·
Jordan Johnson avatar image
0 Likes"
Jordan Johnson answered

If you use the Query Builder interface, you can use the sampler:
1652197281470.png

The Query Builder will substitute the number automatically:

WHERE ([Location] = 3325685383)

If you are trying to filter by multiple objects, then I'd suggest adding all of them a new group that belongs to one of the People Groups (Locations, in this case). Then, if your query joins with the LocationGroups table, you can filter by that group name.

If your query doesn't work with the Query Builder, then you'll have to use the numbers yourself. However, you can make a simple Statistics Collector that shows the display and the number in a single table, so you can copy/paste from that table.

I made a demo Statistics Collector that does this. It doesn't use any pointers, so you should be able to copy/paste the stats collector into your model.


QueryIDDemo.fsm


1652197281470.png (23.2 KiB)
queryiddemo.fsm (47.1 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.

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.