turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- JMP User Community
- :
- Discussions
- :
- Discussions
- :
- Script Question

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Apr 11, 2016 10:23 AM
(2248 views)

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

Solved! Go to Solution.

1 ACCEPTED SOLUTION

Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Apr 11, 2016 12:26 PM
(4286 views)

Solution

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 ) ) ),
```

6 REPLIES

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Apr 11, 2016 10:52 AM
(2143 views)

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Apr 11, 2016 10:57 AM
(2143 views)

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Apr 11, 2016 11:53 AM
(2143 views)

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 ) )
);
```

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Apr 11, 2016 12:19 PM
(2143 views)

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Apr 11, 2016 12:26 PM
(4287 views)

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 ) ) ),
```

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Apr 11, 2016 12:32 PM
(2143 views)