<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Return a Specific Row With Multiple Criteria - For Beginners in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Return-a-Specific-Row-With-Multiple-Criteria-For-Beginners/m-p/51268#M29080</link>
    <description>&lt;P&gt;Here is the attachment&amp;nbsp;I just mentioned...&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 14 Feb 2018 04:45:05 GMT</pubDate>
    <dc:creator>jlrouquette</dc:creator>
    <dc:date>2018-02-14T04:45:05Z</dc:date>
    <item>
      <title>Return a Specific Row With Multiple Criteria - For Beginners</title>
      <link>https://community.jmp.com/t5/Discussions/Return-a-Specific-Row-With-Multiple-Criteria-For-Beginners/m-p/50765#M28848</link>
      <description>&lt;P&gt;I'm&amp;nbsp;not new to JMP but I'm&amp;nbsp;pretty much brand new to the scripting of this sort.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a table with ≈8mm rows and 80 columns.&amp;nbsp; Ive&amp;nbsp;just updated it with 3 additional columns and 2,000 rows.&amp;nbsp; I need to return a specific "Formation" from the 2,000-row update for each of the 8mm rows from the original table.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to do so under a couple criteria.&amp;nbsp; IF "well.name" = "Well.Name" AND "BitDepth" &amp;lt; "FormationTVD" THEN "Formation".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can break the update back out of the table if that makes more sense but I couldn't&amp;nbsp;figure out how to manage this another way either.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Lastly, I've read several discussions&amp;nbsp;on this or similar topics and I've&amp;nbsp;seen things similar to "dt&amp;nbsp;= blahblah; dt&amp;nbsp;&amp;lt;&amp;lt; blah" which I don't&amp;nbsp;understand at all.&amp;nbsp; If explaining this in those terms makes the most sense please&amp;nbsp;do as thoroughly as you're able to.&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Feb 2018 06:00:21 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Return-a-Specific-Row-With-Multiple-Criteria-For-Beginners/m-p/50765#M28848</guid>
      <dc:creator>jlrouquette</dc:creator>
      <dc:date>2018-02-06T06:00:21Z</dc:date>
    </item>
    <item>
      <title>Re: Return a Specific Row With Multiple Criteria - For Beginners</title>
      <link>https://community.jmp.com/t5/Discussions/Return-a-Specific-Row-With-Multiple-Criteria-For-Beginners/m-p/50766#M28849</link>
      <description>&lt;P&gt;I am not sure I follow exactly what you have done, and what you need to do, but let me at least start a response.&lt;/P&gt;
&lt;P&gt;If I understand what you said, is that you have a data table with about 8 million rows and 80 columns.&amp;nbsp; You have recently&amp;nbsp;updated the table with 3 new columns, and 2,000 rows.&amp;nbsp; How did you apply the update?&amp;nbsp; Did you use a&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Tables==&amp;gt;Join&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;or a&amp;nbsp; &amp;nbsp; &amp;nbsp; Tables==&amp;gt;Update&amp;nbsp;&lt;/P&gt;
&lt;P&gt;to do this update?&lt;/P&gt;
&lt;P&gt;And now with the updated table, do you have 83 columns, and 2,002,000 rows?&lt;/P&gt;
&lt;P&gt;Moving on to your next issue.&lt;/P&gt;
&lt;P&gt;JSL will allow one to easily find all of the rows that meet a specific criteria, and then operations can be performed on those rows and columns.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = current data table();
returnedRows = dt &amp;lt;&amp;lt; get rows where( :Well.Name == "a well's name" &amp;amp;
     :BitDepth == :FormationTVD;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The above JSL would create a matrix of row numbers (returnedRows) after searching the entire data table to find where a column named Well.Name has a name of "a well's name" and a column named BitDepth equals the the same value in a column named FormationTVD.&amp;nbsp; From you explanation, I am just guessing what Well.Name, BitDepth, FormationTVD and Formation really are.&amp;nbsp; But once the rows that you need to be identified, are selected, then the returnedRows matrix can be stepped through, and actions taken on those rows.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Feb 2018 06:47:42 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Return-a-Specific-Row-With-Multiple-Criteria-For-Beginners/m-p/50766#M28849</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2018-02-06T06:47:42Z</dc:date>
    </item>
    <item>
      <title>Re: Return a Specific Row With Multiple Criteria - For Beginners</title>
      <link>https://community.jmp.com/t5/Discussions/Return-a-Specific-Row-With-Multiple-Criteria-For-Beginners/m-p/50771#M28854</link>
      <description>&lt;P&gt;&amp;lt;&amp;lt; is the JSL "send" operator. You send a message to an object. The data table is an object, and you can send it messages like dt&amp;lt;&amp;lt;Sort or dt&amp;lt;&amp;lt;GetRowsWhere (if dt is the JSL variable for the data table.)&lt;/P&gt;
&lt;P&gt;A message is pretty much the same as a function call. There are some differences; objects are often designed to ignore messages they don't understand (check spelling if it doesn't work). Functions may need an explicit parameter to tell which object.&lt;/P&gt;
&lt;P&gt;To finish complicating it: messages are sometimes called methods of the object. Same thing.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Feb 2018 13:05:37 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Return-a-Specific-Row-With-Multiple-Criteria-For-Beginners/m-p/50771#M28854</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2018-02-06T13:05:37Z</dc:date>
    </item>
    <item>
      <title>Re: Return a Specific Row With Multiple Criteria - For Beginners</title>
      <link>https://community.jmp.com/t5/Discussions/Return-a-Specific-Row-With-Multiple-Criteria-For-Beginners/m-p/50773#M28856</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/10930"&gt;@jlrouquette&lt;/a&gt;,&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; JMP has a programming language called JSL . In JMP, the inherent data container that is used is a data table. So, when you see :&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Current Data Table(); 

