cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Have your say in shaping JMP's future by participating in the new JMP Wish List Prioritization Survey
Choose Language Hide Translation Bar
MH1
MH1
Level II

"If statement" does not work properly when running the whole script but if I only run the part in question it works well

Hi,

 

I am note very experienced in scripting and have a question (may be I am missing some basic syntax here?).

I use the following script to create in a data table new columns with an "if statement".

 

For new column "Headache 1" this works well. For "Fever 1" it does not work. New column is created (but with data type numeric and data model continuous instead of character, nominal and if statement does not work) .

 

Interestingly, if I only run in the script editor the part below it works very well (column then is character, nominal and also the values >=38 are transferred to "Yes" properly.

 

Reference column "Converted Temperature" in the if"statement" is numeric, continuous.

 

So what I am doing wrong here?

 

Thanks for support !

 

New Column( "Fever 1",
Character,
"Nominal",
Formula( If( :Converted Temperature >= 38, "Yes", "" ) ), Set Selected );

 

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: "If statement" does not work properly when running the whole script but if I only run the part in question it works well

I am not finding an error.

txnelson_0-1640098567833.png

You may want to check the  data table for duplicate column names.

Jim

View solution in original post

2 REPLIES 2
txnelson
Super User

Re: "If statement" does not work properly when running the whole script but if I only run the part in question it works well

I am not finding an error.

txnelson_0-1640098567833.png

You may want to check the  data table for duplicate column names.

Jim
MH1
MH1
Level II

Re: "If statement" does not work properly when running the whole script but if I only run the part in question it works well

Thank you Jim. The issue is resolved. I made a mistake in choosing the wrong data model in a later part of the script and now I am using the debug function (my learning today!) Great support!