<?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: JSL: Set Custom Format Data Column in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/JSL-Set-Custom-Format-Data-Column/m-p/48150#M27421</link>
    <description>&lt;P&gt;Jeff,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for replying to my question and sharing with me how you found the&amp;nbsp;code for the Format() command.&amp;nbsp; That will come in handy in the future.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I certainly understand the issue you raised about the data only being displayed as missing.&amp;nbsp; That is exactly what I'm going for in this instance.&amp;nbsp; I have a column that I use for determining when I have missing data records based on datetime. When looking over this column, I find it rather hard to "see" the rows where missing data exists, if any, due to all the zeros.&amp;nbsp; That's why I'm displaying them as missing.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Interestingly, following the code example you provided for my data doesn't work like it does for Big Class.&amp;nbsp; When I execute the following code for the attached data table, the column of interest (Missing Dates?) is set to ####### when the code is run.&amp;nbsp; However, if I select Column Information | Set Custom Format | Ok | Ok, the column "Missing Dates?" is now updated properly with the specified custom format.&amp;nbsp; If I rerun just the code that sets the proper custom format, I get the same ##### result. Weird.&amp;nbsp; Am I doing something wrong or is this a possible bug?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Clear Log();
Names Default To Here( 1 );
&lt;BR /&gt;dt = Current Data Table();

dt &amp;lt;&amp;lt; Add Multiple Columns( "Missing Dates?", 1, before first, Numeric );

:Name( "Missing Dates?") &amp;lt;&amp;lt;  Formula(
	If( Dif( :Name( "Date &amp;amp; Time" ), 1 ) != :Name( "Date &amp;amp; Time" )[2] - :Name( "Date &amp;amp; Time" )[1],
		Dif( :Name( "Date &amp;amp; Time" ), 1 ) / (:Name( "Date &amp;amp; Time" )[2] - :Name( "Date &amp;amp; Time" )[1]) - 1,
		0
	)
);

:Name( "Missing Dates?") &amp;lt;&amp;lt; Format ( "Custom", Formula( If( :value == 0, ., :value ) ), 15 );&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 04 Dec 2017 23:01:48 GMT</pubDate>
    <dc:creator>terapin</dc:creator>
    <dc:date>2017-12-04T23:01:48Z</dc:date>
    <item>
      <title>JSL: Set Custom Format Data Column</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-Set-Custom-Format-Data-Column/m-p/48138#M27412</link>
      <description>&lt;P&gt;While I can manually Set Custom Format for a specific data column, I can't find the command that would let me do this in JSL.&lt;/P&gt;&lt;P&gt;Does anyone know the JSL command that would allow me to Set Custom Format using the following conditional statement?&amp;nbsp;&amp;nbsp;Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Column(var1) &amp;lt;&amp;lt; Set Custom Format( If( :value == 0, ., :value ));&lt;/P&gt;</description>
      <pubDate>Mon, 04 Dec 2017 21:34:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-Set-Custom-Format-Data-Column/m-p/48138#M27412</guid>
      <dc:creator>terapin</dc:creator>
      <dc:date>2017-12-04T21:34:25Z</dc:date>
    </item>
    <item>
      <title>Re: JSL: Set Custom Format Data Column</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-Set-Custom-Format-Data-Column/m-p/48144#M27417</link>
      <description>&lt;P&gt;You can do that with the Format() message to the column, but it seems really risky.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You're not actually changing the zeros&amp;nbsp;to missing. You're just displaying them as a missing. Platforms will still analyze the actual value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt=open("$SAMPLE_DATA\Big Class.jmp");

:height&amp;lt;&amp;lt; Format( "Custom", Formula( If( value == 59, ., value ) ), 5 );

dt&amp;lt;&amp;lt;new column("height2", Formula( :height ) );

dt&amp;lt;&amp;lt;Distribution( Continuous Distribution( Column( :height ) ) );

