<?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 convert decimal value to binary value in another column? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-convert-decimal-value-to-binary-value-in-another-column/m-p/762033#M94047</link>
    <description>&lt;P&gt;I'm not sure what you mean with either of those.&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;"Open new columns"? you open tables, not columns in JMP. If you wish to refer columns, what is "new" column?&lt;/LI&gt;
&lt;LI&gt;1011 isn't written there to anywhere else besides column which is used for the formula reference. So create formula column using your column and it should work.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;To learn JMP scripting&amp;nbsp;&lt;A href="https://www.jmp.com/support/help/en/18.0/#page/jmp/introduction-to-writing-jsl-scripts.shtml#" target="_blank"&gt;Scripting Guide (jmp.com)&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 30 May 2024 09:57:13 GMT</pubDate>
    <dc:creator>jthi</dc:creator>
    <dc:date>2024-05-30T09:57:13Z</dc:date>
    <item>
      <title>How to convert decimal value to binary value in another column?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-convert-decimal-value-to-binary-value-in-another-column/m-p/762021#M94039</link>
      <description>&lt;P&gt;How to convert decimal value to binary value in another column?&lt;/P&gt;</description>
      <pubDate>Thu, 30 May 2024 08:58:19 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-convert-decimal-value-to-binary-value-in-another-column/m-p/762021#M94039</guid>
      <dc:creator>Liranlev</dc:creator>
      <dc:date>2024-05-30T08:58:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert decimal value to binary value in another column?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-convert-decimal-value-to-binary-value-in-another-column/m-p/762023#M94040</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/57311"&gt;@Liranlev&lt;/a&gt;&amp;nbsp;: Here ya go (you can choose whatever base you like in the Hex function).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Hex( X, base( 2 ) ), where X is the decimal value.&lt;/P&gt;</description>
      <pubDate>Thu, 30 May 2024 09:19:05 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-convert-decimal-value-to-binary-value-in-another-column/m-p/762023#M94040</guid>
      <dc:creator>MRB3855</dc:creator>
      <dc:date>2024-05-30T09:19:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert decimal value to binary value in another column?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-convert-decimal-value-to-binary-value-in-another-column/m-p/762024#M94041</link>
      <description>&lt;P&gt;OK&lt;BR /&gt;Let's say for example now I have a column with value "1011"&lt;BR /&gt;Do you have any idea how can I seperate it to 4 columns?&lt;BR /&gt;1 0 1 1&lt;/P&gt;</description>
      <pubDate>Thu, 30 May 2024 09:25:24 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-convert-decimal-value-to-binary-value-in-another-column/m-p/762024#M94041</guid>
      <dc:creator>Liranlev</dc:creator>
      <dc:date>2024-05-30T09:25:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert decimal value to binary value in another column?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-convert-decimal-value-to-binary-value-in-another-column/m-p/762026#M94042</link>
      <description>&lt;P&gt;Here is one suggestion (create new column which you can use with Text to Columns as it doesn't allow using "" as limiter)&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt = New Table("Untitled",
	Add Rows(1),
	Compress File When Saved(1),
	New Column("Column 1", Character, "Nominal", Set Values({"1011"}))
);

dt &amp;lt;&amp;lt; new column("Separated", Character, "Nominal", Formula(
	Concat Items(Words(:Column 1, ""), "|")
));

