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.

 

  1. Connect to Single Table – Connect Live
  2. Save the data connection
  3. Find .TDS(X) in My Tableau Repository\Datasources
  4. If .TDSX, unzip and open the .TDS file

 

Build TDC from the TDS File

 

  1. Open the saved .tds file. It will be XML
  2. Open a new text file (use Notepad++ / SublimeText/ your favorite editor if possible, or Notepad if you have to)
  3. Copy the first line (the xml declaration) from the tds to your new tdc file
  4. 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.
  5. Change “enabled=‘false’ “ to “enabled=‘true’ “ in the <connection-customization> tag
  6. 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!)
  7. Find the customization named CAP_SUPPRESS_DISCOVERY_QUERIES and set to 'yes':  <customization name='CAP_SUPPRESS_DISCOVERY_QUERIES' value='yes' />
  8. Save again.
  9. Restart Tableau, try multiple tables JOIN
  10. Extract

 

Troubleshooting

  1. When Tableau restarts, you should see a mention of “TDC” in the logs
  2. When you try your ODBC connection again, there will be a line: “Found matching TDC…” . Search for this!
  3. 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.