<?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: If statement not working in jsl in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/If-statement-not-working-in-jsl/m-p/797345#M97314</link>
    <description>&lt;P&gt;Might be enough if you changed &lt;STRONG&gt;:&lt;/STRONG&gt;SPECFILE to SPECFILE (&lt;STRONG&gt;:&lt;/STRONG&gt;SPECFILE would (usually) refer to a column).&lt;/P&gt;</description>
    <pubDate>Tue, 10 Sep 2024 07:15:08 GMT</pubDate>
    <dc:creator>jthi</dc:creator>
    <dc:date>2024-09-10T07:15:08Z</dc:date>
    <item>
      <title>If statement not working in jsl</title>
      <link>https://community.jmp.com/t5/Discussions/If-statement-not-working-in-jsl/m-p/797333#M97312</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Hi all.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please check what is the problem with my if statement? I want to run several jsl commands in case the condition is true (in my case, that the spec file name is as written in the code) but it does not work.&lt;/P&gt;&lt;P&gt;Everything else is working fine, just the if statement is not.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My JMP version is 18&lt;/P&gt;&lt;P&gt;&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();
dt &amp;lt;&amp;lt; Select Columns( :PARAMETER );
dt &amp;lt;&amp;lt; Text To Columns( delimiter( "_" ) );
dt &amp;lt;&amp;lt; delete columns( :PARAMETER 1 );
If( :SPECFILE == "MS-SMLD",
	:PARAMETER 2 &amp;lt;&amp;lt; set name( "Column_name1" );
	:PARAMETER 3 &amp;lt;&amp;lt; set name( "Column_name2" );
	:PARAMETER 4 &amp;lt;&amp;lt; set name( "Column_name3" );
	:PARAMETER 5 &amp;lt;&amp;lt; set name( "Column_name4" );
	:PARAMETER 6 &amp;lt;&amp;lt; set name( "Column_name5" ) ;
	,
	If( :SPECFILE == "SMLA", Formula(
		dt &amp;lt;&amp;lt; delete columns( :PARAMETER 5 );
		:PARAMETER 2 &amp;lt;&amp;lt; set name( "Column_name1" );
		:PARAMETER 3 &amp;lt;&amp;lt; set name( "Column_name2" );
		:PARAMETER 4 &amp;lt;&amp;lt; set name( "Column_name3" );
		 )
	)
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Reshef&lt;/P&gt;</description>
      <pubDate>Tue, 10 Sep 2024 07:08:27 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/If-statement-not-working-in-jsl/m-p/797333#M97312</guid>
      <dc:creator>Resheffink1</dc:creator>
      <dc:date>2024-09-10T07:08:27Z</dc:date>
    </item>
    <item>
      <title>Re: If statement not working in jsl</title>
      <link>https://community.jmp.com/t5/Discussions/If-statement-not-working-in-jsl/m-p/797345#M97314</link>
      <description>&lt;P&gt;Might be enough if you changed &lt;STRONG&gt;:&lt;/STRONG&gt;SPECFILE to SPECFILE (&lt;STRONG&gt;:&lt;/STRONG&gt;SPECFILE would (usually) refer to a column).&lt;/P&gt;</description>
      <pubDate>Tue, 10 Sep 2024 07:15:08 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/If-statement-not-working-in-jsl/m-p/797345#M97314</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-09-10T07:15:08Z</dc:date>
    </item>
    <item>
      <title>Re: If statement not working in jsl</title>
      <link>https://community.jmp.com/t5/Discussions/If-statement-not-working-in-jsl/m-p/797346#M97315</link>
      <description>&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks! but the "SPECFILE" is indeed a column in my jmp table.&lt;/P&gt;&lt;P&gt;Anyway, I tried it and it does not work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Maybe its what separate the jsl commands in my IF statement?&lt;/P&gt;&lt;P&gt;Or, maybe its impossible to run several jsl commands in one IF&amp;nbsp;statement?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Reshef&lt;/P&gt;</description>
      <pubDate>Tue, 10 Sep 2024 07:20:53 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/If-statement-not-working-in-jsl/m-p/797346#M97315</guid>
      <dc:creator>Resheffink1</dc:creator>
      <dc:date>2024-09-10T07:20:53Z</dc:date>
    </item>
    <item>
      <title>Re: If statement not working in jsl</title>
      <link>https://community.jmp.com/t5/Discussions/If-statement-not-working-in-jsl/m-p/797348#M97317</link>
      <description>&lt;P&gt;Then you have to define the Row (Row() = 1; for example) or loop over the rows in your table using For Each Row. The "default" row in JMP is 0 which isn't valid row&lt;/P&gt;</description>
      <pubDate>Tue, 10 Sep 2024 07:42:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/If-statement-not-working-in-jsl/m-p/797348#M97317</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-09-10T07:42:23Z</dc:date>
    </item>
    <item>
      <title>Re: If statement not working in jsl</title>
      <link>https://community.jmp.com/t5/Discussions/If-statement-not-working-in-jsl/m-p/797417#M97322</link>
      <description>&lt;P&gt;If what you are trying to do, is to look at row 1's value in column "SPECFILE" and then make decisions based on it, the JSL below will be what you want&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Current Data Table();
dt &amp;lt;&amp;lt; Select Columns( :PARAMETER );
dt &amp;lt;&amp;lt; Text To Columns( delimiter( "_" ) );
dt &amp;lt;&amp;lt; delete columns( :PARAMETER 1 );
If(
	:SPECFILE[1] == "MS-SMLD",
		:PARAMETER 2 &amp;lt;&amp;lt; set name( "Column_name1" );
		:PARAMETER 3 &amp;lt;&amp;lt; set name( "Column_name2" );
		:PARAMETER 4 &amp;lt;&amp;lt; set name( "Column_name3" );
		:PARAMETER 5 &amp;lt;&amp;lt; set name( "Column_name4" );
		:PARAMETER 6 &amp;lt;&amp;lt; set name( "Column_name5" );,
	:SPECFILE[1] == "SMLA",
		dt &amp;lt;&amp;lt; delete columns( :PARAMETER 5 );
		:PARAMETER 2 &amp;lt;&amp;lt; set name( "Column_name1" );
		:PARAMETER 3 &amp;lt;&amp;lt; set name( "Column_name2" );
		:PARAMETER 4 &amp;lt;&amp;lt; set name( "Column_name3" );
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 10 Sep 2024 10:15:06 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/If-statement-not-working-in-jsl/m-p/797417#M97322</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2024-09-10T10:15:06Z</dc:date>
    </item>
  </channel>
</rss>

