<?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: Returning value for one column based on reference from other column in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Returning-value-for-one-column-based-on-reference-from-other/m-p/276434#M53628</link>
    <description>&lt;P&gt;Hi Satej,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The simplest solution is to recode your Pass_Fail column as a Continuous numerical column with Fail = 0 and Pass = 1. Then you can just look for the minimum by Sr ID to determine if any of the Sr ID failed at any time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;See this solution attached&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;TS&lt;/P&gt;</description>
    <pubDate>Wed, 01 Jul 2020 04:47:20 GMT</pubDate>
    <dc:creator>Thierry_S</dc:creator>
    <dc:date>2020-07-01T04:47:20Z</dc:date>
    <item>
      <title>Returning value for one column based on reference from other column</title>
      <link>https://community.jmp.com/t5/Discussions/Returning-value-for-one-column-based-on-reference-from-other/m-p/276428#M53627</link>
      <description>&lt;P&gt;Hi All&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the columns "Rel Interval", "SrID", "Pass_Fail". I want to create and generate script for the last column "Updated Pass_Fail_SrID". All SrID are passing at rel interval "0" and "24" but SrID "B" and "D" fail at "100". I want to create last column "Updated Pass_Fail_SrID" which takes reference of pass and fail and assigns pass / fail to all checkpoints. This is so that while plotting I can have the split reference. &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2020-06-30 at 8.04.59 PM.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/24923iAADE4DF997F7C81E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screen Shot 2020-06-30 at 8.04.59 PM.png" alt="Screen Shot 2020-06-30 at 8.04.59 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Any pointers are greatly appreciated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks&amp;nbsp;&lt;/P&gt;&lt;P&gt;Satej&lt;/P&gt;&lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Sat, 10 Jun 2023 23:15:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Returning-value-for-one-column-based-on-reference-from-other/m-p/276428#M53627</guid>
      <dc:creator>sbidwe</dc:creator>
      <dc:date>2023-06-10T23:15:30Z</dc:date>
    </item>
    <item>
      <title>Re: Returning value for one column based on reference from other column</title>
      <link>https://community.jmp.com/t5/Discussions/Returning-value-for-one-column-based-on-reference-from-other/m-p/276434#M53628</link>
      <description>&lt;P&gt;Hi Satej,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The simplest solution is to recode your Pass_Fail column as a Continuous numerical column with Fail = 0 and Pass = 1. Then you can just look for the minimum by Sr ID to determine if any of the Sr ID failed at any time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;See this solution attached&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;TS&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jul 2020 04:47:20 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Returning-value-for-one-column-based-on-reference-from-other/m-p/276434#M53628</guid>
      <dc:creator>Thierry_S</dc:creator>
      <dc:date>2020-07-01T04:47:20Z</dc:date>
    </item>
    <item>
      <title>Re: Returning value for one column based on reference from other column</title>
      <link>https://community.jmp.com/t5/Discussions/Returning-value-for-one-column-based-on-reference-from-other/m-p/276436#M53629</link>
      <description>One note: the recoded Pass Fail needs to be numerical but it can be nominal or ordinal too</description>
      <pubDate>Wed, 01 Jul 2020 04:48:17 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Returning-value-for-one-column-based-on-reference-from-other/m-p/276436#M53629</guid>
      <dc:creator>Thierry_S</dc:creator>
      <dc:date>2020-07-01T04:48:17Z</dc:date>
    </item>
    <item>
      <title>Re: Returning value for one column based on reference from other column</title>
      <link>https://community.jmp.com/t5/Discussions/Returning-value-for-one-column-based-on-reference-from-other/m-p/276442#M53632</link>
      <description>&lt;P&gt;Below is a simple script that will create the new column by creating a second table, manipulating that table and then bringing the results back into the original table.&amp;nbsp; While this is done using a script, each of the steps in the script, are available to be performed using the interactive point and click methodology that JMP does so well.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;names default to here(1);
// create the example data table
dt = New Table( "Example 3",
	Add Rows( 15 ),
	New Column( "Rel Interval",
		Numeric,
		"Continuous",
		Format( "Best", 12 ),
		Set Values( [0, 0, 0, 0, 0, 24, 24, 24, 24, 24, 100, 100, 100, 100, 100] )
	),
	New Column( "Sr ID",
		Character( 8 ),
		"Nominal",
		Set Values(
			{"A", "B", "C", "D", "E", "A", "B", "C", "D", "E", "A", "B", "C", "D",
			"E"}
		)
	),
	New Column( "Pass_Fail",
		Character( 8 ),
		"Nominal",
		Set Values(
			{"Pass", "Pass", "Pass", "Pass", "Pass", "Pass", "Pass", "Pass", "Pass",
			"Pass", "Pass", "Fail", "Pass", "Fail", "Pass"}
		)
	)
);
wait(3);  // this is added just so the viewer can see the original data table

