4 Replies Latest reply on Jun 13, 2017 2:59 PM by Naiana Campos

    Tableau Postgre Metadata: Relation between workbook/view and datasource

    Kiran Anumalla

      Hello,

       

      I am using Tableau 10.2 server. I am working with Tableau metadata to come up with the list of all workbooks and its associated data sources. I have referred http://onlinehelp.tableau.com/samples/en-us/data_dictionary/data_dictionary_8.2.5.html#comments_anchor  to understand the relationship between tables.

       

      I could find the list of workbooks having embedded data sources and filtered the connection list using below query -

      --List of workbooks having embedded data connections as 'xy.wer.as.wd'

      select *

      from public.workbooks w

      inner join public.data_connections dc

      on dc.owner_id = w.id

      where dc.owner_type = 'Workbook'

      and dc.server in ('xy.wer.as.wd')

       

      Now, I was trying to get list of all workbooks connecting to published data source having 'xy.wer.as.wd' data connection.

      Step 1: Get the list of all published data sources with data connection 'xy.wer.as.wd'

      Step 2: Get the list of all workbooks retrieved in step1

       

      I could achieve Step 1 using below query -

      -- List of Published datasources havinig 'xy.wer.as.wd' as a data connection

      select *

      from public.datasources ds left join public.data_connections dc

      on ds.id=dc.datasource_id

      where dc.server in ('xy.wer.as.wd')

      and ds.site_id = 4

      and dc.owner_type = 'Datasource'

       

      But for step 2, I could not find relationship between datasource table and workbook table.

       

      Any information is highly appreciated.

       

      Many thanks,

      Kiran