<?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 Calculating averages within a Data Tabe in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Calculating-averages-within-a-Data-Tabe/m-p/254896#M50048</link>
    <description>&lt;P&gt;I am hoping to get some help with calculating averages within a table. I have to be able to calculate the averages of a given input ranges for each of the tests and then create a new column that holds the averages so that I can plot them.&amp;nbsp; test_1 and test_3 have two (2) band averages and test_3 has three (3) band averages&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;test_1:&lt;/P&gt;&lt;P&gt;BAND_1 = Average( 8 - 11 )&lt;/P&gt;&lt;P&gt;BAND_2 = Average (14.5 - 17.5 )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;test_3:&lt;/P&gt;&lt;P&gt;BAND_1 = Average( 8 - 11 )&lt;/P&gt;&lt;P&gt;BAND_2 = Average (14.5 - 17.5 )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;test_2:&lt;/P&gt;&lt;P&gt;BAND_1 = Average( 8 - 10 )&lt;/P&gt;&lt;P&gt;BAND_2 = Average( 8 - 11 )&lt;/P&gt;&lt;P&gt;BAND_3 = Average (14.5 - 17.5 )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I attached a data table as an example of how the data looks currently ( columns 1 - 7 )&lt;/P&gt;&lt;P&gt;columns 8 - 10 was are the averages of the inputs i did manually in Excel&lt;/P&gt;&lt;P&gt;column 11 - 13 were done in Excel as well they are the values of the averages of that specific band&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a data table with following information&lt;/P&gt;&lt;P&gt;RowCol-Chnl-PartNo = Unique Identifier&lt;/P&gt;&lt;P&gt;Mode = Test ModeQ&lt;/P&gt;&lt;P&gt;TesState = Test StateQA&lt;/P&gt;&lt;P&gt;input = test input&lt;/P&gt;&lt;P&gt;test_1 / test_2 / test_3 = output data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
    <pubDate>Sun, 29 Mar 2020 13:53:45 GMT</pubDate>
    <dc:creator>Yngeinstn</dc:creator>
    <dc:date>2020-03-29T13:53:45Z</dc:date>
    <item>
      <title>Calculating averages within a Data Tabe</title>
      <link>https://community.jmp.com/t5/Discussions/Calculating-averages-within-a-Data-Tabe/m-p/254896#M50048</link>
      <description>&lt;P&gt;I am hoping to get some help with calculating averages within a table. I have to be able to calculate the averages of a given input ranges for each of the tests and then create a new column that holds the averages so that I can plot them.&amp;nbsp; test_1 and test_3 have two (2) band averages and test_3 has three (3) band averages&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;test_1:&lt;/P&gt;&lt;P&gt;BAND_1 = Average( 8 - 11 )&lt;/P&gt;&lt;P&gt;BAND_2 = Average (14.5 - 17.5 )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;test_3:&lt;/P&gt;&lt;P&gt;BAND_1 = Average( 8 - 11 )&lt;/P&gt;&lt;P&gt;BAND_2 = Average (14.5 - 17.5 )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;test_2:&lt;/P&gt;&lt;P&gt;BAND_1 = Average( 8 - 10 )&lt;/P&gt;&lt;P&gt;BAND_2 = Average( 8 - 11 )&lt;/P&gt;&lt;P&gt;BAND_3 = Average (14.5 - 17.5 )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I attached a data table as an example of how the data looks currently ( columns 1 - 7 )&lt;/P&gt;&lt;P&gt;columns 8 - 10 was are the averages of the inputs i did manually in Excel&lt;/P&gt;&lt;P&gt;column 11 - 13 were done in Excel as well they are the values of the averages of that specific band&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a data table with following information&lt;/P&gt;&lt;P&gt;RowCol-Chnl-PartNo = Unique Identifier&lt;/P&gt;&lt;P&gt;Mode = Test ModeQ&lt;/P&gt;&lt;P&gt;TesState = Test StateQA&lt;/P&gt;&lt;P&gt;input = test input&lt;/P&gt;&lt;P&gt;test_1 / test_2 / test_3 = output data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Sun, 29 Mar 2020 13:53:45 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Calculating-averages-within-a-Data-Tabe/m-p/254896#M50048</guid>
      <dc:creator>Yngeinstn</dc:creator>
      <dc:date>2020-03-29T13:53:45Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating averages within a Data Tabe</title>
      <link>https://community.jmp.com/t5/Discussions/Calculating-averages-within-a-Data-Tabe/m-p/254913#M50050</link>
      <description>&lt;P&gt;I have recreated your table using formulas for each of your columns 8-13.&amp;nbsp; These are based upon a hidden column I created, called "Band".&amp;nbsp; You can examine each of the formulas to see how I created them.&lt;/P&gt;
