<?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 assign value to a columns in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-assign-value-to-a-columns/m-p/256797#M50454</link>
    <description>&lt;P&gt;I have a question for you.....have you read the documentation on Formulas?&amp;nbsp; If not, you need to read the Discovering JMP documentation&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp; Help==&amp;gt;JMP Documentation Library &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; Discovering JMP&lt;/P&gt;
&lt;P&gt;Here is a modification to the previous formula&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;If( Row() == 1,
	theGroup = {"WL15", "WL08", "WL06", "WL02", "WL01"};
	counter = 1;
);
If(
	Lag( :Group ) != :Group, counter = 1,
	Lag( :rundate ) != :rundate, counter
	++);
theGroup[counter];&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I also suggest, that since the formula is based upon the order of the data, that once the formula is correctly run, that you go into the Column Info for the new column, and remove the formula from the column properties.&amp;nbsp; This will leave the values, but will not rerun the formula if you change the order of the data&lt;/P&gt;</description>
    <pubDate>Wed, 08 Apr 2020 15:33:01 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2020-04-08T15:33:01Z</dc:date>
    <item>
      <title>How to assign value to a columns</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-assign-value-to-a-columns/m-p/256775#M50447</link>
      <description>&lt;P&gt;kindly help on&amp;nbsp;how to generate a script, I want to create a new column,&amp;nbsp; assign value {A, B, C, D, E}&amp;nbsp;by judging column&amp;nbsp;called "rundate", same row with oldest date need assign "A". for rows with same date, need assign same value, for rows with different date need assign different value, like the pic shows.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;rundate&lt;BR /&gt;4/1/2020 7:18&lt;BR /&gt;4/1/2020 7:18&lt;BR /&gt;4/1/2020 7:18&lt;BR /&gt;4/1/2020 7:47&lt;BR /&gt;4/1/2020 8:13&lt;BR /&gt;4/1/2020 8:13&lt;BR /&gt;4/1/2020 8:13&lt;BR /&gt;4/1/2020 8:13&lt;BR /&gt;4/1/2020 8:13&lt;BR /&gt;4/1/2020 8:43&lt;BR /&gt;4/1/2020 8:43&lt;BR /&gt;4/1/2020 8:43&lt;BR /&gt;4/1/2020 8:43&lt;BR /&gt;4/1/2020 8:43&lt;BR /&gt;4/1/2020 8:43&lt;BR /&gt;4/1/2020 8:43&lt;BR /&gt;4/1/2020 9:13&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Untitled.bmp" style="width: 467px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/22855i287149B1075513B1/image-size/large?v=v2&amp;amp;px=999" role="button" title="Untitled.bmp" alt="Untitled.bmp" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Apr 2020 13:45:05 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-assign-value-to-a-columns/m-p/256775#M50447</guid>
      <dc:creator>qspringleaf</dc:creator>
      <dc:date>2020-04-08T13:45:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to assign value to a columns</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-assign-value-to-a-columns/m-p/256785#M50449</link>
      <description>&lt;P&gt;This formula should do what you want&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;If( Row() == 1,
	theLetter = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
	counter = 1;
);
If( Lag( :rundate ) != :rundate,
	counter
	++);
Substr( theLetter, counter, 1 );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 08 Apr 2020 14:13:18 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-assign-value-to-a-columns/m-p/256785#M50449</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-04-08T14:13:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to assign value to a columns</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-assign-value-to-a-columns/m-p/256792#M50451</link>
      <description>&lt;P&gt;Very appreciate your quick response and so thankful for your suggestion, it works well, one more question,&amp;nbsp;if one more column is&amp;nbsp;added which called group, the data is sort by group &amp;amp; rundate, how to generate "new column" like the picture shows? the difference is 1.) column assigned value is&amp;nbsp;changed, not single character. 2.) considering group name also change, so the assigned value reset&amp;nbsp;to &amp;nbsp;first one "WL15".&lt;/P&gt;&lt;P&gt;new column assigned value is {WL15, WL08, WL06, WL02, WL01}, defined manually.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.JPG" style="width: 545px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/22857iA05E88BECFA693B5/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.JPG" alt="Capture.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;GROUP rundate&lt;BR /&gt;WS12 4/1/2020 7:18&lt;BR /&gt;WS12 4/1/2020 7:18&lt;BR /&gt;WS12 4/1/2020 7:18&lt;BR /&gt;WS12 4/1/2020 7:47&lt;BR /&gt;WS12 4/1/2020 8:13&lt;BR /&gt;WS12 4/1/2020 8:13&lt;BR /&gt;WS12 4/1/2020 8:13&lt;BR /&gt;WS12 4/1/2020 8:13&lt;BR /&gt;WS12 4/1/2020 8:13&lt;BR /&gt;WS12 4/1/2020 8:43&lt;BR /&gt;WS12 4/1/2020 8:43&lt;BR /&gt;WS12 4/1/2020 8:43&lt;BR /&gt;WS12 4/1/2020 8:43&lt;BR /&gt;WS12 4/1/2020 8:43&lt;BR /&gt;WS12 4/1/2020 8:43&lt;BR /&gt;WS12 4/1/2020 8:43&lt;BR /&gt;WS12 4/1/2020 9:13&lt;BR /&gt;XW32 4/1/2020 9:41&lt;BR /&gt;XW32 4/1/2020 10:17&lt;BR /&gt;XW32 4/1/2020 10:46&lt;BR /&gt;XW32 4/1/2020 10:46&lt;BR /&gt;XW32 4/1/2020 10:46&lt;BR /&gt;XW32 4/1/2020 11:19&lt;BR /&gt;XW32 4/1/2020 14:46&lt;BR /&gt;XW32 4/1/2020 14:46&lt;BR /&gt;XW32 4/1/2020 14:46&lt;BR /&gt;XW32 4/1/2020 14:46&lt;BR /&gt;XW32 4/1/2020 14:46&lt;BR /&gt;WY07 4/1/2020 15:12&lt;BR /&gt;WY07 4/1/2020 15:41&lt;BR /&gt;WY07 4/1/2020 18:23&lt;BR /&gt;WY07 4/1/2020 18:52&lt;/P&gt;</description>
      <pubDate>Wed, 08 Apr 2020 14:48:18 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-assign-value-to-a-columns/m-p/256792#M50451</guid>
      <dc:creator>qspringleaf</dc:creator>
      <dc:date>2020-04-08T14:48:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to assign value to a columns</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-assign-value-to-a-columns/m-p/256797#M50454</link>
      <description>&lt;P&gt;I have a question for you.....have you read the documentation on Formulas?&amp;nbsp; If not, you need to read the Discovering JMP documentation&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp; Help==&amp;gt;JMP Documentation Library &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; Discovering JMP&lt;/P&gt;
&lt;P&gt;Here is a modification to the previous formula&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;If( Row() == 1,
	theGroup = {"WL15", "WL08", "WL06", "WL02", "WL01"};
	counter = 1;
);
If(
	Lag( :Group ) != :Group, counter = 1,
	Lag( :rundate ) != :rundate, counter
	++);
theGroup[counter];&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I also suggest, that since the formula is based upon the order of the data, that once the formula is correctly run, that you go into the Column Info for the new column, and remove the formula from the column properties.&amp;nbsp; This will leave the values, but will not rerun the formula if you change the order of the data&lt;/P&gt;</description>
      <pubDate>Wed, 08 Apr 2020 15:33:01 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-assign-value-to-a-columns/m-p/256797#M50454</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-04-08T15:33:01Z</dc:date>
    </item>
  </channel>
</rss>