// Split the Pass Fail column into 2 columns
dtSplit = dt &amp;lt;&amp;lt; Split(
	Split By( :Pass_Fail ),
	Split( :Pass_Fail ),
	Group( :Sr ID ),
	Remaining Columns( Drop All ),
	Sort by Column Property
);
wait(2); 
// Create a new column that has a formula that will set the Pass or Fail value
dtSplit &amp;lt;&amp;lt; New Column("Updated Pass_Fail_SrID", character, formula(Word( 1, :Fail || "," || :Pass, "," )));

wait(2);
// convert the formula column into static values
dtSplit:Updated Pass_Fail_SRID &amp;lt;&amp;lt; delete formula;

wait(2);
// Delete no longer wanted columns
dtSplit &amp;lt;&amp;lt; delete columns("Fail","Pass");

wait(2);
// Update the original data table with the information from the split table
dt  &amp;lt;&amp;lt; Update(
	With( dtSplit ),
	Match Columns( :Sr ID = :Sr ID )
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Here are the steps to do this interactively&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Click on the data table that has the columns, Rel Interval, Sr ID, and Pass_Fail, to make the data table the current active data table&lt;/LI&gt;
&lt;LI&gt;Go to the pull down menus and select &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; Tables==&amp;gt;Split&lt;/LI&gt;
&lt;LI&gt;Set the Pass_Fail column and the "Split By" choice, and also as the "Split Columns" choice, and then set the Sr ID column as the "Group" choice&lt;/LI&gt;
&lt;LI&gt;Click on OK&lt;/LI&gt;
&lt;LI&gt;Go to the new data table that has been created&lt;/LI&gt;
&lt;LI&gt;Create a new column called "&lt;FONT style="background-color: #ffffff;"&gt;Updated Pass_Fail_SrID&lt;/FONT&gt;" and make It's data type, "Character"&lt;/LI&gt;
&lt;LI&gt;Right click on the column header and select "Formula"&lt;/LI&gt;
&lt;LI&gt;In the formula window, type in the formula &amp;nbsp; &amp;nbsp;&lt;FONT style="background-color: #ffffff;"&gt;Word( 1, :Fail || "," || :Pass, "," )&lt;/FONT&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; This formula will concatenate the 2 columns of Fail and Pass together, placing a comma between the values.&amp;nbsp; It will then use the Word() function to select the 1st word in the concatenated list, and since the rows that have no Fails, will have the value of Pass as it's first word, the resulting values will set the correct values.&lt;/LI&gt;
&lt;LI&gt;Click on OK&lt;/LI&gt;
&lt;LI&gt;Now go to the Col Info dialog window for the new column and click on the column property "formula", and then click on Remove.&amp;nbsp; This will convert the values in the new column to static values, rather that calculated values.&lt;/LI&gt;
&lt;LI&gt;Delete the columns Pass and Fail.&amp;nbsp; They are no longer needed.&lt;/LI&gt;
&lt;LI&gt;Go back to the original data table and go to the pull down menu and select &amp;nbsp; &amp;nbsp; &amp;nbsp; Tables==Update&lt;/LI&gt;
&lt;LI&gt;Select the lookup table the new column has been created in as the table to use to get the update from&lt;/LI&gt;
&lt;LI&gt;check the box for "Match columns"&lt;/LI&gt;
&lt;LI&gt;select Sr ID from both data tables and then click on the Match Button&lt;/LI&gt;
&lt;LI&gt;Click OK and your original data table will now have the new column added to it&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Wed, 01 Jul 2020 04:53:35 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Returning-value-for-one-column-based-on-reference-from-other/m-p/276442#M53632</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-07-01T04:53:35Z</dc:date>
    </item>
    <item>
      <title>Re: Returning value for one column based on reference from other column</title>
      <link>https://community.jmp.com/t5/Discussions/Returning-value-for-one-column-based-on-reference-from-other/m-p/276454#M53636</link>
      <description>&lt;P&gt;Thanks so much for the prompt responses.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jul 2020 05:11:58 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Returning-value-for-one-column-based-on-reference-from-other/m-p/276454#M53636</guid>
      <dc:creator>sbidwe</dc:creator>
      <dc:date>2020-07-01T05:11:58Z</dc:date>
    </item>
    <item>
      <title>Re: Returning value for one column based on reference from other column</title>
      <link>https://community.jmp.com/t5/Discussions/Returning-value-for-one-column-based-on-reference-from-other/m-p/276455#M53637</link>
      <description>Thanks so much for the prompt responses. Thats quite elegant way</description>
      <pubDate>Wed, 01 Jul 2020 05:13:16 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Returning-value-for-one-column-based-on-reference-from-other/m-p/276455#M53637</guid>
      <dc:creator>sbidwe</dc:creator>
      <dc:date>2020-07-01T05:13:16Z</dc:date>
    </item>
  </channel>
</rss>

