I am trying to add 2 columns in table (dt_delta) to table (dt) using update command by comparing 2 columns. dt has 40 rows with unique rows identified by "Age" column and dt_delta has 50 unique rows identified by Age.
Hence i am trying to add data from two columns, Var1 and Var2 in dt_delta to dt table by matching Age columns.
Var1 and Var2 columns have formula in them.
I copied the executed script and pasted in my JSL script but issue is when i run entire script, update doesn't happen everytime and when i select portion of script and try to execute it, it does update correctly.
Can you please advise.
dt << Update(
With( dt_delta ),
Match Columns ( :Age = Age ),
Add Columns from Update table( :Var1, :Var2 )
Without looking at the actual data and the script, I have seen the behavior you describe sometimes if you lose the reference to the data table you think you are addressing. Short of sharing your sample data and sample script and testing on an example one thing I would advice you check is to try and print the name of the tables to the log that you are using before and after the script is breaking and see if it is referring to the correct table
Yes I have tried both things -have actual names of tables instead of dt or dt_delta and tried with dt or dt_delta.
Both have issues updating.
I have confirmed data table names by checking in log.
The only thing I see, is that you have not scoped your second reference to variable "Age". The matching columns elemet shoud be:
Match Columns ( :Age = :Age )
Is the data table you are attempting to update to or from, a data table that is linked to another data table? If you could attach the data tables you are using it would be beneficial in debugging the issue.
sorry can't attach since it has some confidential data in it.
The tables are independent.
I tried running the script on another machine and "update" did happen and script went fine.
Tried on 2 more machines and got intermittent results. I tried with JMP 12.1, JMP12.2 and JMP13. all have intermittent issues.
I am not sure if this is JMP related issue?
You might try evaluating the formulas in both data tables before joining/updating them. I often find this fixes issues where a script runs line by line but not all at once.
dt1 << Run Formulas dt2 << Run Formulas
I have been trying to replicate it but not update works fine - no changes
I added these in script and hope it will help!
There are no labels assigned to this post.