dt &amp;lt;&amp;lt; Text to Columns(columns(:Separated), Delimiters("|"));
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1717061447151.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/64631i9A770E7EC34689C5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1717061447151.png" alt="jthi_0-1717061447151.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;LI-MESSAGE title="Allow the Text to Columns() function to specify an empty delimiter" uid="665787" url="https://community.jmp.com/t5/JMP-Wish-List/Allow-the-Text-to-Columns-function-to-specify-an-empty-delimiter/m-p/665787#U665787" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-idea-thread lia-fa-icon lia-fa-idea lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 May 2024 09:31:31 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-convert-decimal-value-to-binary-value-in-another-column/m-p/762026#M94042</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-05-30T09:31:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert decimal value to binary value in another column?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-convert-decimal-value-to-binary-value-in-another-column/m-p/762027#M94043</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/57311"&gt;@Liranlev&lt;/a&gt;:&amp;nbsp;Word( 1, Y, "" ) will give the first digit,&amp;nbsp;&amp;nbsp;Word( 2, Y, "" ), will give the 2nd, etc., where Y is the binary representation.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 May 2024 09:33:37 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-convert-decimal-value-to-binary-value-in-another-column/m-p/762027#M94043</guid>
      <dc:creator>MRB3855</dc:creator>
      <dc:date>2024-05-30T09:33:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert decimal value to binary value in another column?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-convert-decimal-value-to-binary-value-in-another-column/m-p/762028#M94044</link>
      <description>&lt;P&gt;But I don't know how long my binary number. I should use loop&lt;/P&gt;</description>
      <pubDate>Thu, 30 May 2024 09:35:31 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-convert-decimal-value-to-binary-value-in-another-column/m-p/762028#M94044</guid>
      <dc:creator>Liranlev</dc:creator>
      <dc:date>2024-05-30T09:35:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert decimal value to binary value in another column?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-convert-decimal-value-to-binary-value-in-another-column/m-p/762029#M94045</link>
      <description>&lt;P&gt;It's great but I have some problem.&lt;/P&gt;&lt;P&gt;1. It should open new columns in the table I work in.&lt;/P&gt;&lt;P&gt;2. How can it take values from specific column instead of writing "1011"?&lt;/P&gt;</description>
      <pubDate>Thu, 30 May 2024 09:36:58 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-convert-decimal-value-to-binary-value-in-another-column/m-p/762029#M94045</guid>
      <dc:creator>Liranlev</dc:creator>
      <dc:date>2024-05-30T09:36:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert decimal value to binary value in another column?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-convert-decimal-value-to-binary-value-in-another-column/m-p/762033#M94047</link>
      <description>&lt;P&gt;I'm not sure what you mean with either of those.&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;"Open new columns"? you open tables, not columns in JMP. If you wish to refer columns, what is "new" column?&lt;/LI&gt;
&lt;LI&gt;1011 isn't written there to anywhere else besides column which is used for the formula reference. So create formula column using your column and it should work.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;To learn JMP scripting&amp;nbsp;&lt;A href="https://www.jmp.com/support/help/en/18.0/#page/jmp/introduction-to-writing-jsl-scripts.shtml#" target="_blank"&gt;Scripting Guide (jmp.com)&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 30 May 2024 09:57:13 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-convert-decimal-value-to-binary-value-in-another-column/m-p/762033#M94047</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-05-30T09:57:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert decimal value to binary value in another column?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-convert-decimal-value-to-binary-value-in-another-column/m-p/762165#M94083</link>
      <description>&lt;P&gt;There is no need for a loop.....Taking&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt;&amp;nbsp;example and adding a second row to his example table, one can see that it will add as many columns as found.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="txnelson_0-1717183463526.png" style="width: 745px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/64705i40A227B06FC53E32/image-dimensions/745x188?v=v2" width="745" height="188" role="button" title="txnelson_0-1717183463526.png" alt="txnelson_0-1717183463526.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Now the additional issue that one might want the binary columns to&amp;nbsp; line up and have the same number of columns generated.&amp;nbsp; Here is a modification that accomplishes that&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="txnelson_1-1717184598897.png" style="width: 750px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/64706i69F3EF7CD466D4FD/image-dimensions/750x212?v=v2" width="750" height="212" role="button" title="txnelson_1-1717184598897.png" alt="txnelson_1-1717184598897.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );

dt = New Table( "Untitled",
	Add Rows( 1 ),
	Compress File When Saved( 1 ),
	New Column( "Column 1", Character, "Nominal", Set Values( {"1011", "11010110"} ) )
);

max length = Col Max( Length( :Column 1 ) );
fill = Repeat( "0", max length );

For Each Row(
	:Column 1 = Substr( fill, 1, max length - Length( :Column 1 ) ) || :Column 1
);

dt &amp;lt;&amp;lt; New Column( "Separated",
	Character,
	"Nominal",
	Formula( Concat Items( Words( :Column 1, "" ), "|" ) )
);

dt &amp;lt;&amp;lt; Text to Columns( columns( :Separated ), Delimiters( "|" ) );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 31 May 2024 19:43:56 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-convert-decimal-value-to-binary-value-in-another-column/m-p/762165#M94083</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2024-05-31T19:43:56Z</dc:date>
    </item>
  </channel>
</rss>

