<?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 determine blank columns in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-determine-blank-columns/m-p/510668#M73844</link>
    <description>&lt;P&gt;I tried the code for the character column but prompts this error:&lt;BR /&gt;String( " ... 2110 total characters ... " ) assigned.&lt;BR /&gt;&lt;BR /&gt;Not working for me tho&lt;/P&gt;</description>
    <pubDate>Fri, 17 Jun 2022 06:54:26 GMT</pubDate>
    <dc:creator>UserID16644</dc:creator>
    <dc:date>2022-06-17T06:54:26Z</dc:date>
    <item>
      <title>How to determine blank columns</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-determine-blank-columns/m-p/510656#M73837</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I write an If Else statement when an existing column is blank, then it will create another column. If it is existing and not blank, then there is no need to create an additional column.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's a snip of the code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dtcol = dt &amp;lt;&amp;lt; get column names( "String" );

If( Contains( dtcol, "Name" ),
/* but column is blank, create another column Name2 */
);&lt;/CODE&gt;&amp;nbsp;&lt;/PRE&gt;</description>
      <pubDate>Sat, 10 Jun 2023 20:50:56 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-determine-blank-columns/m-p/510656#M73837</guid>
      <dc:creator>UserID16644</dc:creator>
      <dc:date>2023-06-10T20:50:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to determine blank columns</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-determine-blank-columns/m-p/510660#M73840</link>
      <description>&lt;P&gt;Here is a small script, that looks to see if there is a column named "name" and if not it creates a column named "name 2"&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Current Data Table();

dtcol = dt &amp;lt;&amp;lt; get column names( "String" );

If( Contains( dtcol, "Name" ),
	dt &amp;lt;&amp;lt; New Column( "name 2" )
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I don't know is this is what you want.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jun 2022 02:01:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-determine-blank-columns/m-p/510660#M73840</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2022-06-17T02:01:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to determine blank columns</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-determine-blank-columns/m-p/510661#M73841</link>
      <description>&lt;P&gt;I accidentally pushed the accepted solution. But my question is how to determine if the existing column is blank. If it is blank, then it will be the time to create another column (name 2).&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jun 2022 02:32:24 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-determine-blank-columns/m-p/510661#M73841</guid>
      <dc:creator>UserID16644</dc:creator>
      <dc:date>2022-06-17T02:32:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to determine blank columns</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-determine-blank-columns/m-p/510662#M73842</link>
      <description>&lt;P&gt;Is your question that you want to check to see if all of the cells in a given column are blank?&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 );
dt = Current Data Table();

// Character Columns
theString = Concat Items( Column( dt, myColumn ) &amp;lt;&amp;lt; get values );

If( theString == "",
	dt &amp;lt;&amp;lt; New Column( "myColumn 2", character )
);

// Numeric Columns
theSum = Col Sum( dt:myColumn );

If( Is Missing( theSum ),
	dt &amp;lt;&amp;lt; New Column( "my Column 2" )
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jun 2022 03:32:34 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-determine-blank-columns/m-p/510662#M73842</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2022-06-17T03:32:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to determine blank columns</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-determine-blank-columns/m-p/510668#M73844</link>
      <description>&lt;P&gt;I tried the code for the character column but prompts this error:&lt;BR /&gt;String( " ... 2110 total characters ... " ) assigned.&lt;BR /&gt;&lt;BR /&gt;Not working for me tho&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jun 2022 06:54:26 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-determine-blank-columns/m-p/510668#M73844</guid>
      <dc:creator>UserID16644</dc:creator>
      <dc:date>2022-06-17T06:54:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to determine blank columns</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-determine-blank-columns/m-p/510669#M73845</link>
      <description>&lt;P&gt;If you have JMP16 this should work. Run it in parts to understand what it is doing&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt = New Table("Untitled",
	Add Rows(2),
	Compress File When Saved(1),
	New Column("NumVal", Numeric, "Continuous", Format("Best", 12), Set Values([1, 2])),
	New Column("NumMissing", Numeric, "Continuous", Format("Best", 12), Set Values([., .])),
	New Column("CharVar", Character, "Nominal", Set Values({"a", "b"})),
	New Column("CharMissing", Character, "Nominal", Set Values({"", ""}))
);

n_rows = N Rows(dt);
For Each({col_name}, dt &amp;lt;&amp;lt; Get Column Names("String"),
	If(Col N Missing(Column(dt, col_name)) == n_rows,
		dt &amp;lt;&amp;lt; New Column(col_name);
	);
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 17 Jun 2022 07:05:17 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-determine-blank-columns/m-p/510669#M73845</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2022-06-17T07:05:17Z</dc:date>
    </item>
  </channel>
</rss>

