cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Sign-in to the JMP Community will be unavailable intermittently Dec. 6-7 due to a system update. Thank you for your understanding!
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.
  • JMP 19 is here! Learn more about the new features.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
Ressel
Level VII

Weighted average with varying row numbers

I found Byron's great example of the moving average function, but am having trouble implementing this into a data table of my own. In my table I have listed final product batches that are composes of a varying number of ingoing raw material batches. Each of the raw material batches contains a component at some concentration level and different quantities of the raw material batches are combined into a single final product batch. What I want to do is to calculate a weighted average concentration of the component in the ingoing raw material batches. To make this a little clearer I have color coded the fields for the weighted average in the screenshot below. Each color represents a single, weighted average representative of the final product batch. I have also attached the table to this posting (feel free to show me how to tweak summation directly in this column. Thank you very much in advance.).

 

Presentation2.jpg

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: Weighted average with varying row numbers

I'm not exactly sure if this is what you mean but Col functions found under Statistical grouping in Formula editor might help.

 

Col Sum(
	:Name("Concentration of some component in raw material batch [%]") *
	:Name("Weight of Ingoing raw material batch [kg]"),
	:Final product batch
) / Col Sum(:Name("Weight of Ingoing raw material batch [kg]"), :Final product batch)

jthi_0-1612936870493.png

jthi_1-1612936880217.png

 

 

-Jarmo

View solution in original post

2 REPLIES 2
jthi
Super User

Re: Weighted average with varying row numbers

I'm not exactly sure if this is what you mean but Col functions found under Statistical grouping in Formula editor might help.

 

Col Sum(
	:Name("Concentration of some component in raw material batch [%]") *
	:Name("Weight of Ingoing raw material batch [kg]"),
	:Final product batch
) / Col Sum(:Name("Weight of Ingoing raw material batch [kg]"), :Final product batch)

jthi_0-1612936870493.png

jthi_1-1612936880217.png

 

 

-Jarmo
Ressel
Level VII

Re: Weighted average with varying row numbers

Great! Thank you - this was precisely what I needed!

Recommended Articles