// or 

dt = Open( "$SAMPLE_DATA/Cities.jmp" ); // Opening Sample Data Table &lt;BR /&gt;&lt;BR /&gt;// or &lt;BR /&gt;Data Table("Cities") &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Essentially - "dt" is the reference to your data table. In order to work with the data table, the reference allows you to perform actions of different kinds and work with the data table. Alternatively you can use Data Table(Table Name) as a way to perform actions on or with the data table.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open( "$SAMPLE_DATA/Cities.jmp" ); 

dt &amp;lt;&amp;lt; Select Where(:State == "IN"); // select all rows where State is Indiana &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Using the reference, you can perform actions on the data table. This enables you to process your data in the way you want. While these are over simplified examples, I hope they expalin what you are seeing in other posts.&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;A couple of humble suggestions for future posts in the community which will also help you get answers faster, since other people on the community are not aware of the problem you are trying to solve :&amp;nbsp;&lt;BR /&gt;1. Please try to provide a reproducible example i.e. either provide a part of your code or try to demonstrate what you are doing by using sample data&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. If you are not using the scripting language, kindly provide screenshots explaining in detail what your question is - so others can immediately try to help you&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;JMP Community is an excellent resource and has helped me many a time. Welcome to the community. Some other resources to be aware of :&amp;nbsp;&lt;BR /&gt;1.&amp;nbsp;&lt;A href="https://www.jmp.com/en_dk/events/getting-started-with-jmp/new-user-welcome-kit.html" target="_blank"&gt;https://www.jmp.com/en_dk/events/getting-started-with-jmp/new-user-welcome-kit.html&lt;/A&gt; - JMP New User Welcome Kit&amp;nbsp;&lt;BR /&gt;2. In JMP , Help -&amp;gt; Scripting Index&amp;nbsp;&lt;/P&gt;&lt;P&gt;3. In JMP , Help -&amp;gt; Books&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Feb 2018 13:21:20 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Return-a-Specific-Row-With-Multiple-Criteria-For-Beginners/m-p/50773#M28856</guid>
      <dc:creator>uday_guntupalli</dc:creator>
      <dc:date>2018-02-06T13:21:20Z</dc:date>
    </item>
    <item>
      <title>Re: Return a Specific Row With Multiple Criteria - For Beginners</title>
      <link>https://community.jmp.com/t5/Discussions/Return-a-Specific-Row-With-Multiple-Criteria-For-Beginners/m-p/50783#M28861</link>
      <description>&lt;P&gt;Its probably an odd fix but I couldnt figure out how to reference another table so its 2mm rows with 80 columns then an additional 3 columns at the end with only 2k rows; it is not a semetrical block of data.&amp;nbsp; I used Tables==&amp;gt;Update.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I put in the JSL that you referenced and got the attached error message.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I corrected the column references to represent what they really are.&amp;nbsp; There are two variations of well name, well.name and Well.Name.&amp;nbsp; Im using them as primary keys in a way to&amp;nbsp;make sure the jsl only references the formations where the well name is the same.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I dont see anywhere in the JSL where its references the formation columns (what I need returned) though.&amp;nbsp;&amp;nbsp;How is that happenening?&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Error Message.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/9216iD8B4A969A2DF7752/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Error Message.png" alt="Error Message.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Formula2.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/9217i3B3B921797D74A73/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Formula2.png" alt="Formula2.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JSL2.png" style="width: 756px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/9218i4F78834CC7D86847/image-size/large?v=v2&amp;amp;px=999" role="button" title="JSL2.png" alt="JSL2.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Feb 2018 14:01:01 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Return-a-Specific-Row-With-Multiple-Criteria-For-Beginners/m-p/50783#M28861</guid>
      <dc:creator>jlrouquette</dc:creator>
      <dc:date>2018-02-07T14:01:01Z</dc:date>
    </item>
    <item>
      <title>Re: Return a Specific Row With Multiple Criteria - For Beginners</title>
      <link>https://community.jmp.com/t5/Discussions/Return-a-Specific-Row-With-Multiple-Criteria-For-Beginners/m-p/50785#M28863</link>
      <description>Great advice &lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/6696"&gt;@uday_guntupalli&lt;/a&gt;, thank you! I will absolutely work on making sure what I'm asking is more clear, and with examples, in the future.</description>
      <pubDate>Tue, 06 Feb 2018 14:27:05 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Return-a-Specific-Row-With-Multiple-Criteria-For-Beginners/m-p/50785#M28863</guid>
      <dc:creator>jlrouquette</dc:creator>
      <dc:date>2018-02-06T14:27:05Z</dc:date>
    </item>
    <item>
      <title>Re: Return a Specific Row With Multiple Criteria - For Beginners</title>
      <link>https://community.jmp.com/t5/Discussions/Return-a-Specific-Row-With-Multiple-Criteria-For-Beginners/m-p/50791#M28866</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/10930"&gt;@jlrouquette&lt;/a&gt;,&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; Looking at Formula2.png ,&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; A column should be referenced with a colon in front ":"&amp;nbsp; &amp;nbsp;. So, if BitDepth and Well.Name are columns in the statement, try re-writing your statement as&amp;nbsp; :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Current Data Table(); // Make sure data table you want to work with is open

