cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
StarfruitBob
Level VI

Column data not updating through script until selected separately

Hello,

 

I'm having very curious issues that I haven't found within the JMP community yet. Using JSL, here's what's happening:

  1. Import dataset (dt)
  2. Correct values in :Col1
    1. Since I'm replacing the corrected values into the same cell they're read from, I'm using a for loop
    2. I have this same loop set up in other scripts. I've checked a few and they're working correctly still 
  3. Use :Col1 in formula for :Col2
  4. :Col2 matched to join tables with dt.
    1. The joined table does not have :Col1
      (after script completes)
  5. I notice, at a glance, that :Col1 hasn't updated
  6. I highlight the code in the script I created and run block separately & :Col1 updates, as it was supposed to in step 2
    1. Nothing was done differently except singling out the code to run separately.
  7. Values created by step 3 still have the unupdated values of :Col1, thus the join didn't work as intended

Since this issue seems to be isolated to the current script I'm working on, this is a real head scratcher, mainly because this is one of the very first blocks of code in the script. Before this there are column creations and column renamings being done. There aren't many of these either. About 20 lines of code between dataset import and this block of code.

 

Technically I'm having this problem all over my code in different ways, but the earliest instance is above. This "new" script is a copy of a known working script, but modified to pull data from a different source. There are differences between the data sources, and those are already accounted for.  I'm having this issue for column deletion & other for loops. I've even recreated a portion of this script BOTH from scratch and another try from point-and-clicking and copying and pasting from the enhanced log.  Everything has this issue. I'm thinking it must be something to do with the source (SQL server), but no one else is having this issue. I'm the only one pulling from the SQL server and using JMP however.

Any thoughts?

Learning every day!
2 ACCEPTED SOLUTIONS

Accepted Solutions
peng_liu
Staff

Re: Column data not updating through script until selected separately

A hunch: try Wait(0) where you expect to see an update.

 

peng_liu_0-1671153314846.png

 

 

View solution in original post

jthi
Super User

Re: Column data not updating through script until selected separately

Besides trying Wait(0), if your table has formulas try using << Run formulas. This should force JMP to evaluate all pending formulas before script execution continues

dt << Run Formulas();

jthi_0-1671170272534.png

 

or even << Rerun formulas (though this should be unnecessary as it evaluates all formulas, even the ones not pending)

dt << Rerun Formulas;

jthi_1-1671170280396.png

 

-Jarmo

View solution in original post

3 REPLIES 3
peng_liu
Staff

Re: Column data not updating through script until selected separately

A hunch: try Wait(0) where you expect to see an update.

 

peng_liu_0-1671153314846.png

 

 

jthi
Super User

Re: Column data not updating through script until selected separately

Besides trying Wait(0), if your table has formulas try using << Run formulas. This should force JMP to evaluate all pending formulas before script execution continues

dt << Run Formulas();

jthi_0-1671170272534.png

 

or even << Rerun formulas (though this should be unnecessary as it evaluates all formulas, even the ones not pending)

dt << Rerun Formulas;

jthi_1-1671170280396.png

 

-Jarmo
StarfruitBob
Level VI

Re: Column data not updating through script until selected separately

@peng_liu @jthi Thank you! wait() worked! Right above the loop I describe above, there's a formula that's run to populate a column that's required for the loop. Thank you both!

Learning every day!