cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Browse apps to extend the software in the new JMP Marketplace
Choose Language Hide Translation Bar
Ressel
Level VI

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 VI

Re: Weighted average with varying row numbers

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