cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
JMP is taking Discovery online, April 16 and 18. Register today and join us for interactive sessions featuring popular presentation topics, networking, and discussions with the experts.
Choose Language Hide Translation Bar
Steven_Moore
Level VI

Script Question

The following is part of a script I am trying to run. I want to divide my X variable before plotting. I have tried several things, but am not getting it right. Can someone help me?

Thanks!

Graph Builder(
Variables(
X( :Line 160 Cases ),
Y( :Line 160 Broke ),
Wrap( :Month ),
Color( :Month )
),
Points( X, Y, Legend( 27 ) ),
Line Of Fit( X, Y, Legend( 29 ), Confidence of Fit( 0 ), Equation( 1 ) )
),
Steve
1 ACCEPTED SOLUTION

Accepted Solutions
jerry_cooper
Staff (Retired)

Re: Script Question

Sorry, you need another closed parentheses in the X variable line (I neglected to put it there in the code that I pasted):

 

           X(  Transform Column( "My X/1000", Formula( :Line 160 Cases / 1000 ) ) ),

 

 

 

View solution in original post

6 REPLIES 6
txnelson
Super User

Re: Script Question

I do not understand what you are saying when you say that you want to divide your X variable?  Group it in the graph, divide it by some number, split the data into separate subsets?????

Jim
Steven_Moore
Level VI

Re: Script Question

Jim,  I want to divide each X value by 1000 before plotting.  I don't want to create another column and the current X column is being used in formulas for other columns already, so I don't want to have to edit all those formulas.

Thankls!

Steve
jerry_cooper
Staff (Retired)

Re: Script Question

Try this:

 

Graph Builder( 
     Variables(
           X(  Transform Column( "My X/1000", Formula( :Line 160 Cases / 1000 ) ),
           Y( :Line 160 Broke ),
           Wrap( :Month ),
           Color( :Month )
     ),
     Points( X, Y, Legend( 27 ) ),
     Line Of Fit( X, Y, Legend( 29 ), Confidence of Fit( 0 ), Equation( 1 ) )
);
Steven_Moore
Level VI

Re: Script Question

No luck:  I get an error message:  Unexpected end of input.  Perhaps there is a missing "," or ")".  Trying to parse arguments of function "Graph Builder".  Line 21 Column2:)

I typed the code exactly as you have it.  I even copied and pasted, but no luck.

Steve
jerry_cooper
Staff (Retired)

Re: Script Question

Sorry, you need another closed parentheses in the X variable line (I neglected to put it there in the code that I pasted):

 

           X(  Transform Column( "My X/1000", Formula( :Line 160 Cases / 1000 ) ) ),

 

 

 

Steven_Moore
Level VI

Re: Script Question

Bingo!!!!  That got it.  Thanks for your help!

Steve