&lt;P&gt;There is an issue.&amp;nbsp; In your entry, you treat test 2 differently, in that you specify 3 Bands, but in your sample data table, your Excel created output only shows 2 bands.&amp;nbsp; Additionally, the Bands are overlapping in definition.&amp;nbsp; I don't understand how you intend to handle this.&amp;nbsp; Is your thinking, that rows that have input values of 8-10 will have averages in your Final avg columns, just based on 8-10, and if a row has a value of 10.25-11 that it would have an average of 8-11 rows?&lt;/P&gt;
&lt;P&gt;The Base Table2, has a guess as to how the 3 band levels for test3 are. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;See the attached data tables for my response so far&lt;/P&gt;</description>
      <pubDate>Sun, 29 Mar 2020 19:41:36 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Calculating-averages-within-a-Data-Tabe/m-p/254913#M50050</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-03-29T19:41:36Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating averages within a Data Tabe</title>
      <link>https://community.jmp.com/t5/Discussions/Calculating-averages-within-a-Data-Tabe/m-p/254988#M50069</link>
      <description>&lt;P&gt;Thank you &lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687"&gt;@txnelson&lt;/a&gt;. I am looking over this right now.. Yes, unfortunately test_2 has to be treated differently. If you look closely when the mode = Tx only, you will see 3 bands 8-10 (average number @ input 10), 10 - 11 (average number @ input 11) and 14.5 - 17.5 (average number @ input 17.5),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;test_2 when mode = Rx it is the same as test_1 and test_3. 2 bands 8-11 (average number @ input 11) and 14.5 - 17.5 (average number @ input 17.5)&lt;/P&gt;&lt;P&gt;I am having the most difficulty with that test_2 @ mode = Tx&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;New Column( "band",
	numeric,
	Formula(
		If( 
			8 &amp;lt;= :input &amp;lt;= 11, 11,
			14.5 &amp;lt;= :input &amp;lt;= 17.5, 17.5,
			.
		)
	)
);

