Subscribe Bookmark RSS Feed

Parameters Problem

blue1994

Contributor

Joined:

Feb 27, 2017

hello.
Very sorry for disturbing, i really don't know how to do it.
Can anyone help me if I want do the array/list, meant now i want to do array[1], then it output will be S_GX_F40, then in this S_GX_F40, it will contains I_P2A GSVT .6/.045 Avg and I_N2A GSVT.3/.045 Avg  extract from my excel file. I can do out if i use array[1], it can comes out the product name which is S_GX_F40 in log, but the parameter for tat product i still cannot get it.
So, may i know is it possible to do it?
I have try, but still cannot.
Can anyone answer me?
Thanks a lot.

 

1 ACCEPTED SOLUTION

Accepted Solutions
ian_jmp

Staff

Joined:

Jun 23, 2011

Solution

I'm not sure that I have understood what you are after (and I see you have given an Excel screenshot).

 

But if you read all the data into JMP, it may be that the code below gives you some ideas:

 

NamesDefaultToHere(1);

// Test Table
dt = New Table( "From Excel",
				Add Rows( 6 ),
				New Column( "F_ID",
					Character,
					"Nominal",
					Set Values( {"1", "1", "2", "2", "2", "3"} )
				),
				New Column( "Parameters",
					Character,
					"Nominal",
					Set Values( {"1", "2", "3", "4", "5", "6"} )
				)
			);

// Get the values into a list
ids = Column(dt, "F_ID") << getValues;
params = Column(dt, "Parameters") << getValues;

// Loop over the distinct IDs and show which parameters correspond
distinctIDs = AssociativeArray(ids) << getKeys;
for (id = 1, id <= NItems(distinctIDs), id++,
	thisID = distinctIDs[id];
	thisParam = params[Loc(ids, thisID)];
	Print("For parameter "||thisID||" the corresponding parameters are:", thisParam);
);
6 REPLIES
erichill

Staff

Joined:

Oct 1, 2013

Hey, blue1994,

I'm not sure I'm quite following.  Are you importing this Excel worksheet into JMP somehow and then trying to extract values out of the resulting JMP data table?  If so, what method are you using to import the Excel worksheet?

Do you have a JSL script you are writing that doesn't quite do what you want?  If so, can you share that script here so we can maybe have a clearer idea what you are trying to accomplish?

Thanks,

Eric

blue1994

Contributor

Joined:

Feb 27, 2017

hi, Eric
Actually i now trying is to extract out the data from excel file, then do comparison with the dataset. Then i need generate out the charts. For example if using F_D is S_GX_F40, it will only have I_P2A GSVT .6/.045 Avg and I_N2A GSVT .6/.045 Avg inside the charts.

Below code is extract the target value and sigma value from excel file. But then i try using almost the same method to generate out the F_D and parameter, but cannot get it. And because one of my requirement is i cannot hard coding(i need in dynamic), so if there is N items of F_D, it can straight automate it.

 Thanks.

 

 

ian_jmp

Staff

Joined:

Jun 23, 2011

Solution

I'm not sure that I have understood what you are after (and I see you have given an Excel screenshot).

 

But if you read all the data into JMP, it may be that the code below gives you some ideas:

 

NamesDefaultToHere(1);

// Test Table
dt = New Table( "From Excel",
				Add Rows( 6 ),
				New Column( "F_ID",
					Character,
					"Nominal",
					Set Values( {"1", "1", "2", "2", "2", "3"} )
				),
				New Column( "Parameters",
					Character,
					"Nominal",
					Set Values( {"1", "2", "3", "4", "5", "6"} )
				)
			);

// Get the values into a list
ids = Column(dt, "F_ID") << getValues;
params = Column(dt, "Parameters") << getValues;

// Loop over the distinct IDs and show which parameters correspond
distinctIDs = AssociativeArray(ids) << getKeys;
for (id = 1, id <= NItems(distinctIDs), id++,
	thisID = distinctIDs[id];
	thisParam = params[Loc(ids, thisID)];
	Print("For parameter "||thisID||" the corresponding parameters are:", thisParam);
);
blue1994

Contributor

Joined:

Feb 27, 2017

Thanks ian for the response,
One question from me, is it possible that if i don't want to set the value above, can i straight extract the data(F_D and parameters) from my excel file? Because maybe in the future, if i have N items of F_D, so it can straight automate it from excel file.
Thanks
ian_jmp

Staff

Joined:

Jun 23, 2011

If you don't want to read all the data into JMP, you bcould think about accessing the Excel workbook via ODBC and SQL. Ideally using Query Builder.

blue1994

Contributor

Joined:

Feb 27, 2017