This website uses Cookies. Click Accept to agree to our website's cookie use as described in our Privacy Policy. Click Preferences to customize your cookie settings.

- JMP User Community
- :
- Discussions
- :
- Re: column reference plot of graph builder

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

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.

Submit your abstract to the call for content for Discovery Summit Americas by April 23. Selected abstracts will be presented at Discovery Summit, Oct. 21- 24.

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
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content

Created:
Oct 10, 2017 05:56 PM
| Last Modified: Oct 15, 2017 09:34 AM
(9427 views)

Thank you for giving amazing suggestions.

I encountered something else and I have always been curious about this. Whenever I come across this, I try to stack to circumvent the problem.

In a graph builder, how to plot without knowing the name of the column

```
collist =fudt<< get column names(string);
qdt=Char(collist[9]); //Assuming I want to plot column number 9 on the Y axis, say for example "Data_ABC"
gbfc = fudt<<Graph Builder(
Size( 1899, 922 ),
Show Control Panel( 0 ),
Variables(
X( :Index ),
X( :Lot, Position( 1 ) ),
X( :Wafers, Position( 1 ) ),
Y( :qdt),// THIS DOESN't WORK - I want to understand the syntax
Color( :temp )
)
Elements( Points( X( 1 ), X( 2 ), X( 3 ), Y, Legend( 33 ) ) )
);
```

Thank you.

1 ACCEPTED SOLUTION

Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content

Created:
Oct 10, 2017 06:10 PM
| Last Modified: Oct 15, 2017 09:43 AM
(10885 views)
| Posted in reply to message from vishwasanj 10-10-2017

```
dt = Current Data Table();
cdlg = Column Dialog( clist = ColList( "Pick 2 Columns", Min Col( 2 ), Max Col( 2 ) ) );
cols = cdlg["clist"];
newColExpr = Expr( dt << New Column( "Radius", Numeric, Formula( Sqrt( Expr( cols[1] ) ^ 2 + Expr( cols[2]; ) ^ 2 ) ) ) );
Eval( Eval Expr( newColExpr ) );
```

Best

Uday

Uday

9 REPLIES 9

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content

Created:
Oct 10, 2017 06:10 PM
| Last Modified: Oct 15, 2017 09:43 AM
(10886 views)
| Posted in reply to message from vishwasanj 10-10-2017

```
dt = Current Data Table();
cdlg = Column Dialog( clist = ColList( "Pick 2 Columns", Min Col( 2 ), Max Col( 2 ) ) );
cols = cdlg["clist"];
newColExpr = Expr( dt << New Column( "Radius", Numeric, Formula( Sqrt( Expr( cols[1] ) ^ 2 + Expr( cols[2]; ) ^ 2 ) ) ) );
Eval( Eval Expr( newColExpr ) );
```

Best

Uday

Uday

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content

That was cool. Thank you Uday.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content

Your variable qdt points to the name of the column. It is not a column itself. You have to reference it using the construct column(fudt, qdt):

```
gbfc = fudt << Graph Builder(
Size( 1899, 922 ),
Show Control Panel( 0 ),
Variables(
X( :Index ),
X( :Lot, Position( 1 ) ),
X( :Wafers, Position( 1 ) ),
Y( Column( fudt, qdt ) ), // use column pointed to by the qdt variable
//Y( :qdt), // THIS DOESN't WORK - I want to understand the syntax
Color( :temp ),
),
Elements( Points( X( 1 ), X( 2 ), X( 3 ), Y, Legend( 33 ) ) )
);
```

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content

Interesting. Let me try that syntax. Thank you pmroz

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content

Uday,

Thanks for your post. Here i can see the fomula code as follows. Can you explan what means cols&#**91**;**1**&#**93 and cols[2]?**

Formula**(** Sqrt**(** Expr**(** cols&#**91**;**1**&#**93**; **)** ^ **2** + Expr**(** cols&#**91**;**2**&#**93**; **)** ^ **2** **)** **)**

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content

@GoodMan,

Thanks for pointing out . I recollected and recalled that from the post . Not the way I would do it .

```
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
ColNames = dt << Get Column Names("String");
Stmt = "";
Stmt = ":" || ColNames[2] || "*2";
Eval( Parse( Eval Insert("\[ dt << New Column("Age_Squared",Numeric,Continuous,Formula(^Stmt^)); ]\" ) ) );
```

Best

Uday

Uday

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content

Created:
Oct 15, 2017 02:03 AM
| Last Modified: Oct 15, 2017 09:45 AM
(9287 views)
| Posted in reply to message from uday_guntupalli 10-15-2017

Thanks. Following your new code, go back the the previous example, still i have some problem. Can you help me?

```
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
cdlg = Column Dialog( clist = ColList( "Pick 2 Columns", Min Col( 2 ), Max Col( 2 ) ) );
cols = cdlg["clist"];
newColExpr = Expr( dt << New Column( "Radius", Numeric, Formula( Sqrt( Expr( cols ) ^ 2 + Expr( cols) ^ 2 ) ) ) );
Eval( Eval Expr( newColExpr ) );
```

GM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content

Uday,

I checked your previous code again. Now i understand that [=[. So now I can figure it out now. Thank you anyway!

GM

I checked your previous code again. Now i understand that [=[. So now I can figure it out now. Thank you anyway!

GM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content

Those were meant to be square brackets. I've edited the post and corrected that.

-Jeff

- © 2024 JMP Statistical Discovery LLC. All Rights Reserved.
- Terms of Use
- Privacy Statement
- About JMP
- JMP Software
- JMP User Community
- Contact