Defining relational queries in Excel
This capability was removed in v2.0.8, documentation provided for customers on v2.0.7 and prior. Connect to Microsoft SQL, IBM® Db2®, and Oracle databases in Excel to define queries that will run in TM1® Web.
Before you can run a relational query in TM1 Web, you must author the query in Microsoft Excel.
For more information about querying a relational database using Microsoft Excel, see the documentation that was supplied with the Excel software.
Creating a query of MS SQL data
- In Microsoft Excel, go to the Data tab > Get External Data > From Other Sources > From SQL Server.
- Enter the URL for the MS SQL Server database and then enter the user name and password.
- Select a database and then select a table from the list.
- Create the query.
- Click Properties > Definition tab.
- Change the command type to SQL.
- Enter SQL commands in the Command text box.
- Optionally, add parameters to your query.
For more information, see Creating a parameterized query in Excel.
Note: You cannot validate the SQL query while you are creating it.
- Optionally, modify and format the data in Excel.Note: Most formatting will be retained when you upload the file to TM1 Web. However, table formatting is not retained.
- Save the Excel worksheet.
Creating a query of Db2 data
- In Microsoft Excel, go to the Data tab > Get External Data > From Other Sources > From Data Connection Wizard.
- Click Other/Advanced and then click Next.
- Select the Db2 OLE driver that you previously installed and then click Next.
- Select Direct server connection.
- Enter the server name and ODBC port number as
follows:
server_name:ODBC_port_number
- Select a database from the list and then enter a user name and password.
- Select a table from the list and re-enter your user name and password, if required.
- Create the query.
- Click Properties > Definition tab.
- Change the command type to SQL.
- Enter SQL commands in the Command text box.
- Optionally, add parameters to your query.
For more information, see Creating a parameterized query in Excel.
Note: You cannot validate the SQL query while you are creating it.
- Optionally, modify and format the data in Excel.Note: Most formatting will be retained when you upload the file to TM1 Web. However, table formatting is not retained.
- Save the Excel worksheet.
Creating a query of Oracle data
- In Microsoft Excel, go to the Data tab > Get External Data > From Other Sources > From Data Connection Wizard.
- Click Other/Advanced and then click Next.
- Select the Oracle OLE driver that you previously installed and then click Next.
- Select Direct server connection.
- Enter the server name, ODBC port number, and net service ID as
follows:
server_name:ODBC_port_number/net_service_id
Note: An error message may appear that ends with the following line:IO Error: Invalid connection string format, a valid format is: "host:port:sid"
Despite this error message, the original connection was successful and the only syntax that will work is host:port/sid.
- Select a database from the list and then enter a user name and password.
- Select a table from the list and re-enter your user name and password, if required.
- Create the query.
- Click Properties > Definition tab.
- Change the command type to SQL.
- Enter SQL commands in the Command text box.
- Optionally, add parameters to your query.
For more information, see Creating a parameterized query in Excel.
Note: You cannot validate the SQL query while you are creating it.
- Optionally, modify and format the data in Excel.Note: Most formatting will be retained when you upload the file to TM1 Web. However, table formatting is not retained.
- Save the Excel worksheet.
You can now work with your relational data in TM1 Web. For more information, see Uploading a relational query to TM1 Web.