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

- JMP User Community
- :
- Discussions
- :
- How to use a column dialog list for column switcher?

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

Highlighted

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

May 11, 2020 2:00 PM
(435 views)

Hello everyone,

I want to create a script where a list of columns is selected in a column dialog and, later on, appears in the column switcher of graph builder.

The column name is unspecific in order to use the script for different data tables. I started to write a small code, however, in this version the "column switcher columns" need to be selected by the user manually after closing the column dialog. I am quite new to JSL and would appreciate some help to solve this problem.

```
Names Default to Here(1);
dt = Current Data Table() << Get Column Names;
cd = Column Dialog(
colx = ColList( "X", Max Col( 1 ), Modeling Type( "Continuous" ) ),
coly = ColList( "Y", Min Col( 1 ), Modeling Type( "Continuous" ) ),);
Graph Builder(
Size( 400, 300 ),
Show Control Panel( 0 ),
Variables( X( colx[1] ), Y( coly[1] ) ),
Elements( Line( X, Y, Legend( 3 ) ) ),
Column Switcher( coly[1] )
```

);

1 ACCEPTED SOLUTION

Accepted Solutions

Highlighted

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

The Column Dialog requires a unique method for retrieving the values from the Window. The following script is a rework of your script adding in the Column Switcher etc.

```
Names Default To Here( 1 );
dt = Current Data Table() << Get Column Names;
cd = Column Dialog(
colx = ColList( "X", Max Col( 1 ), Modeling Type( "Continuous" ) ),
coly = ColList( "Y", Min Col( 1 ), Modeling Type( "Continuous" ) ),
);
colx = cd["colx"];
coly = cd["coly"];
Graph Builder(
Size( 400, 300 ),
Show Control Panel( 0 ),
Variables( X( colx[1] ), Y( coly[1] ) ),
Elements( Line( X, Y, Legend( 3 ) ) ),
Column Switcher( coly[1], coly )
);
```

Jim

2 REPLIES 2

Highlighted

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

The Column Dialog requires a unique method for retrieving the values from the Window. The following script is a rework of your script adding in the Column Switcher etc.

```
Names Default To Here( 1 );
dt = Current Data Table() << Get Column Names;
cd = Column Dialog(
colx = ColList( "X", Max Col( 1 ), Modeling Type( "Continuous" ) ),
coly = ColList( "Y", Min Col( 1 ), Modeling Type( "Continuous" ) ),
);
colx = cd["colx"];
coly = cd["coly"];
Graph Builder(
Size( 400, 300 ),
Show Control Panel( 0 ),
Variables( X( colx[1] ), Y( coly[1] ) ),
Elements( Line( X, Y, Legend( 3 ) ) ),
Column Switcher( coly[1], coly )
);
```

Jim

Highlighted
##

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

Re: How to use a column dialog list for column switcher?

Thanks a lot Jim for your prompt reply! Your solution works perfectly

Article Labels

There are no labels assigned to this post.