<?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 How to convert 3 columns in one table in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-convert-3-columns-in-one-table/m-p/699264#M88416</link>
    <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2742"&gt;@martindemel&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am reaching out to get some help on a data process problem. Some time ago, I could convert 3 columns (load pH, load NaCl, Protein % in Load Wash) in one table : since it was very helpful, I would like to do the same thing with a new experiment. Unfortunately, I don’t remember how I did it before. You can have a look at the screenshots enclosed to have a better understanding of what I want to obtain.&lt;/P&gt;&lt;P&gt;I use JMP 17.0.0.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Original data:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Original table.PNG" style="width: 721px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/58791i410157DD56064803/image-size/large?v=v2&amp;amp;px=999" role="button" title="Original table.PNG" alt="Original table.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Table obtained :&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Table obtained.PNG" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/58792iB47CE285456D2515/image-size/large?v=v2&amp;amp;px=999" role="button" title="Table obtained.PNG" alt="Table obtained.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 16 Nov 2023 13:25:52 GMT</pubDate>
    <dc:creator>AvgFinch1077879</dc:creator>
    <dc:date>2023-11-16T13:25:52Z</dc:date>
    <item>
      <title>How to convert 3 columns in one table</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-convert-3-columns-in-one-table/m-p/699264#M88416</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2742"&gt;@martindemel&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am reaching out to get some help on a data process problem. Some time ago, I could convert 3 columns (load pH, load NaCl, Protein % in Load Wash) in one table : since it was very helpful, I would like to do the same thing with a new experiment. Unfortunately, I don’t remember how I did it before. You can have a look at the screenshots enclosed to have a better understanding of what I want to obtain.&lt;/P&gt;&lt;P&gt;I use JMP 17.0.0.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Original data:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Original table.PNG" style="width: 721px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/58791i410157DD56064803/image-size/large?v=v2&amp;amp;px=999" role="button" title="Original table.PNG" alt="Original table.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Table obtained :&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Table obtained.PNG" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/58792iB47CE285456D2515/image-size/large?v=v2&amp;amp;px=999" role="button" title="Table obtained.PNG" alt="Table obtained.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Nov 2023 13:25:52 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-convert-3-columns-in-one-table/m-p/699264#M88416</guid>
      <dc:creator>AvgFinch1077879</dc:creator>
      <dc:date>2023-11-16T13:25:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert 3 columns in one table</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-convert-3-columns-in-one-table/m-p/699322#M88418</link>
      <description>&lt;P&gt;Your sample data is not in a readable form, please attach a copy of your original data to aid in responding to your issue.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Nov 2023 14:17:39 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-convert-3-columns-in-one-table/m-p/699322#M88418</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2023-11-16T14:17:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert 3 columns in one table</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-convert-3-columns-in-one-table/m-p/699344#M88420</link>
      <description>&lt;P&gt;From "Tables" select "Summary"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then set as&amp;nbsp; as shown in the screen shot&lt;/P&gt;&lt;P&gt;Statistics - Mean (Protein%)&lt;/P&gt;&lt;P&gt;Group - load NaCl&lt;/P&gt;&lt;P&gt;Subgroup - load pH&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think that should result in the format you are looking for.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Nov 2023 14:32:50 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-convert-3-columns-in-one-table/m-p/699344#M88420</guid>
      <dc:creator>drdrf</dc:creator>
      <dc:date>2023-11-16T14:32:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert 3 columns in one table</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-convert-3-columns-in-one-table/m-p/699396#M88426</link>
      <description>&lt;P&gt;Thank you for your reply!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It would work like this, but I cannot transfer the color gradient (set up in column info) to the table.&lt;/P&gt;&lt;P&gt;I am pretty sure that I used a different way to obtain this table last time but I don't remember how.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Nov 2023 17:12:33 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-convert-3-columns-in-one-table/m-p/699396#M88426</guid>
      <dc:creator>AvgFinch1077879</dc:creator>
      <dc:date>2023-11-16T17:12:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert 3 columns in one table</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-convert-3-columns-in-one-table/m-p/699397#M88427</link>
      <description>&lt;P&gt;For example here, I would like to have the different pH values on the top, the NaCl values on the right and the "binding proportion" values in the table.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Nov 2023 17:15:53 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-convert-3-columns-in-one-table/m-p/699397#M88427</guid>
      <dc:creator>AvgFinch1077879</dc:creator>
      <dc:date>2023-11-16T17:15:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert 3 columns in one table</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-convert-3-columns-in-one-table/m-p/699398#M88428</link>
      <description>&lt;P&gt;Also, last time, the color gradient was directly transferred in the table. Which is not the case when I use the "Tables &amp;gt; Summary" feature.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Nov 2023 17:18:07 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-convert-3-columns-in-one-table/m-p/699398#M88428</guid>
      <dc:creator>AvgFinch1077879</dc:creator>
      <dc:date>2023-11-16T17:18:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert 3 columns in one table</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-convert-3-columns-in-one-table/m-p/699420#M88433</link>
      <description>&lt;P&gt;Here is a simple script that transforms the data&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="txnelson_0-1700158951392.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/58813i254421AFCDD1304B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="txnelson_0-1700158951392.png" alt="txnelson_0-1700158951392.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Current Data Table();