dt &amp;lt;&amp;lt; Select Where(:Name("Well.Name") == "well.name" &amp;amp; :BitDepth &amp;lt; FormationTVD); 

// There is a couple of things happening here 
// 1. Well.Name - presuming that is the column name has a period in it. When
// column names have other characters like period or space , use the name          
// function
// 2. I am selecting the rows first - so I am separating the code into 2 steps. 

SR = dt &amp;lt;&amp;lt; Get Selected Rows(); // This will save the row numbers of selected rows that met your condition 

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp; Looking at your error screenshot tells me that the variable or function you are trying to call is not defined. So - probably try to make sure - that column name exists ?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Feb 2018 14:53:00 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Return-a-Specific-Row-With-Multiple-Criteria-For-Beginners/m-p/50791#M28866</guid>
      <dc:creator>uday_guntupalli</dc:creator>
      <dc:date>2018-02-06T14:53:00Z</dc:date>
    </item>
    <item>
      <title>Re: Return a Specific Row With Multiple Criteria - For Beginners</title>
      <link>https://community.jmp.com/t5/Discussions/Return-a-Specific-Row-With-Multiple-Criteria-For-Beginners/m-p/50793#M28868</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/10930"&gt;@jlrouquette&lt;/a&gt;,&amp;nbsp;&lt;BR /&gt;&amp;nbsp;Also , try to execute the following sample&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt1 = Open( "$SAMPLE_DATA/Air Traffic.jmp" ); // Open Sample Data Table 1 

dt2 = Open( "$SAMPLE_DATA/Airline Delays.jmp" ); // Open Sample Data Table 2

// Selecting and  Identifying selected rows 

Current Data Table(dt1); // Ensuring that the operation you want to perform is actually happening on the table you want 

dt1 &amp;lt;&amp;lt; Select Where(:Airline == "Delta"); // Select Rows where Airline is Delta 

