<?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 New column to label positive or negative in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/New-column-to-label-positive-or-negative/m-p/592873#M79689</link>
    <description>&lt;P&gt;I have data in column :direction that is either positive, negative, or blank determined by a Lag formula 'in the column.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I created a new column :updown where I wanted to look at row of :direction. If it's positive or blank, I want updown for that row to be "Up", otherwise I want it to say "Down". This will simplify data filtering since we just want to split up multi-directional voltage data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;//Check Whether positive or negative
For(i=1, i&amp;lt;=N Rows(dt), i++,
if(:direction[i] &amp;lt; 0,
 :updown[i] &amp;lt;&amp;lt; Set Value("Down");,
 :updown[i] &amp;lt;&amp;lt; Set Value("Up");
);
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I've done something similar previously but it doesn't seem to be working. I've tried a few different syntax options and nothing has worked.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance for your help!&lt;/P&gt;</description>
    <pubDate>Thu, 08 Jun 2023 16:41:30 GMT</pubDate>
    <dc:creator>trevorphysics</dc:creator>
    <dc:date>2023-06-08T16:41:30Z</dc:date>
    <item>
      <title>New column to label positive or negative</title>
      <link>https://community.jmp.com/t5/Discussions/New-column-to-label-positive-or-negative/m-p/592873#M79689</link>
      <description>&lt;P&gt;I have data in column :direction that is either positive, negative, or blank determined by a Lag formula 'in the column.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I created a new column :updown where I wanted to look at row of :direction. If it's positive or blank, I want updown for that row to be "Up", otherwise I want it to say "Down". This will simplify data filtering since we just want to split up multi-directional voltage data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;//Check Whether positive or negative
For(i=1, i&amp;lt;=N Rows(dt), i++,
if(:direction[i] &amp;lt; 0,
 :updown[i] &amp;lt;&amp;lt; Set Value("Down");,
 :updown[i] &amp;lt;&amp;lt; Set Value("Up");
);
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I've done something similar previously but it doesn't seem to be working. I've tried a few different syntax options and nothing has worked.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance for your help!&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2023 16:41:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/New-column-to-label-positive-or-negative/m-p/592873#M79689</guid>
      <dc:creator>trevorphysics</dc:creator>
      <dc:date>2023-06-08T16:41:30Z</dc:date>
    </item>
    <item>
      <title>Re: New column to label positive or negative</title>
      <link>https://community.jmp.com/t5/Discussions/New-column-to-label-positive-or-negative/m-p/592878#M79690</link>
      <description>&lt;P&gt;I think you just need to&amp;nbsp; do this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;//Check Whether positive or negative
For(i=1, i&amp;lt;=N Rows(dt), i++,
if(:direction[i] &amp;lt; 0,
 :updown[i] ="Down";,
 :updown[i] = "Up";
);
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;An alternative is to use a formula&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;column(dt, "updown") &amp;lt;&amp;lt; Set Formula( If(:direction &amp;lt;0, "Down", "Up"))&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 24 Jan 2023 21:26:42 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/New-column-to-label-positive-or-negative/m-p/592878#M79690</guid>
      <dc:creator>SamGardner</dc:creator>
      <dc:date>2023-01-24T21:26:42Z</dc:date>
    </item>
  </channel>
</rss>

