cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
The Discovery Summit 2025 Call for Content is open! Submit an abstract today to present at our premier analytics conference.
Get the free JMP Student Edition for qualified students and instructors at degree granting institutions.
Choose Language Hide Translation Bar
View Original Published Thread

How to select rows that match a value in a list

overview

The following example shows how to select rows in a data table that contain values ​​stored in a JSL list.

procedure

In a JMP session, click the File menu and select New > Script. Copy and paste the following script into the script window. To run the example script, click the Edit menu and select Run Script.

/* サンプルのデータテーブルを開きます。 */
dt = Open( "$SAMPLE_DATA\Big Class.jmp" );

/* 年齢のリストを作成します。 */
myList = {9, 12, 15, 17, 18};

/* リスト内の年齢を持つすべての行を選択します。 */
dt << Select Where( Contains( myList, :年齢 ) );

Wait( 2 );           // この行はデモンストレーション目的です。
dt << Clear Select;  // この行はデモンストレーション目的です。

/* 学生の名前のリストを作成します。 */
myStudents = {"HENRY", "ROBERT", "BARBARA", "SALLY", "MARION"};

/* リスト内の名前を持つすべての行を選択します。 */
dt << Select Where( Contains( myStudents, :名前 ) );


Additional Documentation

For more information about the JMP scripting language, see the JMP Scripting Guide . Access the guide by clicking Help on the JMP menu and selecting JMP Help. Select Scripting Guide from the list of online help contents.

Note: This FAQ is based on the following JMP Note:
JMP Note 575348 - How to select rows that match any value in a list


This post originally written in Japanese and has been translated for your convenience. When you reply, it will also be translated back to Japanese.

Details