<?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: How do I implement an excel like VLOOKUP using JSL? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-do-I-implement-an-excel-like-VLOOKUP-using-JSL/m-p/70069#M35150</link>
    <description>&lt;P&gt;It looks like you want to stack columns. Explore the &lt;EM&gt;Stack()&amp;nbsp;&lt;/EM&gt;command. However, in your example you have stacked columns of different data types (Character and numeric), which will not work unless data types are harmonized first.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;d1 = Open("$SAMPLE_DATA/Big Class.jmp");
For(i = 1, i &amp;lt;= N Col(d1), i++,
    Column(d1, i) &amp;lt;&amp;lt; data type("Character")
);
d1 &amp;lt;&amp;lt; Stack(Columns(:age, :sex, :height, :weight));&lt;/CODE&gt;&lt;/PRE&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>Mon, 27 Aug 2018 12:14:07 GMT</pubDate>
    <dc:creator>ms</dc:creator>
    <dc:date>2018-08-27T12:14:07Z</dc:date>
    <item>
      <title>How do I implement an excel like VLOOKUP using JSL?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-implement-an-excel-like-VLOOKUP-using-JSL/m-p/70044#M35146</link>
      <description>&lt;P&gt;How to find the students' sports names in the "big class families.jmp" table according to the students' names in the "Big Class.jmp" table.&lt;BR /&gt;and add columns in the "Big Class.jmp" table to display.Thank you very much!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;d2 = Open( "$SAMPLE_DATA/big class families.jmp" );
d1 = Open( "$SAMPLE_DATA/Big Class.jmp" );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2018-08-28_17-30-54.png" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/12177i3F0E035787FF8DAD/image-size/large?v=v2&amp;amp;px=999" role="button" title="2018-08-28_17-30-54.png" alt="2018-08-28_17-30-54.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Dec 2018 19:55:11 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-implement-an-excel-like-VLOOKUP-using-JSL/m-p/70044#M35146</guid>
      <dc:creator>lwx228</dc:creator>
      <dc:date>2018-12-07T19:55:11Z</dc:date>
    </item>
    <item>
      <title>Re: How do I implement an excel like VLOOKUP using JSL?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-implement-an-excel-like-VLOOKUP-using-JSL/m-p/70053#M35147</link>
      <description>&lt;P&gt;Update() by matching columns works well for this task. Either manually (Tables Menu) or by script.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;d2 = Open("$SAMPLE_DATA/big class families.jmp");
d1 = Open("$SAMPLE_DATA/Big Class.jmp");
d1 &amp;lt;&amp;lt; Update(
    With(d2),
    Match Columns(:name = :name),
    Add Columns from Update table(:sports)
);
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 27 Aug 2018 10:15:58 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-implement-an-excel-like-VLOOKUP-using-JSL/m-p/70053#M35147</guid>
      <dc:creator>ms</dc:creator>
      <dc:date>2018-08-27T10:15:58Z</dc:date>
    </item>
    <item>
      <title>Re: How do I implement an excel like VLOOKUP using JSL?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-implement-an-excel-like-VLOOKUP-using-JSL/m-p/70054#M35148</link>
      <description>This is very useful. Thank you very much!</description>
      <pubDate>Mon, 27 Aug 2018 10:25:38 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-implement-an-excel-like-VLOOKUP-using-JSL/m-p/70054#M35148</guid>
      <dc:creator>lwx228</dc:creator>
      <dc:date>2018-08-27T10:25:38Z</dc:date>
    </item>
    <item>
      <title>Re: How do I implement an excel like VLOOKUP using JSL?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-implement-an-excel-like-VLOOKUP-using-JSL/m-p/70068#M35149</link>
      <description>&lt;P&gt;Please continue your guidance:how to extract the value by matching both names simultaneously, like the offset function in excel.Thank you very much!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;d1 = Open("$SAMPLE_DATA/Big Class.jmp");
