Hi JMP Community :-)
Below is a table representing the data I'm looking at (in a lot smaller scale). I wish to create a list of the weights measured on the dates closest to "Arrival dates" for the specific IDs.
I used JMP to get my data in this order, and I tried combining Excels INDEX, MATCH and OFFSET functions to get my desired list, but can't seem to get the right result.
Hope someone out there can help :-)
|ID||ARRIVAL DATE||DATE1||WEIGHT1||DATE2||WEIGHT2||DATE3||WEIGHT3||DATE4||WEIGHT4||DATE NEAREST ARRIVAL||WEIGHT NEAREST ARRIVAL|
If I am understanding exactly what you need, I think the attached data table has the formulas for the 2 new columns you want that will produce the below results:
First of all thanks for taking the time to answer.
I am working with Raeish on this.
Could the formula be tweaked for another variable to only find the date nearest (before) but not equal to arrival date and the corresponding value at that time?
Attached is the same data table as I attached before, now with new formulas.
Please take the time to read the documentation on formula creation in
Hi Jim :-) Again, thank you so much for taking your time to reply :-)
We will definitely read about formula creation - Thank you for the tip!
As for the last file you sent, I've tried adding it to the previous formula - but it doesn't seem to change anything. You wrote that you sent the same data table as before(just with a new formula) but when I open it I only get this short formula, not the entire table. Is that right?
names default to here(1);
dt=current data table();
for each row(
dateMatrix = Matrix(:Date1,:Date2,:Date3,:Date4);
Thank you again,
My error....I attached the wrong file....I think the new attachement will work better
Great! THANK YOU!
One more question: is there a way to add the criteria that the weight nearest arrival has to be within 2 days of arrival(and if no such date exist leave it blank)?
Attached is a new version of the formulas. I am not sure if your date columns are JMP date/time columns. I made the assumption they are, and therefore, I use the In Datys() function to calculate the number of days to subtract for the comparison. If your column is not a JMP date/time value, you need to change the subtraction to the value for a day.
There are no labels assigned to this post.