Jump to content

Change data without affecting visualisation


Cory Lim

Recommended Posts

Hi,

I have done up some filters and visualisations for a particular dataset that I'm working with.

I wish to create an additional dataset, which is essentially a copy of the original, so as to change the data connection source.

However, when I try to change the 'Data' property of my visualisation to the new dataset, it resets the visualisation and filters, even though the data is exactly the same.

Can I check if there's any way to change the data without having to create the entire visualisation from scratch Thanks!

Link to comment
Share on other sites

  • 2 weeks later...

Dear Kirsten,

as Cory mentioned, this was fixed in a newer version.

Anyway, here is a workaround which will solve your issue also with the old version. Please see below the description for a basic iron python script:

When you are changing the data table for a given visual in an older version you lose all the setting even though it has the same columns, you have to configure it from scratch.

Solution

If you change the data table using Ironpython it will keep the setting. You can either change the data table for a given visual or for the whole page.

Change the data table for a given visual only- Script:

from Spotfire.Dxp.Application.Visuals import *

visual.As[Visualization]().Data.DataTableReference = dataTable

 

There are two script parameters needed:

 

visual (Type: Visualization): add the visual where you want to change the data table

dataTable (Type: DataTable): add the new dataTable to be used by the above defined visual

 

Attached a screenshot.

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...