<?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: Formula for change over time in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Formula-for-change-over-time/m-p/809633#M99061</link>
    <description>&lt;P&gt;Here is a formula that finds the first percent shift, and then goes through all of the remaining columns and finds and values and does a percent change from the initial value, and if it is a negative change &amp;gt; 20% it sets the result to a 1.&lt;/P&gt;
&lt;P&gt;I am pretty sure it isn't exactly what you are looking for.&amp;nbsp; I don't understand what "&lt;SPAN&gt;&amp;nbsp;and then assess all following reading back against the first and the previous reading to access shift overtime" precisely means.&amp;nbsp; Study my code and see what it is doing, and then see if you can change it to do exactly what your really want.&amp;nbsp; If not, respond back with some clarification or questions about my JSL.&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;As Constant( dt = Current Data Table() );
theMatrix = dt[Row(), Index( 2, 23 )];
start = Loc( theMatrix )[1] + 1;
startVal = dt[Row(), start];
firstChange = .;
currentChange = .;
firstValue = .;
For( i = start, i &amp;lt;= 22, i++,
	If(
		Is Missing( dt[Row(), i] ) == 0 &amp;amp; Is Missing( firstValue ) == 1, firstValue = dt[Row(), i],
		Is Missing( dt[Row(), i] ) == 0 &amp;amp; Is Missing( firstChange ) == 1,
			firstChange = (dt[Row(), i] - firstValue) / firstValue,
		Is Missing( dt[Row(), i] ) == 0 &amp;amp; Is Missing( firstChange ) == 0,
			currentChange = (dt[Row(), i] - firstValue) / firstValue;
			If( currentChange &amp;lt; -0.2,
				currentChange = 1;
				break(),
				currentChange = .
			);
	)
);
currentChange;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 05 Nov 2024 04:01:54 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2024-11-05T04:01:54Z</dc:date>
    <item>
      <title>Formula for change over time</title>
      <link>https://community.jmp.com/t5/Discussions/Formula-for-change-over-time/m-p/809580#M99045</link>
      <description>&lt;P&gt;Looking for a formula to access change over time at a row level moving from left to right i want to assess the percent shift from the 1st reading to the next and then assess all following reading back against the first and the previous reading to access shift overtime. If any are downward shifts greater than or equal to 20% indicate a 1 in a result column.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Nov 2024 17:37:46 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Formula-for-change-over-time/m-p/809580#M99045</guid>
      <dc:creator>DELANDJ1985</dc:creator>
      <dc:date>2024-11-04T17:37:46Z</dc:date>
    </item>
    <item>
      <title>Re: Formula for change over time</title>
      <link>https://community.jmp.com/t5/Discussions/Formula-for-change-over-time/m-p/809633#M99061</link>
      <description>&lt;P&gt;Here is a formula that finds the first percent shift, and then goes through all of the remaining columns and finds and values and does a percent change from the initial value, and if it is a negative change &amp;gt; 20% it sets the result to a 1.&lt;/P&gt;
&lt;P&gt;I am pretty sure it isn't exactly what you are looking for.&amp;nbsp; I don't understand what "&lt;SPAN&gt;&amp;nbsp;and then assess all following reading back against the first and the previous reading to access shift overtime" precisely means.&amp;nbsp; Study my code and see what it is doing, and then see if you can change it to do exactly what your really want.&amp;nbsp; If not, respond back with some clarification or questions about my JSL.&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;As Constant( dt = Current Data Table() );
theMatrix = dt[Row(), Index( 2, 23 )];
start = Loc( theMatrix )[1] + 1;
startVal = dt[Row(), start];
firstChange = .;
currentChange = .;
firstValue = .;
For( i = start, i &amp;lt;= 22, i++,
	If(
		Is Missing( dt[Row(), i] ) == 0 &amp;amp; Is Missing( firstValue ) == 1, firstValue = dt[Row(), i],
		Is Missing( dt[Row(), i] ) == 0 &amp;amp; Is Missing( firstChange ) == 1,
			firstChange = (dt[Row(), i] - firstValue) / firstValue,
		Is Missing( dt[Row(), i] ) == 0 &amp;amp; Is Missing( firstChange ) == 0,
			currentChange = (dt[Row(), i] - firstValue) / firstValue;
			If( currentChange &amp;lt; -0.2,
				currentChange = 1;
				break(),
				currentChange = .
			);
	)
);
currentChange;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 05 Nov 2024 04:01:54 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Formula-for-change-over-time/m-p/809633#M99061</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2024-11-05T04:01:54Z</dc:date>
    </item>
  </channel>
</rss>

