I am developing an ETL tool in python. The code generates some data which is then stored in MySQL database. I want to view this data in Tableau (or for that matter any BI visualization tool). For that I have to manually drag and drop the tables into workbook and specify join conditions.
My current workbook looks like this.
Now as the number of tables increases this task becomes cumbersome to do manually. Is it possible to tell the names of the tables and join conditions programmatically. The construction of the sheet/graphs can be done manually. Only the table specification is to be automated since its hectic and error prone.
My research:
- I came across an option Convert to custom SQL in which gives the following output. This is the exact thing I want to tell tableau. But there is no import option of such format.
SELECT
ship_line.ship_lineidASship_lineid,ship_line.nameASname,ship_line.product_dcidASproduct_dcid,ship_line.shipmentidASshipmentid,ship_line.sl_act_gi_dteASsl_act_gi_dte,
...
...
FROMship_line
INNER JOINproduct_dcON (ship_line._product_dcid=product_dc._product_dcid)
INNER JOINshipmentON (ship_line._shipmentid=shipment._shipmentid)
INNER JOINship_toON (shipment._ship_toid=ship_to._ship_toid)
INNER JOINship_fromON (shipment._ship_fromid=ship_from._ship_fromid)
INNER JOINdcON (shipment._dcid=dc._dcid)
INNER JOINcarrierON (shipment._carrierid=carrier._carrierid)
INNER JOINproductON (product_dc._productid=product._productid)
INNER JOINopcoON (product._opcoid=opco._opcoid)
INNER JOINkey_customerON (ship_to._key_customerid=key_customer._key_customerid) - We can export the workbook to .twb or .twbx file. This file contains all the information regarding the workbook. The .twb file is human readable. I can look into creating this file by a script and import it to view the workbook. But I don't really understand the semantics of tags used in it. Is there any documentation for this format.
Can someone provide a way to do this or suggest some other BI/visualization tool that can achieve this.