cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Discussions

Solve problems, and share tips and tricks with other JMP users.
%3CLINGO-SUB%20id%3D%22lingo-sub-357643%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%E4%B8%8D%E5%90%8C%E8%A1%8C%E6%95%B8%E7%9A%84%E5%8A%A0%E6%AC%8A%E5%B9%B3%E5%9D%87%E5%80%BC%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-357643%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3E%E6%88%91%E6%89%BE%E5%88%B0%E4%BA%86%E6%8B%9C%E5%80%AB%E7%9A%84%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2FJMP-Blog%2FEasy-moving-average-using-Summation-function%2Fba-p%2F30277%22%20target%3D%22_self%22%3E%E5%BE%88%E5%A5%BD%E7%9A%84%E4%BE%8B%E5%AD%90%3C%2FA%3E%E7%A7%BB%E5%8B%95%E5%B9%B3%E5%9D%87%E5%87%BD%E6%95%B8%EF%BC%8C%E4%BD%86%E6%88%91%E7%84%A1%E6%B3%95%E5%B0%87%E5%85%B6%E5%AF%A6%E7%8F%BE%E5%88%B0%E6%88%91%E8%87%AA%E5%B7%B1%E7%9A%84%E6%95%B8%E6%93%9A%E8%A1%A8%E4%B8%AD%E3%80%82%20%E5%9C%A8%E6%88%91%E7%9A%84%E8%A1%A8%E6%A0%BC%E4%B8%AD%EF%BC%8C%E6%88%91%E5%88%97%E5%87%BA%E4%BA%86%E7%94%B1%E4%B8%8D%E5%90%8C%E6%95%B8%E9%87%8F%E7%9A%84%E5%82%B3%E5%85%A5%E5%8E%9F%E6%9D%90%E6%96%99%E6%89%B9%E6%AC%A1%E7%B5%84%E6%88%90%E7%9A%84%E6%9C%80%E7%B5%82%E7%94%A2%E5%93%81%E6%89%B9%E6%AC%A1%E3%80%82%20%E6%AF%8F%E5%80%8B%E5%8E%9F%E6%9D%90%E6%96%99%E6%89%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E3%80%82%20%E6%88%91%E9%82%84%E5%B0%87%E8%A9%B2%E8%A1%A8%E6%A0%BC%E9%99%84%E5%8A%A0%E5%88%B0%E9%80%99%E7%AF%87%E6%96%87%E7%AB%A0%E4%B8%AD%EF%BC%88%E8%AB%8B%E9%9A%A8%E6%99%82%E5%90%91%E6%88%91%E5%B1%95%E7%A4%BA%E5%A6%82%E4%BD%95%E7%9B%B4%E6%8E%A5%E5%9C%A8%E6%9C%AC%E5%B0%88%E6%AC%84%E4%B8%AD%E8%AA%BF%E6%95%B4%E6%B1%82%E5%92%8C%E3%80%82%20%E6%8F%90%E5%89%8D%E9%9D%9E%E5%B8%B8%E6%84%9F%E8%AC%9D%E6%82%A8%E3%80%82%EF%BC%89%E3%80%82%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Presentation2.jpg%22%20style%3D%22width%3A%20999px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Presentation2.jpg%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Presentation2.jpg%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F30138i6CFB070F8EE6A136%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Presentation2.jpg%22%20alt%3D%22Presentation2.jpg%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-357643%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CLINGO-LABEL%3E%E9%AB%98%E7%B4%9A%E7%B5%B1%E8%A8%88%E5%BB%BA%E6%A8%A1%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3E%E5%A4%A7%E8%A6%8F%E6%A8%A1%E5%AE%9A%E5%88%B6%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-357740%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%E5%9B%9E%E5%A4%8D%EF%BC%9A%E4%B8%8D%E5%90%8C%E8%A1%8C%E6%95%B8%E7%9A%84%E5%8A%A0%E6%AC%8A%E5%B9%B3%E5%9D%87%E5%80%BC%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-357740%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%E5%81%89%E5%A4%A7%E7%9A%84%EF%BC%81%20%E8%AC%9D%E8%AC%9D%20-%20%E9%80%99%E6%AD%A3%E6%98%AF%E6%88%91%E6%89%80%E9%9C%80%E8%A6%81%E7%9A%84%EF%BC%81%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-357734%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%E5%9B%9E%E5%A4%8D%EF%BC%9A%E4%B8%8D%E5%90%8C%E8%A1%8C%E6%95%B8%E7%9A%84%E5%8A%A0%E6%AC%8A%E5%B9%B3%E5%9D%87%E5%80%BC%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-357734%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3E%E6%88%91%E4%B8%8D%E5%A4%AA%E7%A2%BA%E5%AE%9A%E9%80%99%E6%98%AF%E5%90%A6%E6%98%AF%E6%82%A8%E7%9A%84%E6%84%8F%E6%80%9D%EF%BC%8C%E4%BD%86%E5%9C%A8%E5%85%AC%E5%BC%8F%E7%B7%A8%E8%BC%AF%E5%99%A8%E4%B8%AD%E7%9A%84%E7%B5%B1%E8%A8%88%E5%88%86%E7%B5%84%E4%B8%8B%E6%89%BE%E5%88%B0%E7%9A%84%20Col%20%E5%87%BD%E6%95%B8%E5%8F%AF%E8%83%BD%E6%9C%83%E6%9C%89%E6%89%80%E5%B9%AB%E5%8A%A9%E3%80%82%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3ECol%20Sum(%0A%20%3AName(%22Concentration%20of%20some%20component%20in%20raw%20material%20batch%20%5B%25%5D%22)%20*%0A%20%3AName(%22Weight%20of%20Ingoing%20raw%20material%20batch%20%5Bkg%5D%22)%2C%0A%20%3AFinal%20product%20batch%0A)%20%2F%20Col%20Sum(%3AName(%22Weight%20of%20Ingoing%20raw%20material%20batch%20%5Bkg%5D%22)%2C%20%3AFinal%20product%20batch)%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22jthi_0-1612936870493.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22jthi_0-1612936870493.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22jthi_0-1612936870493.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F30147iC3F30EA7EF1A8A4B%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22jthi_0-1612936870493.png%22%20alt%3D%22jthi_0-1612936870493.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22jthi_1-1612936880217.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22jthi_1-1612936880217.png%22%20style%3D%22width%3A%20302px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22jthi_1-1612936880217.png%22%20style%3D%22width%3A%20302px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F30148iF53D6290811041DD%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22jthi_1-1612936880217.png%22%20alt%3D%22jthi_1-1612936880217.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
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