tableau / community-tableau-server-insights

Community-built data sources for answering questions about Tableau Server
MIT License
129 stars 52 forks source link

TS Events - Project information shows as NULL #80

Open mcoles opened 1 year ago

mcoles commented 1 year ago

Another problem from the 2023.1 schema change that alters the way content is mapped to projects. Need to update the joins for all the different content types in this data source to fix it.

Note that Historical Project Name still works, as that's tracked in the hist_projects table, so it's not affected by the join issue.

another-tom commented 7 months ago

I hacked around it by using the logic used to create the _worbooks view that uses the new project_contents table. I used the following customSQL to replace public.workbooks

select
    workbooks.id,
    workbooks."name",
    workbooks.repository_url,
    workbooks.description,
    workbooks.created_at,
    workbooks.updated_at,
    workbooks.owner_id,
    --workbooks.project_id,
    projects_contents.project_id  as project_id,
    workbooks.view_count,
    workbooks."size",
    workbooks.embedded,
    workbooks.thumb_user,
    workbooks.refreshable_extracts,
    workbooks.extracts_refreshed_at,
    workbooks.lock_version,
    workbooks.state,
    workbooks."version",
    workbooks.checksum,
    workbooks.display_tabs,
    workbooks.data_engine_extracts,
    workbooks.incrementable_extracts,
    workbooks.site_id,
    workbooks.revision,
    workbooks.repository_data_id,
    workbooks.repository_extract_data_id,
    workbooks.first_published_at,
    workbooks.primary_content_url,
    workbooks.share_description,
    workbooks.show_toolbar,
    workbooks.extracts_incremented_at,
    workbooks.default_view_index,
    workbooks.luid,
    workbooks.asset_key_id,
    workbooks.document_version,
    workbooks.content_version,
    workbooks.last_published_at,
    workbooks.data_id,
    workbooks.reduced_data_id,
    workbooks.published_all_sheets,
    workbooks.extract_encryption_state,
    workbooks.extract_creation_pending,
    workbooks.is_deleted,
    workbooks.parent_workbook_id,
    workbooks.is_private,
    workbooks.modified_by_user_id,
    workbooks.extract_storage_format
FROM
     public.workbooks
    LEFT JOIN projects_contents ON projects_contents.content_id = workbooks.id AND projects_contents.content_type::text = 'workbook'::text