Share your ideas for the JMP Scripting Unsession at Discovery Summit by September 17th. We hope to see you there!
Choose Language Hide Translation Bar
Highlighted
JulieSAppel
Level IV

save a table value and use it in a formula

Hi,

I need to grab a single value (baseline value) from a data table so I can use it in a formula to calculate a relative values.

 

I tried to use the the get values where functionality and save it as a variable. I don´t get an error but I don´t get an output either. What am I doing wrong?

 

col_dark = column(data table("splitsummary2"), "AUC dark phase absolute (ml/kg)") << Get Values Where(Column("Compound") == "Vehicle0mg/kg")

 

Br Julie

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
txnelson
Super User

Re: save a table value and use it in a formula

I have never heard of a function called "Get Values Where".  What I think you are refering to is "Get Rows Where()".  Below is a reworking of your code to what I think you want......

col_dark = :Name( "AUC dark phase absolute (ml/kg)" )[Data Table( "splitsummary2" ) <<
Get rows Where( :Compound == "Vehicle0mg/kg" )]
Jim

View solution in original post

2 REPLIES 2
Highlighted
txnelson
Super User

Re: save a table value and use it in a formula

I have never heard of a function called "Get Values Where".  What I think you are refering to is "Get Rows Where()".  Below is a reworking of your code to what I think you want......

col_dark = :Name( "AUC dark phase absolute (ml/kg)" )[Data Table( "splitsummary2" ) <<
Get rows Where( :Compound == "Vehicle0mg/kg" )]
Jim

View solution in original post

Highlighted

Re: save a table value and use it in a formula

dt = Data Table("splitsummary2");
// Get values as matrix and use the loc command to get the locations where compound is equal to "Vehicle0mg/kg". (In my table it appears 3 times). These locations you can use as  indices to gt the value(s) you need for further analysis.

m = Column( dt, "AUC dark phase absolute (ml/kg)" ) <<
Get as matrix();
c = Column( dt, "Compound" ) <<Get as Matrix();
col_dark = m[loc(c,"Vehicle0mg/kg")];

This should get you the value you need. [23330.7291666667]

Article Labels

    There are no labels assigned to this post.