dt&amp;lt;&amp;lt;Select Where( :height == 59 );
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;BTW: I got the code for the Format() message by setting the custom format by hand and then examining the Table Script.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JMPScreenSnapz168.png" style="width: 646px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/8565iBAC0ED4EA5EB0C49/image-size/large?v=v2&amp;amp;px=999" role="button" title="JMPScreenSnapz168.png" alt="JMPScreenSnapz168.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Dec 2017 22:05:10 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-Set-Custom-Format-Data-Column/m-p/48144#M27417</guid>
      <dc:creator>Jeff_Perkinson</dc:creator>
      <dc:date>2017-12-04T22:05:10Z</dc:date>
    </item>
    <item>
      <title>Re: JSL: Set Custom Format Data Column</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-Set-Custom-Format-Data-Column/m-p/48150#M27421</link>
      <description>&lt;P&gt;Jeff,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for replying to my question and sharing with me how you found the&amp;nbsp;code for the Format() command.&amp;nbsp; That will come in handy in the future.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I certainly understand the issue you raised about the data only being displayed as missing.&amp;nbsp; That is exactly what I'm going for in this instance.&amp;nbsp; I have a column that I use for determining when I have missing data records based on datetime. When looking over this column, I find it rather hard to "see" the rows where missing data exists, if any, due to all the zeros.&amp;nbsp; That's why I'm displaying them as missing.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Interestingly, following the code example you provided for my data doesn't work like it does for Big Class.&amp;nbsp; When I execute the following code for the attached data table, the column of interest (Missing Dates?) is set to ####### when the code is run.&amp;nbsp; However, if I select Column Information | Set Custom Format | Ok | Ok, the column "Missing Dates?" is now updated properly with the specified custom format.&amp;nbsp; If I rerun just the code that sets the proper custom format, I get the same ##### result. Weird.&amp;nbsp; Am I doing something wrong or is this a possible bug?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Clear Log();
Names Default To Here( 1 );
&lt;BR /&gt;dt = Current Data Table();

dt &amp;lt;&amp;lt; Add Multiple Columns( "Missing Dates?", 1, before first, Numeric );

:Name( "Missing Dates?") &amp;lt;&amp;lt;  Formula(
	If( Dif( :Name( "Date &amp;amp; Time" ), 1 ) != :Name( "Date &amp;amp; Time" )[2] - :Name( "Date &amp;amp; Time" )[1],
		Dif( :Name( "Date &amp;amp; Time" ), 1 ) / (:Name( "Date &amp;amp; Time" )[2] - :Name( "Date &amp;amp; Time" )[1]) - 1,
		0
	)
);

:Name( "Missing Dates?") &amp;lt;&amp;lt; Format ( "Custom", Formula( If( :value == 0, ., :value ) ), 15 );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 04 Dec 2017 23:01:48 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-Set-Custom-Format-Data-Column/m-p/48150#M27421</guid>
      <dc:creator>terapin</dc:creator>
      <dc:date>2017-12-04T23:01:48Z</dc:date>
    </item>
    <item>
      <title>Re: JSL: Set Custom Format Data Column</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-Set-Custom-Format-Data-Column/m-p/48181#M27436</link>
      <description>&lt;P&gt;It seems to be the colons that you put in front of &lt;STRONG&gt;value&lt;/STRONG&gt; in the &lt;FONT face="andale mono,times"&gt;Format().&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you remove them it works as expected.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;:Name( "Missing Dates?" ) &amp;lt;&amp;lt; Format( "Custom", Formula( If( value == 0, ., value ) ), 15 );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 05 Dec 2017 14:28:36 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-Set-Custom-Format-Data-Column/m-p/48181#M27436</guid>
      <dc:creator>Jeff_Perkinson</dc:creator>
      <dc:date>2017-12-05T14:28:36Z</dc:date>
    </item>
    <item>
      <title>Re: JSL: Set Custom Format Data Column</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-Set-Custom-Format-Data-Column/m-p/48198#M27445</link>
      <description>&lt;P&gt;Thanks Jeff, that certainly works.&amp;nbsp; It's interesting that the Copy Table Script command shows value with a : in front of it.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Dec 2017 16:13:46 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-Set-Custom-Format-Data-Column/m-p/48198#M27445</guid>
      <dc:creator>terapin</dc:creator>
      <dc:date>2017-12-05T16:13:46Z</dc:date>
    </item>
  </channel>
</rss>

