- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Searching Column name
Hi,
I need to search the column names which has the string "fo" in it and select those column in the Y,Columns.
How do I include this in JSL?
Any help on this would be very much appreciated
Thanks,
Jack
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Searching Column name
It is a new feature in JMP16.
You will have to use For loop to get the same result in JMP15.
Something like this:
filteredCols = {};
For(i = 1, i <= N Items(colList), i++,
If(Contains(colList[i], "SS"), Insert Into(filteredCols, colList[i]))
);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Searching Column name
I think Scripting Index can get you quite close:
I wouldn't generally suggest deleting rows in JMP, hiding and Excluding is usually better option.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Searching Column name
Here is an example where all columns containing SS are added to dialog:
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Water Treatment.jmp");
colList = dt << Get Column Names("String");
a = Filter Each({value}, colList, Contains(value, "SS"));
obj = dt << Explore Outliers(Y(Eval(a)));
obj << Relaunch Analysis;
obj << Close Window();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Searching Column name
Many Thanks @jthi
I am not sure if JMP 15 supports Filter Each command. I tried the script and it's giving me an error
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Searching Column name
It is a new feature in JMP16.
You will have to use For loop to get the same result in JMP15.
Something like this:
filteredCols = {};
For(i = 1, i <= N Items(colList), i++,
If(Contains(colList[i], "SS"), Insert Into(filteredCols, colList[i]))
);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Searching Column name
I want to select and delete those particular rows. How can I include in the jsl script?
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Water Treatment.jmp");
colList = dt << Get Column Names("String");
filteredCols = {};
For(i = 1, i <= N Items(colList), i++,
If(Contains(colList[i], "SS"), Insert Into(filteredCols, colList[i]))
);
dt << Explore Outliers(Y(Eval(filteredCols)),
Show only columns with outliers( 1 )
,Quantile Range Ouliers
);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Searching Column name
I think Scripting Index can get you quite close:
I wouldn't generally suggest deleting rows in JMP, hiding and Excluding is usually better option.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Searching Column name
Happy Wednesday @jthi ,
I was attempting to add another contain statement to filter all the columns containing the string "SE" but it didn't seem to work as expected.
I added Contains(colList[i], "SE") in the if loop
Any thoughts?
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Water Treatment.jmp");
colList = dt << Get Column Names("String");
filteredCols = {};
For(i = 1, i <= N Items(colList), i++,
If(Contains(colList[i], "SS"),
Contains(colList[i], "SE"),
Insert Into(filteredCols, colList[i]))
);
obj = dt <<
Explore Outliers(
Y((Eval(filteredCols) )));
obj << Tail Quantile( 0.1 );
obj << Quantile Range Outliers;
obj<< Select Rows(All);
Thanks,
Jack
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Searching Column name
This needs to be an OR clause
If(Contains(colList[i], "SS") |
Contains(colList[i], "SE"),
Insert Into(filteredCols, colList[i])
);