<?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 set the value of a cell using character data stored in a variable? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-set-the-value-of-a-cell-using-character-data-stored-in-a/m-p/48009#M27322</link>
    <description>&lt;P&gt;It looks like you just need to either repeat the value when setting values in the new column, or use the value in a formula.&amp;nbsp; Here is an example:&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 );

dt1 = New Table( "Input",
	Add Rows( 3 ),
	New Column( 
		"Column 1", Character, "Nominal",
		Set Values( {"a", "b", "c"} )
	)
);

val1 = Column( dt1, "Column 1" )[1];
val2 = Column( dt1, "Column 1" )[2];
vals123 = Column( dt1, "Column 1" )[1::3];

dt2 = New Table( "Output", 
	Add rows( 3 ),
	New Column( "Column 1", Character, "Nominal", Set Values( vals123 ) ),
	New Column( "Column 2", Character, "Nominal", Set Values( repeat( {val1}, 3 ) ) ),
	New Column( "Column 3", Character, "Nominal", Formula( val2 ) )
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 01 Dec 2017 01:15:49 GMT</pubDate>
    <dc:creator>ih</dc:creator>
    <dc:date>2017-12-01T01:15:49Z</dc:date>
    <item>
      <title>How to set the value of a cell using character data stored in a variable?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-set-the-value-of-a-cell-using-character-data-stored-in-a/m-p/48004#M27318</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to take the character value of a certain cell and transfer it over to 18 rows in a new data table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am having issues with the variables col1, col2, and col3 since their data type is character and only contains a single cell value. I cannot find a way to use this variable to populate rows 1-18 of my new table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is a small sample of my code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;col1 = Column(dt,"PCMTest-A")[12::12];&lt;BR /&gt;col2 = Column(dt,"PCMTest-A")[13::13];&lt;BR /&gt;col3 = Column(dt,"PCMTest-A")[10::10];&lt;BR /&gt;col4 = Column(dt,"PCMTest-A")[39::56];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;dt2 = NewTable("Result",&lt;BR /&gt;Add Rows(18),&lt;BR /&gt;NewColumn("Lot Name", Character, Values(col1)),&lt;BR /&gt;NewColumn("Wafer Name", Character, Values(col2)),&lt;BR /&gt;NewColumn("Mask", Character, Values(col3)),&lt;BR /&gt;NewColumn("X", Character, Values(col4)),&lt;/P&gt;&lt;P&gt;);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any suggestions?&lt;/P&gt;</description>
      <pubDate>Thu, 30 Nov 2017 23:42:04 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-set-the-value-of-a-cell-using-character-data-stored-in-a/m-p/48004#M27318</guid>
      <dc:creator>jsluser</dc:creator>
      <dc:date>2017-11-30T23:42:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to set the value of a cell using character data stored in a variable?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-set-the-value-of-a-cell-using-character-data-stored-in-a/m-p/48009#M27322</link>
      <description>&lt;P&gt;It looks like you just need to either repeat the value when setting values in the new column, or use the value in a formula.&amp;nbsp; Here is an example:&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 );

dt1 = New Table( "Input",
	Add Rows( 3 ),
	New Column( 
		"Column 1", Character, "Nominal",
		Set Values( {"a", "b", "c"} )
	)
);

val1 = Column( dt1, "Column 1" )[1];
val2 = Column( dt1, "Column 1" )[2];
vals123 = Column( dt1, "Column 1" )[1::3];

dt2 = New Table( "Output", 
	Add rows( 3 ),
	New Column( "Column 1", Character, "Nominal", Set Values( vals123 ) ),
	New Column( "Column 2", Character, "Nominal", Set Values( repeat( {val1}, 3 ) ) ),
	New Column( "Column 3", Character, "Nominal", Formula( val2 ) )
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 01 Dec 2017 01:15:49 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-set-the-value-of-a-cell-using-character-data-stored-in-a/m-p/48009#M27322</guid>
      <dc:creator>ih</dc:creator>
      <dc:date>2017-12-01T01:15:49Z</dc:date>
    </item>
  </channel>
</rss>

