
Extract columns with their source tables from a TWB
Source:R/fields.R
extract_columns_with_table_source.RdScans top-level <datasource> nodes (excluding view-specific references) and
returns fields with raw names/captions, cleaned table/field names, and basic
metadata.
Value
A tibble with columns:
- datasource
Datasource name.
- name
Raw column name (may include brackets/qualifiers).
- caption
Column caption if present.
- datatype
Tableau datatype.
- role
Tableau role.
- semantic_role
Semantic role if present.
- table
Raw table reference.
- table_clean
Cleaned table name (no brackets/suffix).
- field_clean
Cleaned field name.
Examples
twb <- system.file("extdata", "test_for_wenjie.twb", package = "twbparser")
stopifnot(nzchar(twb), file.exists(twb))
xml <- xml2::read_xml(twb)
fields <- extract_columns_with_table_source(xml)