question

asb.p avatar image
0 Likes"
asb.p asked asb.p commented

How to PIVOT a table in Flexsim?

Hello,


I am trying to use a calculated table to consolidate the data from a transaction table.

Transaction Table

Seq Model StayTime

1 A 1

1 B 2

2 A 3

I basically want to consolidate the above table into following

Seq A B

1 1 2

2 3

For that I tried to write a SQL Query using PIVOT command which are not working.

Can any one help me with a sql commend for the same.

Thanks,

Praneeth.

FlexSim 18.1.0
calculated tablesql queries
· 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.

1 Answer

Jordan Johnson avatar image
0 Likes"
Jordan Johnson answered asb.p commented

We don't support the PIVOT clause in FlexSim's SQL. You will need to reference the help manual for the list of clauses we do support. In 2018 Update 1, this topic is in the Help Manual under:

  • Reference
    • Developer and Advanced User Reference
    • SQL Queries

The SQL Queries topic has a section called SQL Language Support, where all supported clauses are listed.

In order to get the table you want, you will probably need to write a FlexScript function that reads the first table to produce the second.

· 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.