Skip to Main Content
Spotfire Ideas Portal
Status Already exists
Product Spotfire
Categories User Experience
Created by Guest
Created on Apr 23, 2021

Property control to enable customization of columns in tables

I have a big table (>100 columns) and 1,5M rows. I display the full table, and it is quite a mess for users that are only interested by few columns at a time (but never the same columns, never the same users). They would like to be able to select the columns to see.

I tried a pivot table with rows set by default at ID level (primary key) + with a property control for cells (so that it is possible to let the user choose his columns in a list then) but ... with 1,5M rows in a pivot table, it is too long to load it. I would like to be able to do the same kind of things but in a table

Concretely, it is just to have "expression" window for the select of columns as we have for the others vizualizations insteadd of the current display, it would enable to select the columns as before and/or to write a property control.

  • ADMIN RESPONSE
    Jun 15, 2021

    There are 2 ways to change data table columns to display via property control.


    Method 1: Selecting one or multiple columns to display on a table visualization
    1. Create a Text area and add a Property Control of type List box (multiple select)

    2. In the Property Control setting:

      1. Add a new Document Property of type String. Let's name it "columnSelection".

      2. Set property value through column selection

      3. Select columns to include in the Property Control

      4. Now click "Script" button and select "Execute the script selected below:" and click New

      5. Add script parameter of type Visualization and select your data table. Let's name it "tablePlot"

      6. Paste-in the script below

    Script

    #get document property
    from Spotfire.Dxp.Data import DataPropertyClass
    selection = Document.Data.Properties.GetProperty(DataPropertyClass.Document, "columnSelection").Value

    #apply column selection to table
    from Spotfire.Dxp.Application.Visuals import *
    tablePlot.As[TablePlot]().Columns.Clear()
    tablePlot.As[TablePlot]().Columns.AddRange(selection)


    Method 2: Selecting groups of columns to display on a table visualization

    This method is described in this community article: https://community.tibco.com/wiki/example-script-modify-which-columns-are-shown-table-plot

  • Attach files
  • Guest
    Reply
    |
    Jun 15, 2021

    Hello, it works ! thank you very much.
    Brgds,
    Guillaume

    De : TIBCO Software Inc
    Envoy�� : mardi 15 juin 2021 00:47
    �� : Jaworski, Guillaume (DZ CZ WD) - AF
    Objet : Arnaud Varin responded to idea TS-I-8254 Property control to enable customization of columns in tables

  • Admin
    Arnaud Varin
    Reply
    |
    Jun 14, 2021

    Hello Guillaume,

    There are 2 ways to change data table columns to display via property control.


    Method 1: Selecting one or multiple columns to display on a table visualization
    1. Create a Text area and add a Property Control of type List box (multiple select)

    2. In the Property Control setting:

      1. Add a new Document Property of type String. Let's name it "columnSelection".

      2. Set property value through column selection

      3. Select columns to include in the Property Control

      4. Now click "Script" button and select "Execute the script selected below:" and click New

      5. Add script parameter of type Visualization and select your data table. Let's name it "tablePlot"

      6. Paste-in the script below

    Script

    #get document property
    from Spotfire.Dxp.Data import DataPropertyClass
    selection = Document.Data.Properties.GetProperty(DataPropertyClass.Document, "columnSelection").Value

    #apply column selection to table
    from Spotfire.Dxp.Application.Visuals import *
    tablePlot.As[TablePlot]().Columns.Clear()
    tablePlot.As[TablePlot]().Columns.AddRange(selection)

    A DXP example is attached for this method.


    Method 2: Selecting groups of columns to display on a table visualization

    This method is described in this community article: https://community.tibco.com/wiki/example-script-modify-which-columns-are-shown-table-plot

    Please let me know if these method solve your request.