Share your ideas for the JMP Scripting Unsession at Discovery Summit by September 17th. We hope to see you there!
Choose Language Hide Translation Bar
Highlighted
rfeick
Level IV

Contains with Variable Column Reference

Hello,

   As part of a script I am trying to identify and then separate out data deliminated by a ^.  This script deals with production data and the ^ indicates that multiple entries were made at the same time and they show up in the same row. I want to be able to identify the rows with multiple entries by finding rows where the NC Code column contains a ^ and then separate out the multiple entries each into their own row.

   I'm running into an issue when I try to copy the data into the newly added rows. Not all the character columns contain ^ so some will just need the one value copied down into both new rows, while those with the ^ will need one of the two values copied into each added row.

  I have attached an example section of the code. I can't figure out why line 10 works, but line 20 does not. I've also tried it with just Contains(all_cols[s], "^") and c=all_cols[s]; Contains(c, "^"); but neither of those options worked either.

Thanks for your help and input!

1 ACCEPTED SOLUTION

Accepted Solutions
rfeick
Level IV

Re: Contains with Variable Column Reference

Actually, I ended up finding a solution after I posted this. If you replace Eval Expr(all_cols[s]) in lines 20-22 with all_cols[s][i] it will work.

View solution in original post

1 REPLY 1
rfeick
Level IV

Re: Contains with Variable Column Reference

Actually, I ended up finding a solution after I posted this. If you replace Eval Expr(all_cols[s]) in lines 20-22 with all_cols[s][i] it will work.

View solution in original post

Article Labels

    There are no labels assigned to this post.