<?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 to reference a column with complex name in an expression in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-reference-a-column-with-complex-name-in-an-expression/m-p/35586#M20997</link>
    <description>Thanks, this worked! From here it should be easy to pass the expression in a loop using i as column index</description>
    <pubDate>Thu, 09 Feb 2017 18:21:48 GMT</pubDate>
    <dc:creator>cnattrass</dc:creator>
    <dc:date>2017-02-09T18:21:48Z</dc:date>
    <item>
      <title>How to reference a column with complex name in an expression</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-reference-a-column-with-complex-name-in-an-expression/m-p/35581#M20993</link>
      <description>&lt;P&gt;Beginner JSL scripter here...&lt;/P&gt;&lt;P&gt;I want to create a script that will delete any rows that have missing data within any column.&amp;nbsp;Right now if I rename the column(s) it will work like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;clean_dt &amp;lt;&amp;lt; selectWhere(IsMissing&lt;FONT color="#FF0000"&gt;&lt;FONT color="#000000"&gt;(&lt;/FONT&gt;:THK&lt;FONT color="#000000"&gt;)&lt;/FONT&gt;&lt;/FONT&gt;) &amp;lt;&amp;lt; deleteRows ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem is, I want this script to be dynamic and be able to handle any name for any column that I give it and reference it by column number for example. Lets say the column name is complex like this&lt;/P&gt;&lt;P&gt;Step::Measurement::Data::THK:Raw (Mean)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I dont want to have to rename my columns everytime... I've tried several iterations of things that I think "should" work, but they dont such as&lt;/P&gt;&lt;P&gt;clean_dt &amp;lt;&amp;lt; selectWhere(IsMissing(&lt;FONT color="#FF0000"&gt;Column(8)&lt;/FONT&gt;)) &amp;lt;&amp;lt; deleteRows ;&lt;/P&gt;&lt;P&gt;OR&lt;/P&gt;&lt;P&gt;clean_dt &amp;lt;&amp;lt; selectWhere(IsMissing(:&lt;FONT color="#FF0000"&gt;&lt;SPAN&gt;Step::Data&lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN&gt;&lt;FONT color="#FF0000"&gt;::THK:Raw (Mean)&lt;/FONT&gt;&lt;/SPAN&gt;)) &amp;lt;&amp;lt; deleteRows ; (column name is too complex with special characters)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Each time it errors with this message&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;argument should be numeric{1} in access or evaluation of 'Is Missing' , Is Missing/*###*/(Column( 8 ))&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Feb 2017 17:57:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-reference-a-column-with-complex-name-in-an-expression/m-p/35581#M20993</guid>
      <dc:creator>cnattrass</dc:creator>
      <dc:date>2017-02-09T17:57:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to reference a column with complex name in an expression</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-reference-a-column-with-complex-name-in-an-expression/m-p/35583#M20994</link>
      <description>&lt;P&gt;When using the Select Where message, the criteria needs to be based on the current row as JMP will look at each row to see if the row meets the criteria.&lt;/P&gt;
&lt;P&gt;Because the Column function actually returns a reference to the entire column, when you use the Column function in your Select Where message, you need to include a subscript to the current row. This can be done by subscripting [Row()] or just [] for short. See below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt &amp;lt;&amp;lt; Select where( Is Missing( Column( 8 )[] ) );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;When you want to use a column name with special characters, you can use the Name parser with a string of the column name. If this string needs to be a variable, you would need to use the Column function instead.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt &amp;lt;&amp;lt; Select Where( Is Missing( :Name( "Step::Data::THK:Raw (Mean)" ) ) );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;OR&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;str = "Step::Data::THK:Raw (Mean)";
dt &amp;lt;&amp;lt; Select Where( Is Missing( Column( str )[] ) );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Feb 2017 18:12:10 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-reference-a-column-with-complex-name-in-an-expression/m-p/35583#M20994</guid>
      <dc:creator>Justin_Chilton</dc:creator>
      <dc:date>2017-02-09T18:12:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to reference a column with complex name in an expression</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-reference-a-column-with-complex-name-in-an-expression/m-p/35586#M20997</link>
      <description>Thanks, this worked! From here it should be easy to pass the expression in a loop using i as column index</description>
      <pubDate>Thu, 09 Feb 2017 18:21:48 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-reference-a-column-with-complex-name-in-an-expression/m-p/35586#M20997</guid>
      <dc:creator>cnattrass</dc:creator>
      <dc:date>2017-02-09T18:21:48Z</dc:date>
    </item>
  </channel>
</rss>

