Jump to content

How to add values to a table by selecting specific rows in spotfire

Abubakar anwar

Recommended Posts

hmm no I do not understand. The user selects random rows. Then how are the numbers chosen? And what is the existing column that the number is added to? Do you mean take an existing column and add a number to it? You would need to create a new column.

Based on my limited understanding, I guess you need a script of some sort, Iron Python or Python/R.

Link to comment
Share on other sites

yes that is probably what i believe too.

so i have an existing column "A" with values let's say for explanation purpose "All the countries in the world."

then i have another column "B" containing numbers "1-10"

so the calculated column "C" needs to be populated with the " rows i select from column A, add the number from column B to the new calculated column C.

I hope this explains the situation.

any support will be appreciated.


Link to comment
Share on other sites


1. Create a python data function that takes an x column as an input parameter and outputs an x column (x is your input and output column script parameters)datafunction.png.a923310c721a4f97a0bff9adb098e630.png

x[:]=[i+1 for i in x]

2. Run the data function and select your current_holidays column as the input for x and select the marking to limit the data from

input.png.9cc7e90c59bb59451c2391be96a14565.png3. For the output choose to map the input rows to x and replace columns on update. You can choose to refresh the function automatically if you want to output.png.e834575240077dc4d9cfb6d5051f26ab.png 

4. Create a calculated column to replace the null values from the data function output

sn([current_holidays (2)],[current_holidays] + 5)
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...