SR = dt1 &amp;lt;&amp;lt; Get Selected Rows(); // Get the row numbers that have been selected 

Show(SR); // Print Selected Rows 


Close All(Data Tables,"No Save"); // Close data tables &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;code to understand this easily and then apply it to your case&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Feb 2018 15:02:31 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Return-a-Specific-Row-With-Multiple-Criteria-For-Beginners/m-p/50793#M28868</guid>
      <dc:creator>uday_guntupalli</dc:creator>
      <dc:date>2018-02-06T15:02:31Z</dc:date>
    </item>
    <item>
      <title>Re: Return a Specific Row With Multiple Criteria - For Beginners</title>
      <link>https://community.jmp.com/t5/Discussions/Return-a-Specific-Row-With-Multiple-Criteria-For-Beginners/m-p/50794#M28869</link>
      <description>&lt;P&gt;I think part of the problem stems from having two columns with the same name, if you ignore case:&amp;nbsp;&lt;STRONG&gt;Well.Name&lt;/STRONG&gt; and &lt;STRONG&gt;well.name&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried referencing these columns using the &lt;STRONG&gt;column(dt, colname)&lt;/STRONG&gt; method and it didn't work.&amp;nbsp; But using the colon prefix and column number methods worked.&amp;nbsp; Check out this code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = New Table( "Untitled", Add Rows( 3 ), &lt;BR /&gt;        New Column( "Well.Name", Character, "Nominal", Set Values( {"aaa", "bbb", "ccc"} ) ),
	New Column( "well.name", Character, "Nominal", Set Values( {"aaa", "ddd", "xxx"} ) )
);