// Use Tabulate to create the transformed table
(tab = dt &amp;lt;&amp;lt; Tabulate(
	Change Item Label( Statistics( Mean, " " ) ),
	Remove Column Label( Analysis Columns( Binding proportion ) ),
	Add Table(
		Column Table( Grouping Columns( :pH ), Statistics( Mean ), Analysis Columns( :Binding proportion ) ),
		Row Table( Grouping Columns( :"[NaCl]"n ) )
	)
)) &amp;lt;&amp;lt; Make Into Data Table;

Current Data Table() &amp;lt;&amp;lt; set name( "Final" );
dtFinal = Current Data Table();
Report( tab ) &amp;lt;&amp;lt; close window;

// change column names and set the Value Colors
valColors = dt:Binding proportion &amp;lt;&amp;lt; get property("Value Colors");
For( i = 2, i &amp;lt;= N Cols( dtFinal ), i++,
	Column( dtFinal, i ) &amp;lt;&amp;lt; set name( Word( -1, Trim( Column( dtFinal, i ) &amp;lt;&amp;lt; get name ), "()," ) );
	Column( dtFinal, i ) &amp;lt;&amp;lt; set property("Value Colors", eval(valColors));
	Column(dtFinal,i)&amp;lt;&amp;lt;color cell by value; 
	Column(dtFinal,i)&amp;lt;&amp;lt;set display width(40);
);

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Please do not just cut and paste this code, without taking the time to study it and learn what it is doing.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Nov 2023 18:24:08 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-convert-3-columns-in-one-table/m-p/699420#M88433</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2023-11-16T18:24:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert 3 columns in one table</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-convert-3-columns-in-one-table/m-p/699748#M88453</link>
      <description>&lt;P&gt;Thank you very much!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I understand every line but I don't know where I should write in the color theme. I want to use "Yellow Green Red" gradient so I tried to replace "valColors" on line 22 by "Yellow Greed Red" but this is not it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And when I run the script without changing anything this error message shows up:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AvgFinch1077879_0-1700211124804.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/58863i9BD7FD34E90710D7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AvgFinch1077879_0-1700211124804.png" alt="AvgFinch1077879_0-1700211124804.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Nov 2023 08:59:28 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-convert-3-columns-in-one-table/m-p/699748#M88453</guid>
      <dc:creator>AvgFinch1077879</dc:creator>
      <dc:date>2023-11-17T08:59:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert 3 columns in one table</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-convert-3-columns-in-one-table/m-p/699850#M88470</link>
      <description>&lt;P&gt;The script I provided was based upon having the Column Property "Value Colors" set.&amp;nbsp; Apparently your starting data table does not have them set.&lt;/P&gt;
&lt;P&gt;I have changed the JSL to use the "Gradient Colors" Column Property.&amp;nbsp; &amp;nbsp;I also changed the code to set the "Color Gradient" on the initial data table, so it now ensures that when the new data table is being created, that it has what it needs to set the colors for the cells.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Current Data Table();

// Set the color gradient column property
dt:binding proportion &amp;lt;&amp;lt; set property("color gradient", {"Green Yellow Red"(1), Range( {6.2, 87.38, 25.6941666666667} )});
dt:binding proportion&amp;lt;&amp;lt;color cell by value;

// Use Tabulate to create the transformed table
(tab = dt &amp;lt;&amp;lt; Tabulate(
	Change Item Label( Statistics( Mean, " " ) ),
	Remove Column Label( Analysis Columns( Binding proportion ) ),
	Add Table(
		Column Table( Grouping Columns( :pH ), Statistics( Mean ), Analysis Columns( :Binding proportion ) ),
		Row Table( Grouping Columns( :"[NaCl]"n ) )
	)
)) &amp;lt;&amp;lt; Make Into Data Table;

Current Data Table() &amp;lt;&amp;lt; set name( "Final" );
dtFinal = Current Data Table();
Report( tab ) &amp;lt;&amp;lt; close window;

// change column names and set the Color Gradient
valColors = dt:Binding proportion &amp;lt;&amp;lt; get property("Color gradient");
For( i = 2, i &amp;lt;= N Cols( dtFinal ), i++,
	Column( dtFinal, i ) &amp;lt;&amp;lt; set name( Word( -1, Trim( Column( dtFinal, i ) &amp;lt;&amp;lt; get name ), "()," ) );
	Column( dtFinal, i ) &amp;lt;&amp;lt; set property("Color Gradient", eval(valColors));
	Column(dtFinal,i)&amp;lt;&amp;lt;color cell by value; 
	Column(dtFinal,i)&amp;lt;&amp;lt;set display width(40);
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 17 Nov 2023 12:48:08 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-convert-3-columns-in-one-table/m-p/699850#M88470</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2023-11-17T12:48:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert 3 columns in one table</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-convert-3-columns-in-one-table/m-p/700597#M88526</link>
      <description>&lt;P&gt;Perfect, thanks a lot !&lt;/P&gt;</description>
      <pubDate>Mon, 20 Nov 2023 08:17:07 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-convert-3-columns-in-one-table/m-p/700597#M88526</guid>
      <dc:creator>AvgFinch1077879</dc:creator>
      <dc:date>2023-11-20T08:17:07Z</dc:date>
    </item>
  </channel>
</rss>

