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_lineid
ASship_lineid
,ship_line
.name
ASname
,ship_line
.product_dcid
ASproduct_dcid
,ship_line
.shipmentid
ASshipmentid
,ship_line
.sl_act_gi_dte
ASsl_act_gi_dte
,
...
...
FROMship_line
INNER JOINproduct_dc
ON (ship_line
._product_dcid
=product_dc
._product_dcid
)
INNER JOINshipment
ON (ship_line
._shipmentid
=shipment
._shipmentid
)
INNER JOINship_to
ON (shipment
._ship_toid
=ship_to
._ship_toid
)
INNER JOINship_from
ON (shipment
._ship_fromid
=ship_from
._ship_fromid
)
INNER JOINdc
ON (shipment
._dcid
=dc
._dcid
)
INNER JOINcarrier
ON (shipment
._carrierid
=carrier
._carrierid
)
INNER JOINproduct
ON (product_dc
._productid
=product
._productid
)
INNER JOINopco
ON (product
._opcoid
=opco
._opcoid
)
INNER JOINkey_customer
ON (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.