// Doesn't work
found_rows = dt &amp;lt;&amp;lt; get rows where(as column(dt, "Well.Name") == column(dt, "well.name"));
&lt;BR /&gt;// Works&lt;BR /&gt;&lt;BR /&gt;found_rows = dt &amp;lt;&amp;lt; get rows where(:Well.Name == :well.name);&lt;BR /&gt;
// Also works
found_rows = dt &amp;lt;&amp;lt; get rows where(as column(dt, 1) == column(dt, 2));
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Feb 2018 12:31:27 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Return-a-Specific-Row-With-Multiple-Criteria-For-Beginners/m-p/50794#M28869</guid>
      <dc:creator>pmroz</dc:creator>
      <dc:date>2018-02-07T12:31:27Z</dc:date>
    </item>
    <item>
      <title>Re: Return a Specific Row With Multiple Criteria - For Beginners</title>
      <link>https://community.jmp.com/t5/Discussions/Return-a-Specific-Row-With-Multiple-Criteria-For-Beginners/m-p/50845#M28899</link>
      <description>&lt;P&gt;Alright, still no luck yet on this one.&amp;nbsp; I liked your reply a lot because you put it in terms of the variables I'm&amp;nbsp;using (incredibly helpful since I'm&amp;nbsp;new to this).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My machine had a mixture of running slow and "not responding" for a couple hours after I ran the code.&amp;nbsp; Not sure if its something I did wrong or not.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I attached the output and a copy of the code.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jsl.PNG" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/9219iFFC7328E4EBAD94C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jsl.PNG" alt="jsl.PNG" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="output.png" style="width: 121px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/9220iF80CD5ACB0DB7C4D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="output.png" alt="output.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Feb 2018 14:02:31 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Return-a-Specific-Row-With-Multiple-Criteria-For-Beginners/m-p/50845#M28899</guid>
      <dc:creator>jlrouquette</dc:creator>
      <dc:date>2018-02-07T14:02:31Z</dc:date>
    </item>
    <item>
      <title>Re: Return a Specific Row With Multiple Criteria - For Beginners</title>
      <link>https://community.jmp.com/t5/Discussions/Return-a-Specific-Row-With-Multiple-Criteria-For-Beginners/m-p/51266#M29078</link>
      <description>&lt;P&gt;Thanks for this but I'm afraid I'm struggling with how I would apply the set values when they change.&amp;nbsp; I made a subset of my dataset that might help address what I'm trying to do.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The primary concern to remember is that the "WellName" and "BitDepth" are 8 million rows deep and "ActualFormation" will be as well if/when we can get a formula to work.&amp;nbsp; "WellReference", "FormationReference", and "TVDReference" are all about 2,000 rows deep with between 10-14 different formations and corresponding depths for each one.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the attachment, the "ActualFormation" column has been manually completed to show what I need the results to do over the full 2mm rows.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Lastly, to recap the conditions, I need the "FormationReference" for a given cell to be returned when 1) WellName = WellReference and 2) where "BitDepth" &amp;lt; "TVDReference".&amp;nbsp; For condition #2 I'm assuming that JMP would return the first cell reference from the top as it works its way down since there will almost always&amp;nbsp;be a couple formations that meet 2 conditions.&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Feb 2018 04:44:05 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Return-a-Specific-Row-With-Multiple-Criteria-For-Beginners/m-p/51266#M29078</guid>
      <dc:creator>jlrouquette</dc:creator>
      <dc:date>2018-02-14T04:44:05Z</dc:date>
    </item>
    <item>
      <title>Re: Return a Specific Row With Multiple Criteria - For Beginners</title>
      <link>https://community.jmp.com/t5/Discussions/Return-a-Specific-Row-With-Multiple-Criteria-For-Beginners/m-p/51267#M29079</link>
      <description>&lt;P&gt;Here is the attachment&amp;nbsp;I just mentioned...&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Feb 2018 04:45:04 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Return-a-Specific-Row-With-Multiple-Criteria-For-Beginners/m-p/51267#M29079</guid>
      <dc:creator>jlrouquette</dc:creator>
      <dc:date>2018-02-14T04:45:04Z</dc:date>
    </item>
    <item>
      <title>Re: Return a Specific Row With Multiple Criteria - For Beginners</title>
      <link>https://community.jmp.com/t5/Discussions/Return-a-Specific-Row-With-Multiple-Criteria-For-Beginners/m-p/51268#M29080</link>
      <description>&lt;P&gt;Here is the attachment&amp;nbsp;I just mentioned...&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Feb 2018 04:45:05 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Return-a-Specific-Row-With-Multiple-Criteria-For-Beginners/m-p/51268#M29080</guid>
      <dc:creator>jlrouquette</dc:creator>
      <dc:date>2018-02-14T04:45:05Z</dc:date>
    </item>
    <item>
      <title>Re: Return a Specific Row With Multiple Criteria - For Beginners</title>
      <link>https://community.jmp.com/t5/Discussions/Return-a-Specific-Row-With-Multiple-Criteria-For-Beginners/m-p/51269#M29081</link>
      <description>&lt;P&gt;I'm&amp;nbsp;not sure if its necessary to inform you that I added a subset of data to my question here or if it happens automatically so just in case... I just responded to someone else and added a subset of my data in case that helps address my question.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Feb 2018 04:47:36 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Return-a-Specific-Row-With-Multiple-Criteria-For-Beginners/m-p/51269#M29081</guid>
      <dc:creator>jlrouquette</dc:creator>
      <dc:date>2018-02-14T04:47:36Z</dc:date>
    </item>
    <item>
      <title>Re: Return a Specific Row With Multiple Criteria - For Beginners</title>
      <link>https://community.jmp.com/t5/Discussions/Return-a-Specific-Row-With-Multiple-Criteria-For-Beginners/m-p/51270#M29082</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I'm&amp;nbsp;not sure if its necessary to inform you that I added a subset of data to my question here or if it happens automatically so just in case... I just responded to someone else and added a subset of my data in case that helps address my question.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Feb 2018 04:48:21 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Return-a-Specific-Row-With-Multiple-Criteria-For-Beginners/m-p/51270#M29082</guid>
      <dc:creator>jlrouquette</dc:creator>
      <dc:date>2018-02-14T04:48:21Z</dc:date>
    </item>
    <item>
      <title>Re: Return a Specific Row With Multiple Criteria - For Beginners</title>
      <link>https://community.jmp.com/t5/Discussions/Return-a-Specific-Row-With-Multiple-Criteria-For-Beginners/m-p/51292#M29083</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/10930"&gt;@jlrouquette&lt;/a&gt;&lt;BR /&gt;&lt;BR /&gt;Based on the conditions that you described - doesn't this do what you are after ?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Current Data Table(); 

dt &amp;lt;&amp;lt; Select Where((:WellName == :WellReference) &amp;amp; (:BitDepth &amp;lt;:TVD Reference)); // Select Rows that meet your condition

SR = dt &amp;lt;&amp;lt; Get Selected Rows; // Extract selected rows 

