cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Don’t miss your chance to experience Discovery Summit Europe at our best available rate! Early bird registration through 31 Oct.
  • Graph Builder Toolbar streamlines interactive graphing. Creates shortcuts on Report and GraphBuilder Helpers toolbars. Download and install the extension.
  • JMP will suspend normal business operations for our Rest and Recharge Day on Friday, October 2, 2026.
    Regular business hours will resume on Monday, October 5, 2026.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
Rini_Kar
Level II

Update column with values when another columns contains specific value

Hi, 

 

I have two columns named 'Mailing country' and 'Mailing state'. Some of the rows under Mailing country particularly for USA does not contain any value.  I would like to update Mailing country column with value 'USA' when Mailing state contains values corresponding to various state code in the US. I have close to 250,000 rows, so manually update is not possible. I am new to JMP and scripting and I cannot figure out a way to solve this issue.

 

I have attached a screenshot of my sample data. Any help would be appreciated. Thanks in advance.

 JMP.JPG

11 REPLIES 11
ACraig
Level II

Re: Update column with values when another columns contains specific value

Hello,

This might be a silly question but when using this code do you use it by editing the formula of the column? I did it as a formula like this since I am not doing it based off of a missing value. I am trying to update my column Vendor so that when the column Label equals "MnDOT Est." the vendor equals "MnDOT". But it gives me a Column Vendor Formula Interrupted error with an Illegal Reference thing. It changes the ones to MnDOT but it just deletes all the others. I hope that makes sense.

  

For Each Row(
        temp = :Vendor;
        :Vendor = If( :Label == "MnDOT Est.", "MnDOT", temp);
);
txnelson
Super User

Re: Update column with values when another columns contains specific value

This code needs to be run as a separate script, not as a formula.
Jim

Recommended Articles