d2 = New Table( "offset",
Add Rows( 8 ),
New Column( "name",
Character,
"Nominal",
Set Values( {"MARION", "MARION","MARION","MARION", "JUDY", "JUDY", "JUDY", "JUDY"} )
),
New Column( "obj",
Character,
"Nominal",
Set Values( {"sex", "age", "weight", "height", "sex", "age", "weight", "height"} )
)
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2018-08-28_19-45-31.png" style="width: 758px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/12179i4C600C4834A29B20/image-size/large?v=v2&amp;amp;px=999" role="button" title="2018-08-28_19-45-31.png" alt="2018-08-28_19-45-31.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Dec 2018 19:55:42 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-implement-an-excel-like-VLOOKUP-using-JSL/m-p/70068#M35149</guid>
      <dc:creator>lwx228</dc:creator>
      <dc:date>2018-12-07T19:55:42Z</dc:date>
    </item>
    <item>
      <title>Re: How do I implement an excel like VLOOKUP using JSL?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-implement-an-excel-like-VLOOKUP-using-JSL/m-p/70069#M35150</link>
      <description>&lt;P&gt;It looks like you want to stack columns. Explore the &lt;EM&gt;Stack()&amp;nbsp;&lt;/EM&gt;command. However, in your example you have stacked columns of different data types (Character and numeric), which will not work unless data types are harmonized first.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;d1 = Open("$SAMPLE_DATA/Big Class.jmp");
For(i = 1, i &amp;lt;= N Col(d1), i++,
    Column(d1, i) &amp;lt;&amp;lt; data type("Character")
);
d1 &amp;lt;&amp;lt; Stack(Columns(:age, :sex, :height, :weight));&lt;/CODE&gt;&lt;/PRE&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>Mon, 27 Aug 2018 12:14:07 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-implement-an-excel-like-VLOOKUP-using-JSL/m-p/70069#M35150</guid>
      <dc:creator>ms</dc:creator>
      <dc:date>2018-08-27T12:14:07Z</dc:date>
    </item>
    <item>
      <title>Re: How do I implement an excel like VLOOKUP using JSL?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-implement-an-excel-like-VLOOKUP-using-JSL/m-p/70086#M35157</link>
      <description>Thank you. That's a very efficient way. I'll keep that in mind.&lt;BR /&gt;But what if I only needed code to extract the data for the eight line names I gave?Want to learn one more way.&lt;BR /&gt;&lt;BR /&gt;It's bothering you，thank you!&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 27 Aug 2018 13:13:33 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-implement-an-excel-like-VLOOKUP-using-JSL/m-p/70086#M35157</guid>
      <dc:creator>lwx228</dc:creator>
      <dc:date>2018-08-27T13:13:33Z</dc:date>
    </item>
    <item>
      <title>Re: How do I implement an excel like VLOOKUP using JSL?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-implement-an-excel-like-VLOOKUP-using-JSL/m-p/70093#M35161</link>
      <description>&lt;P&gt;There are several ways. One is to simply delete unwanted rows from the stacked table.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;d1 = Open("$SAMPLE_DATA/Big Class.jmp");
d2 = d1 &amp;lt;&amp;lt; Stack(Columns(:age, :sex, :height, :weight));
d2 &amp;lt;&amp;lt; delete rows(d2 &amp;lt;&amp;lt; get rows where(:name != "MARION" &amp;amp; :name != "JUDY"));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Or just make a subset. The example below is without stacking (in JMP, it's rarely a good idea to mix widely&amp;nbsp;different&amp;nbsp;variables in the same column).&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;d1 = Open("$SAMPLE_DATA/Big Class.jmp");
d1 &amp;lt;&amp;lt; Subset(rows(d1 &amp;lt;&amp;lt; get rows where(:name == "MARION" | :name == "JUDY")));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Aug 2018 14:03:55 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-implement-an-excel-like-VLOOKUP-using-JSL/m-p/70093#M35161</guid>
      <dc:creator>ms</dc:creator>
      <dc:date>2018-08-27T14:03:55Z</dc:date>
    </item>
    <item>
      <title>Re: How do I implement an excel like VLOOKUP using JSL?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-implement-an-excel-like-VLOOKUP-using-JSL/m-p/70143#M35166</link>
      <description>a good way，thank you!</description>
      <pubDate>Mon, 27 Aug 2018 14:43:48 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-implement-an-excel-like-VLOOKUP-using-JSL/m-p/70143#M35166</guid>
      <dc:creator>lwx228</dc:creator>
      <dc:date>2018-08-27T14:43:48Z</dc:date>
    </item>
  </channel>
</rss>