Show(SR); // Display results on log 

FirstRow = Min(SR); // Retrieves the first row that meets your conditions&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/9330iC25403DB0A158201/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Feb 2018 13:10:08 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Return-a-Specific-Row-With-Multiple-Criteria-For-Beginners/m-p/51292#M29083</guid>
      <dc:creator>uday_guntupalli</dc:creator>
      <dc:date>2018-02-14T13:10:08Z</dc:date>
    </item>
    <item>
      <title>Re: Return a Specific Row With Multiple Criteria - For Beginners</title>
      <link>https://community.jmp.com/t5/Discussions/Return-a-Specific-Row-With-Multiple-Criteria-For-Beginners/m-p/51333#M29107</link>
      <description>&lt;P&gt;Yes and no.&amp;nbsp; When I run it the entire "Actual Formation" column (top to bottom) fills with 3.&amp;nbsp; The good news is that the 3rd row down in the "FormationReference" is the correct reference for the first row of the main dataset.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For this to be perfect it would still need to 1) find different results as the formula works it way down the sheet i.e. the 5th row should have shown as 4 rather than 3, and 2) ideally, I would like it to return the actual name rather than the number (3 would equal Bell Canyon and 4 would equal Brushy Canyon.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I could technically manage part 2 there with recoding or something similar but there are still &amp;gt;2,000 rows in the formation dataset I would have to manually change.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Feb 2018 19:25:18 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Return-a-Specific-Row-With-Multiple-Criteria-For-Beginners/m-p/51333#M29107</guid>
      <dc:creator>jlrouquette</dc:creator>
      <dc:date>2018-02-14T19:25:18Z</dc:date>
    </item>
    <item>
      <title>Re: Return a Specific Row With Multiple Criteria - For Beginners</title>
      <link>https://community.jmp.com/t5/Discussions/Return-a-Specific-Row-With-Multiple-Criteria-For-Beginners/m-p/51399#M29135</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/10930"&gt;@jlrouquette&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;Forgive me if you&amp;nbsp;specified this (or if this seems like an obvious question, though you did say you are new to scripting), but are you interested in jsl for a column formula, or jsl that you would run as a standalone script? In some of your posts it appears you're applying the jsl&amp;nbsp;to a column formula, but many of the answers are given in terms of a script you run (a script you would make by going to File &amp;gt; New &amp;gt; New Script).&amp;nbsp;For instance, the last post by&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/6696"&gt;@uday_guntupalli&lt;/a&gt;&amp;nbsp;is meant to be run as a script from a window, and if placed in a column formula what would be returned is a single value (the first row that meets the criteria).&lt;/P&gt;
&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2026"&gt;@jules&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Script.gif" style="width: 864px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/9360iA42E591E54CC7E3A/image-size/large?v=v2&amp;amp;px=999" role="button" title="Script.gif" alt="Script.gif" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Feb 2018 17:27:09 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Return-a-Specific-Row-With-Multiple-Criteria-For-Beginners/m-p/51399#M29135</guid>
      <dc:creator>jules</dc:creator>
      <dc:date>2018-02-15T17:27:09Z</dc:date>
    </item>
    <item>
      <title>Re: Return a Specific Row With Multiple Criteria - For Beginners</title>
      <link>https://community.jmp.com/t5/Discussions/Return-a-Specific-Row-With-Multiple-Criteria-For-Beginners/m-p/51423#M29153</link>
      <description>&lt;P&gt;Hi again,&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/10930"&gt;@jlrouquette&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;After reading more carefully through this thread it seems like this boils down to having a table of lookup values that you want to update your main table with based on matching conditions. If you were simply matching based on certain columns being equal you could use Tables &amp;gt; Update (and specify match conditions), but since you need to match when one column is less than another, that won't work. Also, since you have a very large main table (with millions of rows), and a relatively small lookup table (around 2000 rows), I think you will get better performance going about this in reverse: rather than having a column formula that works through your main table row by row, have a script that works through your lookup row by row table to find all matching rows in your main table at once. Below is such a script. I've also attached it as a script file (which you can open and click Run on), as well as the tables you will need (the main table, and a *separate* lookup table, what I think it probably the best practice).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Some important points:&lt;/P&gt;
&lt;P&gt;-This script will only fill a cell once. That is, once a match has been made, even if a cell matches later on in the lookup table the data in the main table will not be overwritten. This uses a JMP 13 feature of the Select Where() function to restrict a selection set. If you aren't using JMP 13 this will not work.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- The matches from this script are mostly the same as the ones you provided, but because of the point above they seem to differ. As you said, many formations match a given set of conditions and this script will simply select the first to match in the lookup table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suspect there is an even more efficient way to&amp;nbsp;do this but&amp;nbsp;is this along the lines of what you're looking for?&lt;BR /&gt;@julian&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="IterativeLookup.gif" style="width: 818px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/9366i609957741D160404/image-size/large?v=v2&amp;amp;px=999" role="button" title="IterativeLookup.gif" alt="IterativeLookup.gif" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

//get handles for the tables
dt1 = Data Table( "MainTable" );
dt2 = Data Table( "LookupTable" );

//Make a column for the matching formation in the main table
dt1 &amp;lt;&amp;lt; New Column("FormationReference", Character);

//for better performance, stop showing table updates until complete
dt1 &amp;lt;&amp;lt; Begin Data Update;

//loop through the rows of the lookup table to find the matching cells in the main table

For(i = 1, i &amp;lt;= nRows(dt2), i++, 

	dt1 &amp;lt;&amp;lt; Select Where( 
		(:WellName == dt2:WellReference[i]) &amp;amp; 
		(:BitDepth &amp;lt; dt2:TVD Reference[i]) ); 

	// remove selection for rows that already have a match in "Formation Reference"
	// note: jmp 13 or later supports restricting selection in the select where function

	dt1 &amp;lt;&amp;lt; Select Where(dt1:FormationReference=="", Current Selection("Restrict"));

	// set the cells in FormationReference for the selected 
	// rows to FormationReference in the lookup table

	dt1:FormationReference[dt1 &amp;lt;&amp;lt; Get Selected Rows] = dt2:FormationReference[i];
);

//show table updates again
dt1 &amp;lt;&amp;lt; End Data Update;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Feb 2018 21:37:41 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Return-a-Specific-Row-With-Multiple-Criteria-For-Beginners/m-p/51423#M29153</guid>
      <dc:creator>jules</dc:creator>
      <dc:date>2018-02-15T21:37:41Z</dc:date>
    </item>
    <item>
      <title>Re: Return a Specific Row With Multiple Criteria - For Beginners</title>
      <link>https://community.jmp.com/t5/Discussions/Return-a-Specific-Row-With-Multiple-Criteria-For-Beginners/m-p/51424#M29154</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2026"&gt;@jules&lt;/a&gt;, it looks like you nailed&amp;nbsp;it with what he was looking for in your last response. I worked with&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/10930"&gt;@jlrouquette&lt;/a&gt;&amp;nbsp;via JMP Tech Support and we came to a solution very similar to yours, except yours might be more efficient because I often forget to use &amp;lt;&amp;lt;Begin/End Data Update.&lt;/P&gt;
&lt;P&gt;Here is the solution I provided (with Begin/End Data Update added):&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt1 = Data Table( "main" );
dt2 = Data Table( "formation" );

dt1 &amp;lt;&amp;lt; Begin Data Update();
// loop through each table in the main table
For( iRow = 1, iRow &amp;lt;= Nrow( dt1 ), iRow++,
   
   // get rows that meet the two conditions
   r = dt2 &amp;lt;&amp;lt; Get Rows Where(
       And(
           dt1:well_name[iRow] == dt2:WellReference,
           dt1:BitDepth[iRow] &amp;lt; dt2:TVDReference
       )
   );
   
   // if we have at least one matching row, get the first formation
   If( Nrow( r ) &amp;gt; 0,
       dt1:ActualFormation[iRow] = dt2:FormationReference[r[1]];
   ); 
);
dt1 &amp;lt;&amp;lt; End Data Update();&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/10930"&gt;@jlrouquette&lt;/a&gt;&amp;nbsp;Be sure to add the Begin/End Data Update portions like I have above so that you will see improved performance than what we just saw over the phone.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Feb 2018 22:13:53 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Return-a-Specific-Row-With-Multiple-Criteria-For-Beginners/m-p/51424#M29154</guid>
      <dc:creator>Justin_Chilton</dc:creator>
      <dc:date>2018-02-15T22:13:53Z</dc:date>
    </item>
  </channel>
</rss>

