Jump to content

Finding Tables Actually Used By A Data Connection Within A DXP


diablo908

Recommended Posts

I'm trying to figure out how to find out which tables are actually being pulled into an analysis from a data connection within a Spotfire DXP. I have a library export, and I've been rummaging through the xml files within an analysis (AnalysisDocument.xml, DataAccessPlan.xml). I can use DataAccessPlan.xml to figure out what data connections are used within the DXP, but it lists ALL of the tables/views available within the data connection, and I'm trying to figure out which tables are actually being loaded into the DXP. I might have a data connection with 8 available tables/views, and I just want to get a listing of the 2 tables that I would see selected on the Data > Data Connection Properties window when I'm in Analyst for example.

I typically do my analysis in pure python (not IronPython) using the Beautiful Soup and/or xmlparse libraries to parse information found within the xml files within a DXP found in a much larger library export. I think there's some helpful functionality within Spotfire 14 to do some of what I'm looking for, but my organization is currently using 12.0.6 LTS. I also don't have access to any of the library scripting features that I believe come with separate licensing.

Any hints or help would be greatly appreciated.

  • Thanks 1
Link to comment
Share on other sites

Hi diablo,

The output is maybe not as nice as from a Python script, but this iron python script does list all the data tables within a dxp:

The last part of the article describes this code, which works fine for me:

# Alternatively, iterate through all tables and their columns
for t in Document.Data.Tables:
    print("Table:", t.Name)
    columnCollection = t.Columns
    for col in columnCollection:
        print("\t", col.Name, "(", col.Properties.DataType, ")")

Kind regards,

David

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...