New Column( "band3",
	numeric,
	Formula(
		If( 
			8 &amp;lt;= :input &amp;lt;= 10 &amp;amp; :mode == "Tx", 10,
			10 &amp;lt; :input &amp;lt;= 11 &amp;amp; :mode == "Tx", 11,
			8 &amp;lt;= :input &amp;lt;= 11 &amp;amp; :mode == "Rx", 11,
			14.5 &amp;lt;= :input &amp;lt;= 17.5, 17.5,
			.
		)
	)
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Mar 2020 13:35:12 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Calculating-averages-within-a-Data-Tabe/m-p/254988#M50069</guid>
      <dc:creator>Yngeinstn</dc:creator>
      <dc:date>2020-03-30T13:35:12Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating averages within a Data Tabe</title>
      <link>https://community.jmp.com/t5/Discussions/Calculating-averages-within-a-Data-Tabe/m-p/255019#M50070</link>
      <description>&lt;P&gt;I modified your formulas and added another band column. This populated the columns correctly..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;New Column( "band1",
	numeric,
	Formula(
		If( 
			8 &amp;lt;= :input &amp;lt;= 11, 11,
			14.5 &amp;lt;= :input &amp;lt;= 17.5, 17.5,
			.
		)
	)
);

New Column( "band2",
	numeric,
	Formula(
		If( 
			8 &amp;lt;= :input &amp;lt;= 10 &amp;amp; :mode == "Tx", 10,
			.
		)
	)
);

New Column( "band3",
	numeric,
	Formula(
		If( 
			10 &amp;lt;= :input &amp;lt;= 11 &amp;amp; :mode == "Tx", 11,
			.
		)
	)
);

New Column( "AvgS11M",
	Numeric,
	Formula(
		If( :band1 == :input,
			Col Mean(
				:test_1,
				:Name( "RowCol-Chnl-PartNo" ),
				:mode,
				:teststate,
				:band1
			),
			.
		)
	)
);

New Column( "AvgS22M", 
	Numeric,
	Formula(
		If( :band1 == :input,
			Col Mean(
				:test_3,
				:Name( "RowCol-Chnl-PartNo" ),
				:mode,
				:teststate,
				:band1
			),
			.
		)
	)
);

New Column( "AvgS21M",
	Numeric,
	Formula(
		If( 
			mode == "Rx" &amp;amp; :band1 == :input,  Col Mean( :test_2, :Name( "RowCol-Chnl-PartNo" ), :mode, :teststate, :band1 ),
			mode == "Tx" &amp;amp; :band2 == :input,  Col Mean( :test_2, :Name( "RowCol-Chnl-PartNo" ), :mode, :teststate, :band2 ),	
			mode == "Tx" &amp;amp; :band3 == :input,  Col Mean( :test_2, :Name( "RowCol-Chnl-PartNo" ), :mode, :teststate, :band3 ),		
			.
		)
	)
);


New Column( "S11M_AVG",
	Numeric,
	Formula(
		If( Is Missing( :Band1 ) == 0,
			Col Mean(
				:test_1,
				:Name( "RowCol-Chnl-PartNo" ),
				:mode,
				:teststate,
				:band1
			),
			.
		)
	)
);

New Column( "S22M_AVG",
	Numeric,
	Formula(
		If( Is Missing( :Band1 ) == 0,
			Col Mean(
				:test_3,
				:Name( "RowCol-Chnl-PartNo" ),
				:mode,
				:teststate,
				:band1
			),
			.
		)
	)
);

New Column( "S21M_AVG",
	Numeric,
	Formula(
		If( 
			mode == "Rx" &amp;amp; Is Missing( :Band1 ) == 0, Col Mean( :test_2, :Name( "RowCol-Chnl-PartNo" ), :mode, :teststate, :band1 ),
			mode == "Tx" &amp;amp; Is Missing( :Band2 ) == 0, Col Mean( :test_2, :Name( "RowCol-Chnl-PartNo" ), :mode, :teststate, :band2 ),
			mode == "Tx" &amp;amp; Is Missing( :Band3 ) == 0, Col Mean( :test_2, :Name( "RowCol-Chnl-PartNo" ), :mode, :teststate, :band3 ),
			.
			
		)
	)
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Mar 2020 14:02:21 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Calculating-averages-within-a-Data-Tabe/m-p/255019#M50070</guid>
      <dc:creator>Yngeinstn</dc:creator>
      <dc:date>2020-03-30T14:02:21Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating averages within a Data Tabe</title>
      <link>https://community.jmp.com/t5/Discussions/Calculating-averages-within-a-Data-Tabe/m-p/255031#M50073</link>
      <description>&lt;P&gt;Nice job...….I am glad I could help.....sorry that I didn't see the Tx vs. Rx requirement in your data for the test2.....&lt;/P&gt;</description>
      <pubDate>Mon, 30 Mar 2020 14:34:15 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Calculating-averages-within-a-Data-Tabe/m-p/255031#M50073</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-03-30T14:34:15Z</dc:date>
    </item>
  </channel>
</rss>

