Kinimod24 Posted June 24 Share Posted June 24 Hello, I have cross table that has multiple calculated columns controlled by input property controls (highlighted in yellow). It works fine but requires a user to change these to get desired data. I want these manual inputs to be replaced and controlled by what is in a separate Data Table that I added (image attached) . The fields of this data table should be the property control basically. How can I do this? Link to comment Share on other sites More sharing options...
David Boot-Olazabal Posted June 25 Share Posted June 25 Hi Kinimod, You can use an iron python script that pushes the values in the data table to different document properties. These document properties, will then be used as input for your cross-table. This page is a good starting point: Kind regards, David Link to comment Share on other sites More sharing options...
Kinimod24 Posted June 25 Author Share Posted June 25 thank you for the help @David Boot-Olazabal. Unfortunately, I am not knowledgeable with ironPyton. It will take me some time to research and learn these functions. Link to comment Share on other sites More sharing options...
David Boot-Olazabal Posted June 26 Share Posted June 26 Hi Kinimod, Below is an example of pushing a value (in this number of rows from a single data table) into a document property: # Import Class from Spotfire.Dxp.Data import * # Set variable for table name tableName='Data Table' # Set variable for column name in the table columnToSearch='Year' # Assign "Mapping" table as active table activeTable=Document.Data.Tables[tableName] # capture marking and set value of "Year" column to CellVal document property rowIndexSet=Document.ActiveMarkingSelectionReference.GetSelection(Document.Data.Tables[tableName]).AsIndexSet() if rowIndexSet.IsEmpty !='false': CellVal = Document.Data.Tables[tableName].Columns[columnToSearch].RowValues.GetFormattedValue(rowIndexSet.First) # Pass CellVal and Catval Variable value to document properties Document.Properties["Year"] = CellVal In the example above, 'Data Table' is the name of my Data Table. 'Year' is the column I want to push to a document property, called "Year". When I run this code, the Document Property Year is filled with 2023 (as that was my marked year): And here is another example you can look at: Once you have a document property, you can display it in a text area, using a label property control. Kind regards, David Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now