There are many different community posts regarding iSeries DB2 connections in Tableau. In general, using the IBM Client Access ODBC driver, a user can connect to single tables but not multiple tables or custom sql without creating a custom TDC file. However, there are many different versions of the driver from over the years (IBM even changed the name at one point), so giving out a generic TDC isn't that effective. The following is a method I've used with 100% success in enabling JOINs and Custom SQL.
As always, Tableau recommends taking an extract with an ODBC driver. In this case, performance will be excellent but Tableau writes increasingly complex queries the more complex your analysis / viz, so eventually you might hit an ODBC driver error. Taking an extract removes this problem entirely.
Use Single Table connection to get customizations in TDS file
To do the correct ODBC customizations, you need to build a TDC file. But what customizations should you use? When we connect successfully to a single table, Tableau actually tests the ODBC driver for all of its capabilities. Saving the data source to a .TDS file will output those customizations in the exact format we need to make a TDC file.
- Connect to Single Table – Connect Live
- Save the data connection
- Find .TDS(X) in My Tableau Repository\Datasources
- If .TDSX, unzip and open the .TDS file
Build TDC from the TDS File
- Open the saved .tds file. It will be XML
- Open a new text file (use Notepad++ / SublimeText/ your favorite editor if possible, or Notepad if you have to)
- Copy the first line (the xml declaration) from the tds to your new tdc file
- Find the <connection-customization> tag. Highlight it and go all the way until you find a </connection-customization> tag. Copy this into the new .tdc file.
- Change “enabled=‘false’ “ to “enabled=‘true’ “ in the <connection-customization> tag
- Save the new file in \Datasources with the .tdc file extension (Make sure if using Notepad that Windows isn’t adding .txt to the end!)
- Find the customization named CAP_SUPPRESS_DISCOVERY_QUERIES and set to 'yes': <customization name='CAP_SUPPRESS_DISCOVERY_QUERIES' value='yes' />
- Save again.
- Restart Tableau, try multiple tables JOIN
- When Tableau restarts, you should see a mention of “TDC” in the logs
- When you try your ODBC connection again, there will be a line: “Found matching TDC…” . Search for this!
- If you don't see this line, make sure that the .TDC file is saved with the .TDC extension and nothing else. A hidden ".txt" ending can be added by some programs and hidden by Windows, and Tableau won't find the file.