<?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: Help！ How should I set a formula or JSL to implement this calculation? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Help-How-should-I-set-a-formula-or-JSL-to-implement-this/m-p/828350#M101014</link>
    <description>&lt;P&gt;Thank you very much&lt;/P&gt;</description>
    <pubDate>Tue, 21 Jan 2025 03:08:40 GMT</pubDate>
    <dc:creator>AlphaColt356</dc:creator>
    <dc:date>2025-01-21T03:08:40Z</dc:date>
    <item>
      <title>Help！ How should I set a formula or JSL to implement this calculation?</title>
      <link>https://community.jmp.com/t5/Discussions/Help-How-should-I-set-a-formula-or-JSL-to-implement-this/m-p/828305#M101012</link>
      <description>&lt;P&gt;I want to fill "243" in row 12345 of column NO (column X, Raw5）， And push it downwards to fill (column 678910 of NO is filled with "1511")&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="AlphaColt356_0-1737422154449.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/72048iA41EA7D67439369C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AlphaColt356_0-1737422154449.png" alt="AlphaColt356_0-1737422154449.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jan 2025 01:46:50 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Help-How-should-I-set-a-formula-or-JSL-to-implement-this/m-p/828305#M101012</guid>
      <dc:creator>AlphaColt356</dc:creator>
      <dc:date>2025-01-21T01:46:50Z</dc:date>
    </item>
    <item>
      <title>Re: Help！ How should I set a formula or JSL to implement this calculation?</title>
      <link>https://community.jmp.com/t5/Discussions/Help-How-should-I-set-a-formula-or-JSL-to-implement-this/m-p/828347#M101013</link>
      <description>&lt;P&gt;Here are 2 solutions.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="txnelson_0-1737427654978.png" style="width: 519px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/72059i9D2E672BB9E20CDC/image-dimensions/519x549?v=v2" width="519" height="549" role="button" title="txnelson_0-1737427654978.png" alt="txnelson_0-1737427654978.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;The first solution assumes that all of the data are in sets of 5 rows, so it always assigns values from every 5th row.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;If( Mod( Row(), 5 ) == 0,
	Num( :X ),
	Num( :X[(Floor( Row() / 5 ) + 1) * 5] )
);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The second uses the value from the first NO row beyond or equal to the current row number.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;As Constant(
	NORows = Current Data Table() &amp;lt;&amp;lt; get rows where( :track no == "NO" )
);
val = Num( :X[NORows[1]] );
If( Row() == NORows[1],
	Try( NORows = NORows[Index( 2, Length( NORows ) )] )
);
val;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 21 Jan 2025 02:50:41 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Help-How-should-I-set-a-formula-or-JSL-to-implement-this/m-p/828347#M101013</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2025-01-21T02:50:41Z</dc:date>
    </item>
    <item>
      <title>Re: Help！ How should I set a formula or JSL to implement this calculation?</title>
      <link>https://community.jmp.com/t5/Discussions/Help-How-should-I-set-a-formula-or-JSL-to-implement-this/m-p/828350#M101014</link>
      <description>&lt;P&gt;Thank you very much&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jan 2025 03:08:40 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Help-How-should-I-set-a-formula-or-JSL-to-implement-this/m-p/828350#M101014</guid>
      <dc:creator>AlphaColt356</dc:creator>
      <dc:date>2025-01-21T03:08:40Z</dc:date>
    </item>
    <item>
      <title>Re: Help！ How should I set a formula or JSL to implement this calculation?</title>
      <link>https://community.jmp.com/t5/Discussions/Help-How-should-I-set-a-formula-or-JSL-to-implement-this/m-p/828362#M101015</link>
      <description>&lt;P&gt;If you have to do this only once, you can also do this interactively in JMP (Note that JMP isn't able to capture all these steps done here, so it isn't that easy to automate based on JMP created script).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First create new column to keep the original order and sort your table descending by it&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1737438168258.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/72067i0A3DF51E8F99FCF0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1737438168258.png" alt="jthi_0-1737438168258.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Next fix the X column values to either Numeric OR change NO to Character (I go with the X to numeric).&lt;/P&gt;
&lt;P&gt;Then select one NO value from column track no, right click on it and select matching cells&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_1-1737438242397.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/72068i82350C7225166717/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_1-1737438242397.png" alt="jthi_1-1737438242397.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Hold Alt and press on X column header to select X columns values which match NO value on track no&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_2-1737438276676.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/72069i9A4A7FCD76B39D9D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_2-1737438276676.png" alt="jthi_2-1737438276676.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Press Ctrl + C (or otherwise copy) those values to clipboard, click on NO column header and paste them with Ctrl+V&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_3-1737438310994.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/72070iA93D18DC6004C392/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_3-1737438310994.png" alt="jthi_3-1737438310994.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Click on the NO column header to select all the values in it, right click on first value and fill&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_4-1737438355850.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/72071iF78B3EFFB1922411/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_4-1737438355850.png" alt="jthi_4-1737438355850.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Sort your table again (ascending this time) with the column created in first step and delete the sorting column&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_5-1737438405215.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/72072iA8C2511094E85F2A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_5-1737438405215.png" alt="jthi_5-1737438405215.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And here is one more formula option using Lag (this assumes you want either characters or that you have numeric X column)&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;If(Mod(Row(), 5) == 0,
	:X
,
	Lag(:X, -1*(5 - Mod(Row(), 5)))
)&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 21 Jan 2025 05:51:55 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Help-How-should-I-set-a-formula-or-JSL-to-implement-this/m-p/828362#M101015</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2025-01-21T05:51:55Z</dc:date>
    </item>
  </channel>
</rss>

