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
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]))
);
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.
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();
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
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]))
);
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
);
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.
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
This needs to be an OR clause
If(Contains(colList[i], "SS") |
Contains(colList[i], "SE"),
Insert Into(filteredCols, colList[i])
);