cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Sign-in to the JMP Community will be unavailable intermittently Dec. 6-7 due to a system update. Thank you for your understanding!
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.
  • JMP 19 is here! Learn more about the new features.

Discussions

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

Question on JSL filling row blanks within a column

Hello All,

I am relatively new to JSL. I have a character column labeled State, within the column are the initals of the various US states. However, within this column there are blanks, I want to be able to created a JSL that will allow me to replace the blanks with the word "International". I have been looking all over and have been unable to find a coding that would allow me to replace the blanks within my State column with International.

 

Any advice would be appreciated!!  

1 ACCEPTED SOLUTION

Accepted Solutions
pmroz
Super User

Re: Question on JSL filling row blanks within a column

dt = New Table( "Untitled 24", Add Rows( 6 ),
	New Column( "State", Character, "Nominal",
		Set Values( {"PA", "DE", "NJ", "", "", "VA"} )
	)
);

blank_rows = dt << get rows where(as column(dt, "State") == "");

if (nrows(blank_rows) > 0,
	column(dt, "State")[blank_rows] = "International";
);

View solution in original post

3 REPLIES 3
Sully
Level III

Re: Question on JSL filling row blanks within a column

The data table is being opened from a text file. I am not querying to get the data.

pmroz
Super User

Re: Question on JSL filling row blanks within a column

dt = New Table( "Untitled 24", Add Rows( 6 ),
	New Column( "State", Character, "Nominal",
		Set Values( {"PA", "DE", "NJ", "", "", "VA"} )
	)
);

blank_rows = dt << get rows where(as column(dt, "State") == "");

if (nrows(blank_rows) > 0,
	column(dt, "State")[blank_rows] = "International";
);
Sully
Level III

Re: Question on JSL filling row blanks within a column

That worked perfectly! Thank you!

Recommended Articles