cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
%3CLINGO-SUB%20id%3D%22lingo-sub-739077%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ECol%20Cumulative%20Sum%20%E4%B8%8D%E8%B0%83%E7%94%A8%E5%BD%93%E5%89%8D%E8%A1%8C%E7%9A%84%E5%80%BC%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-739077%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E6%82%A8%E5%A5%BD%EF%BC%8C%E6%88%91%E5%AF%B9%E7%BC%96%E5%86%99%20JMP%20%E8%84%9A%E6%9C%AC%E8%BF%98%E5%BE%88%E9%99%8C%E7%94%9F%EF%BC%8C%E4%B8%BB%E8%A6%81%E5%9C%A8%E5%B7%A5%E4%BD%9C%E4%B8%AD%E4%BD%BF%E7%94%A8%E2%80%9C%E7%BC%96%E8%BE%91%E5%85%AC%E5%BC%8F%E2%80%9D%E3%80%82%E6%88%91%E4%B8%80%E7%9B%B4%E5%9C%A8%E6%B5%8F%E8%A7%88%E4%B8%8E%3CSTRONG%3ECol%20Cumulative%20Sum%3C%2FSTRONG%3E%E7%9B%B8%E5%85%B3%E7%9A%84%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88%EF%BC%8C%E4%BD%86%E6%89%BE%E4%B8%8D%E5%88%B0%E9%80%82%E5%90%88%E6%88%91%E7%9A%84%E5%85%B7%E4%BD%93%E9%97%AE%E9%A2%98%E7%9A%84%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88%E3%80%82%E6%88%91%E7%9A%84%E6%95%B0%E6%8D%AE%E8%A1%A8%E7%9A%84%E7%AE%80%E5%8C%96%E7%89%88%E6%9C%AC%E5%A6%82%E4%B8%8B%E3%80%82%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CTABLE%20border%3D%221%22%3E%3CTBODY%3E%3CTR%3E%3CTD%3E%3CSTRONG%3E%E6%8E%92%3C%2FSTRONG%3E%3C%2FTD%3E%3CTD%3E%3CSTRONG%3E%E6%98%9F%E6%9C%9F%3C%2FSTRONG%3E%3C%2FTD%3E%3CTD%3E%3CSTRONG%3ECol%20Cumulative%20Sum%3C%2FSTRONG%3E%3C%2FTD%3E%3CTD%3E%3CSTRONG%3E%E6%88%91%E7%9A%84%E5%B8%8C%E6%9C%9B%3C%2FSTRONG%3E%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3E1%3C%2FTD%3E%3CTD%3E1%3C%2FTD%3E%3CTD%3E1%3C%2FTD%3E%3CTD%3E0%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3E2%3C%2FTD%3E%3CTD%3E2%3C%2FTD%3E%3CTD%3E3%3C%2FTD%3E%3CTD%3E1%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3E3%3C%2FTD%3E%3CTD%3E3%3C%2FTD%3E%3CTD%3E6%3C%2FTD%3E%3CTD%3E3%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3E4%3C%2FTD%3E%3CTD%3E4%3C%2FTD%3E%3CTD%3E10%3C%2FTD%3E%3CTD%3E6%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3E5%3C%2FTD%3E%3CTD%3E5%3C%2FTD%3E%3CTD%3E15%3C%2FTD%3E%3CTD%3E10%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3E6%3C%2FTD%3E%3CTD%3E6%3C%2FTD%3E%3CTD%3E21%3C%2FTD%3E%3CTD%3E15%3C%2FTD%3E%3C%2FTR%3E%3C%2FTBODY%3E%3C%2FTABLE%3E%3CP%3E%20%3C%2FP%3E%3CP%3E%E5%A6%82%E6%9E%9C%E2%80%9C%E5%91%A8%E2%80%9D%E7%9A%84%E5%BD%93%E5%89%8D%E8%A1%8C%E5%80%BC%E6%98%AF%E5%9B%BA%E5%AE%9A%E7%9A%84%E6%88%96%E8%80%85%E5%A6%82%E6%9E%9C%E6%88%91%E6%9C%89%E4%B8%A4%E4%B8%AA%E5%8D%95%E7%8B%AC%E7%9A%84%E5%88%97%E2%80%9C%E5%91%A8%E2%80%9D%E5%92%8C%E2%80%9C%E6%88%91%E7%9A%84%E6%84%BF%E6%9C%9B%E2%80%9D%EF%BC%8C%E5%88%99%E4%B8%8B%E9%9D%A2%E7%9A%84%E5%85%AC%E5%BC%8F%E6%9C%89%E6%95%88%E3%80%82%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3EIf(%20Row()%20!%3D%201%2C%0A%09Lag(%20Col%20Cumulative%20Sum(%20%3AWeek%20)%2C%201%20)%2C%0A%090%0A)%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%20%3C%2FP%3E%3CP%3E%E9%97%AE%E9%A2%98%E6%98%AF%E5%89%8D%E4%B8%80%E8%A1%8C%E7%9A%84%E2%80%9C%E5%91%A8%E2%80%9D%E5%80%BC%E6%98%AF%E5%9B%BA%E5%AE%9A%E7%9A%84%EF%BC%8C%E4%BD%86%E5%BD%93%E5%89%8D%E8%A1%8C%E7%9A%84%E5%80%BC%E4%B8%8D%E6%98%AF%E3%80%82%E8%80%8C%E4%B8%94%E6%88%91%E5%8F%AA%E6%9C%89%E4%B8%80%E5%88%97%E2%80%9C%E5%91%A8%E2%80%9D%E5%8F%AF%E4%BB%A5%E4%BD%BF%E7%94%A8%E3%80%82%E6%88%91%E6%AD%A3%E5%9C%A8%E5%BC%80%E5%8F%91%E4%B8%80%E4%B8%AA%E5%85%AC%E5%BC%8F%EF%BC%8C%E6%A0%B9%E6%8D%AE%E4%B8%8A%E4%B8%80%E4%B8%AA%E6%A8%A1%E6%8B%9F%E5%80%BC%E6%A8%A1%E6%8B%9F%E8%BF%9B%E5%B1%95%E3%80%82%E6%88%91%E6%AD%A3%E5%9C%A8%E6%A0%B9%E6%8D%AE%E5%89%8D%E4%B8%80%E8%A1%8C%E7%9A%84%E5%80%BC%E6%A8%A1%E6%8B%9F%E5%BD%93%E5%89%8D%E8%A1%8C%E7%9A%84%E2%80%9C%E5%91%A8%E2%80%9D%E5%80%BC%E3%80%82%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3E%E5%81%87%E8%AE%BE%E6%88%91%E6%AD%A3%E5%9C%A8%E5%A4%84%E7%90%86%E2%80%9C%E5%91%A8%E2%80%9D%E5%88%97%E4%B8%AD%E7%9A%84%E7%AC%AC%204%20%E8%A1%8C%E3%80%82%E6%88%91%E6%83%B3%E7%B4%AF%E7%A7%AF%E6%89%80%E6%9C%89%E4%BB%A5%E5%89%8D%E7%9A%84%E2%80%9C%E5%91%A8%E2%80%9D%E5%80%BC%E7%9A%84%E6%80%BB%E5%92%8C%EF%BC%8C%E8%80%8C%E4%B8%8D%E8%B0%83%E7%94%A8%E5%87%BD%E6%95%B0%E4%B8%AD%E5%BD%93%E5%89%8D%E7%9A%84%E2%80%9C%E5%91%A8%E2%80%9D%E5%80%BC%E3%80%82%E5%90%A6%E5%88%99%EF%BC%8C%E5%9C%A8%E6%88%91%E7%9A%84%E4%BE%8B%E5%AD%90%E4%B8%AD%EF%BC%8C%E5%AE%83%E4%BC%9A%E4%BA%A7%E7%94%9F%E9%9D%9E%E6%B3%95%E5%BC%95%E7%94%A8%E6%88%96%E5%BE%AA%E7%8E%AF%E9%97%AE%E9%A2%98%E3%80%82%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3E%E6%88%91%E5%B0%9D%E8%AF%95%E4%BD%BF%E7%94%A8%E4%B8%8B%E6%A0%87%E8%80%8C%E4%B8%8D%E6%98%AF%E6%BB%9E%E5%90%8E%EF%BC%8C%E5%9B%A0%E4%B8%BA%E6%BB%9E%E5%90%8E%E5%87%BD%E6%95%B0%E8%B0%83%E7%94%A8%E5%BD%93%E5%89%8D%E8%A1%8C%E7%9A%84%E2%80%9C%E5%91%A8%E2%80%9D%E5%80%BC%E3%80%82%E5%AE%83%E4%B8%8D%E8%B5%B7%E4%BD%9C%E7%94%A8%E3%80%82%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3EIf(%20Row()%20!%3D%201%2C%0A%09Col%20Cumulative%20Sum(%20%3AWeek%20)%5BRow()%20-%201%5D%2C%0A%090%0A)%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%E6%88%91%E5%B8%8C%E6%9C%9B%E6%88%91%E7%9A%84%E8%A7%A3%E9%87%8A%E8%B6%B3%E5%A4%9F%E6%B8%85%E6%A5%9A%E3%80%82%E6%8F%90%E5%89%8D%E6%84%9F%E8%B0%A2%E6%82%A8%E7%9A%84%E5%AE%9D%E8%B4%B5%E6%97%B6%E9%97%B4%E5%92%8C%E4%B8%93%E4%B8%9A%E7%9F%A5%E8%AF%86%E3%80%82%E6%88%91%E4%BD%BF%E7%94%A8%20JMP%20Pro%2017%E3%80%82%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-739077%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3E%E8%87%AA%E5%8A%A8%E5%8C%96%E5%92%8C%E8%84%9A%E6%9C%AC%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3E%E9%A2%84%E6%B5%8B%E5%BB%BA%E6%A8%A1%E5%92%8C%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-739084%22%20slang%3D%22de-DE%22%20mode%3D%22CREATE%22%3E%E5%9B%9E%E5%A4%8D%EF%BC%9ACol%20Cumulative%20Sum%20%E4%B8%8D%E8%B0%83%E7%94%A8%E5%BD%93%E5%89%8D%E8%A1%8C%E7%9A%84%E5%80%BC%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-739084%22%20slang%3D%22de-DE%22%20mode%3D%22CREATE%22%3E%3CP%3E%E6%82%A8%E5%8F%AF%E4%BB%A5%E4%BB%8E%E7%B4%AF%E8%AE%A1%E9%87%91%E9%A2%9D%E4%B8%AD%E6%89%A3%E9%99%A4%E5%BD%93%E5%89%8D%E5%91%A8%E7%9A%84%E4%BB%B7%E5%80%BC%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3ECol%20Cumulative%20Sum(%3AWeek)%20-%20%3AWeek%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22jthi_0-1711447034404.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22jthi_0-1711447034404.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22jthi_0-1711447034404.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22jthi_0-1711447034404.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22jthi_0-1711447034404.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22jthi_0-1711447034404.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22jthi_0-1711447034404.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22jthi_0-1711447034404.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22jthi_0-1711447034404.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22jthi_0-1711447034404.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22jthi_0-1711447034404.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22jthi_0-1711447034404.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22jthi_0-1711447034404.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22jthi_0-1711447034404.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22jthi_0-1711447034404.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F62678iFFD58FB05EAEE2D8%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22jthi_0-1711447034404.png%22%20alt%3D%22jthi_0-1711447034404.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%20%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-747478%22%20slang%3D%22de-DE%22%20mode%3D%22CREATE%22%3E%E5%9B%9E%E5%A4%8D%EF%BC%9ACol%20Cumulative%20Sum%20%E4%B8%8D%E8%B0%83%E7%94%A8%E5%BD%93%E5%89%8D%E8%A1%8C%E7%9A%84%E5%80%BC%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-747478%22%20slang%3D%22de-DE%22%20mode%3D%22CREATE%22%3E%3CP%3E%E6%82%A8%E5%A5%BD%EF%BC%8C%E6%88%91%E9%80%9A%E8%BF%87%E8%AE%BA%E5%9D%9B%E5%92%8C%E8%A7%82%E7%9C%8B%E8%AE%B2%E5%BA%A7%E8%A7%86%E9%A2%91%E5%AD%A6%E5%88%B0%E4%BA%86%E5%BE%88%E5%A4%9A%E6%9C%89%E5%85%B3%E7%BC%96%E5%86%99%20JSL%20%E8%84%9A%E6%9C%AC%E7%9A%84%E7%9F%A5%E8%AF%86%E3%80%82%E6%88%91%E5%AF%B9%E4%BB%A5%E4%B8%8B%E8%84%9A%E6%9C%AC%E6%9C%89%E4%B8%80%E4%B8%AA%E5%90%8E%E7%BB%AD%E9%97%AE%E9%A2%98%E3%80%82%E7%AC%AC%E4%BA%8C%E8%A1%8C%E4%B9%9F%E5%BE%97%E5%88%B0%E4%BA%86%E7%9B%B8%E5%90%8C%E7%9A%84%E7%BB%93%E6%9E%9C%E3%80%82%E8%AF%B7%E9%97%AE%E6%82%A8%E4%B8%BA%E4%BB%80%E4%B9%88%E9%80%89%E6%8B%A9%E7%AC%AC%E4%B8%80%E8%A1%8C%E8%80%8C%E4%B8%8D%E6%98%AF%E7%AC%AC%E4%BA%8C%E8%A1%8C%EF%BC%9F%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3EEval(%20Eval%20Expr(%20casesMatrix%20%3D%20Expr(%20%3Acases%5Bi%20-%201%5D%20)%20)%20)%3C%2FCODE%3E%3C%2FPRE%3E%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3EEval(%20casesMatrix%20%3D%20%3Acases%5Bi%20-%201%5D%20%20)%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%E6%AD%A4%E5%A4%96%EF%BC%8C%E6%9C%89%E6%B2%A1%E6%9C%89%E5%8A%9E%E6%B3%95%E9%81%BF%E5%85%8D%E4%BF%AE%E6%94%B9%E2%80%9CR%E2%80%9D%E5%88%97%E5%B9%B6%E4%BF%9D%E7%95%99%E5%8E%9F%E5%A7%8B%E5%80%BC%EF%BC%9F%E6%88%91%E5%B8%8C%E6%9C%9B%E4%BF%AE%E6%94%B9%E5%90%8E%E7%9A%84%20R%20%E5%80%BC%E4%BF%9D%E7%95%99%E5%9C%A8%E2%80%9CCases%E2%80%9D%E5%88%97%E4%B8%AD%E8%80%8C%E4%B8%8D%E5%87%BA%E7%8E%B0%E5%9C%A8%E4%BB%BB%E4%BD%95%E5%9C%B0%E6%96%B9%E3%80%82%E6%88%91%E5%B0%9D%E8%AF%95%E4%B8%BA%E4%BF%AE%E6%94%B9%E5%90%8E%E7%9A%84%20R%20%E5%88%86%E9%85%8D%E4%B8%80%E4%B8%AA%E4%B8%8D%E5%90%8C%E7%9A%84%E5%8F%98%E9%87%8F%E5%90%8D%E2%80%9CRx%E2%80%9D%EF%BC%8C%E5%A6%82%E4%B8%8B%E6%89%80%E7%A4%BA%E3%80%82%E4%BD%86%E6%98%AF%EF%BC%8C%E8%BF%99%E7%A7%8D%E6%96%B9%E6%B3%95%E9%9C%80%E8%A6%81%E6%88%91%E5%88%9B%E5%BB%BA%E4%B8%80%E4%B8%AA%E5%90%8D%E4%B8%BA%E2%80%9CRx%E2%80%9D%E7%9A%84%E7%A9%BA%E5%88%97%E6%89%8D%E8%83%BD%E5%B7%A5%E4%BD%9C%E3%80%82%3C%2FP%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3E%3ARx%20%5Bi%5D%20%3D%20%3AR%5Bi%5D%20*%20(1%20-%20(Sum(%20casesMatrix%20)%2BcasesSum)%20*%204%20%2F%20100)%3B%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%E9%9D%9E%E5%B8%B8%E6%84%9F%E8%B0%A2%E6%82%A8%E4%BB%98%E5%87%BA%E7%9A%84%E6%97%B6%E9%97%B4%E5%92%8C%E4%B8%93%E4%B8%9A%E7%9F%A5%E8%AF%86%E3%80%82%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-739100%22%20slang%3D%22de-DE%22%20mode%3D%22CREATE%22%3E%E5%9B%9E%E5%A4%8D%EF%BC%9ACol%20Cumulative%20Sum%20%E4%B8%8D%E8%B0%83%E7%94%A8%E5%BD%93%E5%89%8D%E8%A1%8C%E7%9A%84%E5%80%BC%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-739100%22%20slang%3D%22de-DE%22%20mode%3D%22CREATE%22%3E%3CP%3E%E2%80%9C%E6%A8%A1%E6%8B%9F%E6%A1%88%E4%BE%8B%E2%80%9D%E6%98%AF%E7%9F%A9%E9%98%B5%E8%BF%98%E6%98%AF%E6%95%B0%E6%8D%AE%E8%A1%A8%E4%B8%AD%E7%9A%84%E4%B8%80%E5%88%97%EF%BC%9F%3C%2FP%3E%0A%3CP%3E%20%3C%2FP%3E%0A%3CP%3E%E6%88%91%E4%B8%8D%E6%98%8E%E7%99%BD%3C%2FP%3E%0A%3CP%3E%E6%82%A8%E7%9A%84%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88%E4%BC%BC%E4%B9%8E%E8%BF%87%E4%BA%8E%E5%A4%8D%E6%9D%82%E4%BA%86%E3%80%82%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3Esim%20cases%20%3D%20%5B3%2C5%2C2%2C8%5D%3B%0A%0Asum1%20%3D%20sum(sim%20cases)%3B%0Asum2%20%3D%20sum((%5B1%201%201%201%5D*sim%20cases)%5B1%5D)%3B%0Ashow(sum1%2Csum2)%3B%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3Esum1%20%E5%92%8C%20sum2%20%E9%83%BD%E6%8F%90%E4%BE%9B%E7%9B%B8%E5%90%8C%E7%9A%84%E5%80%BC%3C%2FP%3E%0A%3CPRE%3Esum1%20%3D%2018%3B%0Asum2%20%3D%2018%3B%3C%2FPRE%3E%0A%3CP%3E%E6%88%91%E9%BC%93%E5%8A%B1%E6%82%A8%E9%98%85%E8%AF%BB%E2%80%9C%E5%B8%AE%E5%8A%A9%E2%80%9D%E4%B8%8B%E6%8B%89%E8%8F%9C%E5%8D%95%E4%B8%8B%E7%9A%84%E2%80%9C%E5%8F%91%E7%8E%B0%20JMP%E2%80%9D%E6%96%87%E6%A1%A3%E3%80%82%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-739315%22%20slang%3D%22de-DE%22%20mode%3D%22CREATE%22%3E%E5%9B%9E%E5%A4%8D%EF%BC%9ACol%20Cumulative%20Sum%20%E4%B8%8D%E8%B0%83%E7%94%A8%E5%BD%93%E5%89%8D%E8%A1%8C%E7%9A%84%E5%80%BC%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-739315%22%20slang%3D%22de-DE%22%20mode%3D%22CREATE%22%3E%3CP%3E%E8%BF%99%E6%98%AF%E6%88%91%E7%9A%84%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88%EF%BC%8C%E4%BD%86%E5%AE%83%E4%B8%8E%E6%82%A8%E7%9A%84%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88%E4%B8%8D%E7%AC%A6%E3%80%82%E6%88%91%E8%AE%A4%E4%B8%BA%E6%82%A8%E6%98%BE%E7%A4%BA%E7%9A%84%E8%AE%A1%E7%AE%97%E5%AF%B9%E4%BA%8E%E7%AC%AC%203%20%E8%A1%8C%E4%B8%8D%E6%AD%A3%E7%A1%AE%E3%80%82%E8%AF%B7%E6%9F%A5%E7%9C%8B%E6%88%91%E7%9A%84%E8%84%9A%E6%9C%AC%EF%BC%8C%E5%85%B6%E4%B8%AD%E5%8C%85%E5%90%AB%E6%82%A8%E7%9A%84%E7%A4%BA%E4%BE%8B%E6%95%B0%E6%8D%AE%E8%A1%A8%E3%80%82%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3ENames%20Default%20To%20Here(%201%20)%3B%0Adt%20%3D%20New%20Table(%20%22Example%22%2C%0A%09Add%20Rows(%204%20)%2C%0A%09New%20Column(%20%22R%22%2C%0A%09%09Numeric%2C%0A%09%09%22Continuous%22%2C%0A%09%09Set%20Values(%20%5B.%2C%201.4%2C%201.67%2C%202.3%5D%20)%0A%09)%2C%0A%09New%20Column(%20%22Cases%22%2C%0A%09%09Expression%2C%0A%09%09%22None%22%2C%0A%09%09Set%20Values(%20%7B%5B1%2C%201%2C%202%2C%201%5D%2C%20Empty()%2C%20Empty()%2C%20Empty()%7D%20)%0A%09)%0A)%3B%0A%0A%2F%2F%20The%20calculation%20script%0AcasesSum%20%3D%200%3B%0AFor(i%3D2%2Ci%26lt%3B%3Dnrows(dt)%2Ci%2B%2B%2C%0A%09%09Eval(%20Eval%20Expr(%20casesMatrix%20%3D%20Expr(%20%3Acases%5Bi%20-%201%5D%20)%20)%20)%3B%0A%09%09%3AR%5Bi%5D%20%3D%20%3AR%5Bi%5D%20*%20(1%20-%20(Sum(%20casesMatrix%20)%2BcasesSum)%20*%204%20%2F%20100)%3B%0A%09%09%3ACases%5Bi%5D%20%3D%20casesMatrix%20*%20%3AR%5Bi%5D%3B%0A%09%09casesSum%20%3D%20casesSum%20%2B%20sum(casesMatrix)%3B%0A)%3B%0A%0A%0A%2F%2F%20Row%203%20R%20does%20not%20seem%20to%20be%20correct%0A%2F%2F%20I%20can%20not%20come%20up%20with%20.71%2C%20I%20come%20up%20with%20.96192%0Ashow(1.4%20*%20(1%20-%20(5%20*%204%2F100))%20)%3B%20%0Ashow(1.67%20*%20(1%20-%20(10.6%20*%204%2F100))%20)%3B%20%0A%0A%0A%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22txnelson_0-1711546109146.png%22%20style%3D%22width%3A%20839px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22txnelson_0-1711546109146.png%22%20style%3D%22width%3A%20839px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22txnelson_0-1711546109146.png%22%20style%3D%22width%3A%20839px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22txnelson_0-1711546109146.png%22%20style%3D%22width%3A%20839px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22txnelson_0-1711546109146.png%22%20style%3D%22width%3A%20839px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22txnelson_0-1711546109146.png%22%20style%3D%22width%3A%20839px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22txnelson_0-1711546109146.png%22%20style%3D%22width%3A%20839px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22txnelson_0-1711546109146.png%22%20style%3D%22width%3A%20839px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22txnelson_0-1711546109146.png%22%20style%3D%22width%3A%20839px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22txnelson_0-1711546109146.png%22%20style%3D%22width%3A%20839px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22txnelson_0-1711546109146.png%22%20style%3D%22width%3A%20839px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22txnelson_0-1711546109146.png%22%20style%3D%22width%3A%20839px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F62726iC3EF6C5210F87042%2Fimage-dimensions%2F839x263%3Fv%3Dv2%22%20width%3D%22839%22%20height%3D%22263%22%20role%3D%22button%22%20title%3D%22txnelson_0-1711546109146.png%22%20alt%3D%22txnelson_0-1711546109146.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%20%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-747595%22%20slang%3D%22de-DE%22%20mode%3D%22CREATE%22%3E%E5%9B%9E%E5%A4%8D%EF%BC%9ACol%20Cumulative%20Sum%20%E4%B8%8D%E8%B0%83%E7%94%A8%E5%BD%93%E5%89%8D%E8%A1%8C%E7%9A%84%E5%80%BC%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-747595%22%20slang%3D%22de-DE%22%20mode%3D%22CREATE%22%3E%3CP%3E%E4%BD%A0%E5%BB%BA%E8%AE%AE%E7%9A%84%E7%AC%AC%E4%BA%8C%E8%A1%8C%E5%BE%88%E6%A3%92%E3%80%82%E6%88%91%E4%BD%BF%E7%94%A8%E8%BF%99%E4%B8%AA%E8%AF%AD%E6%B3%95%E7%9A%84%E5%8E%9F%E5%9B%A0%E5%8F%AA%E6%98%AF%E5%87%BA%E4%BA%8E%E4%B8%80%E4%B8%AA%E8%80%81%E4%B9%A0%E6%83%AF%E3%80%82%3C%2FP%3E%0A%3CP%3E%20%3C%2FP%3E%0A%3CP%3E%E6%97%A0%E9%9C%80%E5%88%9B%E5%BB%BA%E7%A9%BA%E5%88%97%E5%8D%B3%E5%8F%AF%E4%BD%BF%E7%94%A8%20Rx%EF%BC%8C%E6%96%B9%E6%B3%95%E6%98%AF%E5%B0%86%E5%85%B6%E7%94%A8%E4%BD%9C%E5%86%85%E5%AD%98%E5%8F%98%E9%87%8F%E5%BC%95%E7%94%A8%E3%80%82%E4%BB%A5%E4%B8%8B%E6%98%AF%E6%89%A7%E8%A1%8C%E6%AD%A4%E6%93%8D%E4%BD%9C%E7%9A%84%E4%BB%A3%E7%A0%81%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3E%2F%2F%20The%20calculation%20script%0AcasesSum%20%3D%200%3B%0AFor(i%3D2%2Ci%26lt%3B%3Dnrows(dt)%2Ci%2B%2B%2C%0A%09%09Eval(%20%20casesMatrix%20%3D%20Expr(%20%3Acases%5Bi%20-%201%5D%20)%20)%3B%0A%09%09Rx%20%3D%20%3AR%5Bi%5D%20*%20(1%20-%20(Sum(%20casesMatrix%20)%2BcasesSum)%20*%204%20%2F%20100)%3B%0A%09%09%3ACases%5Bi%5D%20%3D%20casesMatrix%20*%20Rx%3B%0A%09%09casesSum%20%3D%20casesSum%20%2B%20sum(casesMatrix)%3B%0A)%3B%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-739088%22%20slang%3D%22de-DE%22%20mode%3D%22CREATE%22%3E%E5%9B%9E%E5%A4%8D%EF%BC%9ACol%20Cumulative%20Sum%20%E4%B8%8D%E8%B0%83%E7%94%A8%E5%BD%93%E5%89%8D%E8%A1%8C%E7%9A%84%E5%80%BC%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-739088%22%20slang%3D%22de-DE%22%20mode%3D%22CREATE%22%3E%3CP%3E%E6%88%91%E4%BC%9A%E4%BD%BF%E7%94%A8%E5%8D%95%E7%8B%AC%E7%9A%84%E5%88%97%E6%9D%A5%E9%81%BF%E5%85%8D%E5%90%84%E7%A7%8D%E9%97%AE%E9%A2%98%EF%BC%8C%E4%BD%86%E6%88%91%E4%B8%8D%E7%A1%AE%E5%AE%9A%E6%82%A8%E6%83%B3%E8%A6%81%E5%AE%9E%E7%8E%B0%E4%BB%80%E4%B9%88%EF%BC%8C%E5%9B%A0%E4%B8%BA%E6%82%A8%E7%9A%84%E7%A4%BA%E4%BE%8B%E4%B8%AD%E6%9C%89%E5%AE%8C%E6%95%B4%E7%9A%84%E6%95%B0%E6%8D%AE%E3%80%82%E5%A6%82%E6%9E%9C%20Col%20Cumulative%20Sum%20%E5%AF%B9%E6%82%A8%E4%B8%8D%E8%B5%B7%E4%BD%9C%E7%94%A8%EF%BC%88%E4%BD%BF%E7%94%A8%20Lag%20%E5%92%8C%E5%8F%98%E9%87%8F%E8%AE%A1%E7%AE%97%E5%80%BC%EF%BC%89%EF%BC%8C%E4%B9%9F%E8%AE%B8%E5%8F%AF%E4%BB%A5%E8%BF%99%E6%A0%B7%E5%81%9A%3C%2FP%3E%0A%3CP%3E%20%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3EIf(Row()%20%3D%3D%201%2C%0A%09val%20%3D%200%2C%0A%09val%20%3D%20val%20%2B%20Lag(%3AWeek)%3B%0A)%3B%0Aval%3B%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%20%3C%2FP%3E%0A%3CP%3E%20%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-739092%22%20slang%3D%22de-DE%22%20mode%3D%22CREATE%22%3E%E5%9B%9E%E5%A4%8D%EF%BC%9ACol%20Cumulative%20Sum%20%E4%B8%8D%E8%B0%83%E7%94%A8%E5%BD%93%E5%89%8D%E8%A1%8C%E7%9A%84%E5%80%BC%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-739092%22%20slang%3D%22de-DE%22%20mode%3D%22CREATE%22%3E%3CP%3E%E6%84%9F%E8%B0%A2%E6%82%A8%E5%AF%B9%E4%BD%BF%E7%94%A8%3CFONT%20color%3D%22%233366FF%22%3EIndex%3C%2FFONT%3E%E4%B8%8B%E6%A0%87%E7%9A%84%E5%BB%BA%E8%AE%AE%E3%80%82%E6%88%91%E7%8E%B0%E5%9C%A8%E9%81%87%E5%88%B0%E4%BA%86%E2%80%9C%E5%AF%B9%E8%B1%A1%E4%B8%8D%E5%8F%AF%E4%B8%8B%E6%A0%87%E2%80%9D%E7%9A%84%E9%97%AE%E9%A2%98%E3%80%82%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3E%E6%88%91%E7%9A%84%3CEM%3E%E5%91%A8%3C%2FEM%3E%E7%A4%BA%E4%BE%8B%E8%BF%87%E4%BA%8E%E7%AE%80%E5%8D%95%EF%BC%8C%E6%88%91%E6%9C%89%E4%B8%80%E4%B8%AA%204%20%E8%A1%8C%201%20%E5%88%97%E7%9A%84%E7%9F%A9%E9%98%B5%3CEM%3ESim%20Cases%3C%2FEM%3E%E6%9D%A5%E4%BB%A3%E6%9B%BF%3CEM%3E%E5%91%A8%3C%2FEM%3E%E3%80%82%E4%B8%BA%E4%BA%86%E5%B0%86%E5%85%B6%E8%BD%AC%E6%8D%A2%E4%B8%BA%E4%B8%80%E4%B8%AA%E6%B1%87%E6%80%BB%E6%95%B0%E5%80%BC%EF%BC%8C%E6%88%91%E5%B0%86%E7%9F%A9%E9%98%B5%E4%B9%98%E4%BB%A5%20%5B1%201%201%201%5D%20%E5%B9%B6%E6%B7%BB%E5%8A%A0%E4%B8%8B%E6%A0%87%20%5B%20%3CFONT%20color%3D%22%23339966%22%3E1%3C%2FFONT%3E%20%5D%E3%80%82%E7%84%B6%E5%90%8E%E6%98%AF%3CFONT%20color%3D%22%233366FF%22%3EIndex%3C%2FFONT%3E%E4%B8%8B%E6%A0%87%E3%80%82%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3ESum(%20(%5B1%201%201%201%5D%20*%20%3ASim%20Cases)%5B1%5D%5BIndex(%201%2C%20Row()%20-%201%20)%5D%20)%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%E6%88%91%E8%AE%A4%E4%B8%BA%E5%8E%9F%E5%A7%8B%204x1%20%E7%9F%A9%E9%98%B5%E7%9A%84%E7%BB%93%E6%9E%9C%E6%95%B0%E5%80%BC%E4%B8%8D%E6%8E%A5%E5%8F%97%20%5B%20%3CFONT%20color%3D%22%23339966%22%3E1%3C%2FFONT%3E%20%5D%20%E4%B9%8B%E5%90%8E%E7%9A%84%E4%BB%BB%E4%BD%95%E4%B8%8B%E6%A0%87%E3%80%82%E6%88%96%E8%80%85%E5%8F%AF%E8%83%BD%E6%98%AF%E5%9B%A0%E4%B8%BA%E5%86%8D%E6%AC%A1%E5%87%BA%E7%8E%B0%E9%9D%9E%E6%B3%95%E5%BC%95%E7%94%A8%EF%BC%88%E9%80%92%E5%BD%92%EF%BC%89%E3%80%82%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-739096%22%20slang%3D%22de-DE%22%20mode%3D%22CREATE%22%3E%E5%9B%9E%E5%A4%8D%EF%BC%9ACol%20Cumulative%20Sum%20%E4%B8%8D%E8%B0%83%E7%94%A8%E5%BD%93%E5%89%8D%E8%A1%8C%E7%9A%84%E5%80%BC%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-739096%22%20slang%3D%22de-DE%22%20mode%3D%22CREATE%22%3E%3CP%3E%E6%98%AF%E7%9A%84%EF%BC%8C%E8%B5%B7%E5%88%9D%EF%BC%8C%E6%88%91%E5%B0%9D%E8%AF%95%E5%9C%A8%20JMP%20%E6%95%B0%E6%8D%AE%E8%A1%A8%E4%B8%AD%E6%A8%A1%E6%8B%9F%E6%88%91%E5%9C%A8%20Excel%20%E7%94%B5%E5%AD%90%E8%A1%A8%E6%A0%BC%E4%B8%AD%E9%80%9A%E5%B8%B8%E6%89%80%E5%81%9A%E7%9A%84%E6%93%8D%E4%BD%9C%EF%BC%8C%E5%8D%B3%E9%80%9A%E8%BF%87%E5%88%86%E9%9A%94%E5%88%97%E3%80%82%E7%84%B6%E5%90%8E%EF%BC%8C%E6%88%91%E5%B0%86%E5%89%8D%E4%B8%80%E8%A1%8C%E7%9A%84%E5%80%BC%E7%A7%B0%E4%B8%BA%E4%B8%8D%E5%90%8C%E7%9A%84%E5%88%97%E3%80%82JMP%20%E6%95%B0%E6%8D%AE%E8%A1%A8%E7%9A%84%E8%A1%8C%E4%B8%BA%E4%B8%8E%20Excel%20%E7%94%B5%E5%AD%90%E8%A1%A8%E6%A0%BC%E4%B8%8D%E5%90%8C%EF%BC%8C%E6%88%91%E9%81%87%E5%88%B0%E4%BA%86%E5%91%A8%E6%9C%9F%E6%80%A7%E9%97%AE%E9%A2%98%E3%80%82%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3E%E5%9B%A0%E6%AD%A4%EF%BC%8C%E6%88%91%E4%B8%8D%E6%96%AD%E6%94%B9%E5%8F%98%E7%AD%96%E7%95%A5%EF%BC%8C%E6%88%91%E7%8E%B0%E5%9C%A8%E7%9A%84%E7%90%86%E8%A7%A3%E6%98%AF%E5%B0%86%E6%AF%8F%E4%B8%AA%E5%BF%85%E9%9C%80%E7%9A%84%E5%8F%98%E9%87%8F%E6%94%BE%E5%9C%A8%E4%B8%80%E5%88%97%E4%B8%AD%EF%BC%8C%E4%BB%A5%E9%81%BF%E5%85%8D%E5%BE%AA%E7%8E%AF%E9%97%AE%E9%A2%98%E3%80%82%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-739262%22%20slang%3D%22de-DE%22%20mode%3D%22CREATE%22%3E%E5%9B%9E%E5%A4%8D%EF%BC%9ACol%20Cumulative%20Sum%20%E4%B8%8D%E8%B0%83%E7%94%A8%E5%BD%93%E5%89%8D%E8%A1%8C%E7%9A%84%E5%80%BC%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-739262%22%20slang%3D%22de-DE%22%20mode%3D%22CREATE%22%3E%3CP%3E%E5%A4%A7%E5%AE%B6%E5%A5%BD%E3%80%82%E6%88%91%E6%AD%A3%E5%9C%A8%E9%87%8D%E6%96%B0%E6%8E%AA%E8%BE%9E%E6%88%91%E7%9A%84%E9%97%AE%E9%A2%98%EF%BC%8C%E5%B8%8C%E6%9C%9B%E5%8F%AF%E4%BB%A5%E6%B6%88%E9%99%A4%E4%BD%A0%E7%9A%84%E6%B2%AE%E4%B8%A7%E3%80%82%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CTABLE%20border%3D%221%22%3E%3CTBODY%3E%3CTR%3E%3CTD%3E%E6%8E%92%3C%2FTD%3E%3CTD%3ER%3C%2FTD%3E%3CTD%3E%E6%A1%88%E4%BE%8B%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3E1%3C%2FTD%3E%3CTD%3E.%3C%2FTD%3E%3CTD%3E%5B1%2C%201%2C%202%2C%201%5D%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3E2%3C%2FTD%3E%3CTD%3E1.4%3C%2FTD%3E%3CTD%3E%20%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3E3%3C%2FTD%3E%3CTD%3E1.67%3C%2FTD%3E%3CTD%3E%20%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3E4%3C%2FTD%3E%3CTD%3E2.3%3C%2FTD%3E%3CTD%3E%20%3C%2FTD%3E%3C%2FTR%3E%3C%2FTBODY%3E%3C%2FTABLE%3E%3CP%3E%20%3C%2FP%3E%3CP%3E%E6%88%91%E6%9C%89%202%20%E5%88%97%EF%BC%8C%20%3CSTRONG%3E%3CEM%3ER%3C%2FEM%3E%3C%2FSTRONG%3E%E5%92%8C%3CSTRONG%3E%3CEM%3ECases%E3%80%82Cases%3C%2FEM%3E%3C%2FSTRONG%3E%3CEM%3E%E6%98%AF%3C%2FEM%3E%E9%80%9A%E8%BF%87%E5%B0%86%E5%BD%93%E5%89%8D%E8%A1%8C%E7%9A%84%3CEM%3E%3CSTRONG%3ER%3C%2FSTRONG%3E%3C%2FEM%3E%E4%B8%8E%E4%B8%8A%E4%B8%80%E8%A1%8C%E7%9A%84%3CEM%3E%3CSTRONG%3ECases%3C%2FSTRONG%3E%3C%2FEM%3E%E7%9B%B8%E4%B9%98%E6%9D%A5%E8%AE%A1%E7%AE%97%E7%9A%84%E3%80%82%E6%AD%A4%E5%A4%96%EF%BC%8C%E9%9C%80%E8%A6%81%E6%A0%B9%E6%8D%AE%E4%B8%8A%E4%B8%80%E8%A1%8C%E7%9A%84%3CEM%3E%3CSTRONG%3ECases%3C%2FSTRONG%3E%3C%2FEM%3E%E6%80%BB%E5%92%8C%E4%BF%AE%E6%94%B9%EF%BC%88%E5%87%8F%E5%B0%91%EF%BC%89%20%3CEM%3E%3CSTRONG%3ER%3C%2FSTRONG%3E%3C%2FEM%3E%20%E3%80%82%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3E%3CEM%3E%3CSTRONG%3E%E6%A1%88%E4%BE%8B%3C%2FSTRONG%3E%3C%2FEM%3E%E5%88%97%E4%B8%AD%E7%9A%84%3CSTRONG%3E%3CEM%3ER%3C%2FEM%3E%3C%2FSTRONG%3E%20%EF%BC%88%E7%AC%AC%202%20%E8%A1%8C%EF%BC%89%3D%20%3CEM%3E%3CSTRONG%3ER%3C%2FSTRONG%3E%3C%2FEM%3E%20%EF%BC%88%E7%AC%AC%202%20%E8%A1%8C%EF%BC%89*%20%E4%BF%AE%E9%A5%B0%E7%AC%A6%3C%2FP%3E%3CP%3E%E4%BF%AE%E9%A5%B0%E7%AC%A6%20%3D%201%20-%20%3CFONT%20color%3D%22%23000000%22%3E%EF%BC%88%3C%2FFONT%3E%20%EF%BC%88%3CFONT%20color%3D%22%23339966%22%3E%3CU%3E%E4%BB%8E%E7%AC%AC%201%20%E8%A1%8C%E5%88%B0%E5%BD%93%E5%89%8D%E8%A1%8C%E5%89%8D%E4%B8%80%E8%A1%8C%E7%9A%84%3CEM%3E%3CSTRONG%3E%E6%A1%88%E4%BE%8B%3C%2FSTRONG%3E%3C%2FEM%3E%3C%2FU%3E%3C%2FFONT%3E%3CFONT%20color%3D%22%2300FF00%22%3E%3CFONT%20color%3D%22%23000000%22%3E%E7%B4%AF%E8%AE%A1%3C%2FFONT%3E%3CFONT%20color%3D%22%23339966%22%3E%3CU%3E%E6%80%BB%E6%95%B0%3C%2FU%3E%3C%2FFONT%3E%3C%2FFONT%3E*%20%3CFONT%20color%3D%22%23FF0000%22%3E4%3C%2FFONT%3E%20%3CFONT%20color%3D%22%23000000%22%3E%EF%BC%89%3C%2FFONT%3E%20%2F%3CFONT%20color%3D%22%23FF0000%22%3E%E6%80%BB%E4%BA%BA%E5%8F%A3%3C%2FFONT%3E%3CFONT%20color%3D%22%23000000%22%3E%EF%BC%89%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20color%3D%22%23000000%22%3E%E6%80%BB%E4%BA%BA%E5%8F%A3%E6%98%AF%E4%B8%80%E4%B8%AA%E5%8F%82%E6%95%B0%EF%BC%8C%E4%B8%BA%20100%E3%80%82%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%E7%94%B1%E6%AD%A4%E4%BA%A7%E7%94%9F%E7%9A%84%E4%BF%AE%E9%A5%B0%E7%AC%A6%3CSTRONG%3E%20%3C%2FSTRONG%3E%E4%B8%8E%E7%AC%AC%201%20%E8%A1%8C%E4%B8%AD%E7%9A%84%3CSTRONG%3E%3CEM%3E%E6%A1%88%E4%BE%8B%3C%2FEM%3E%3C%2FSTRONG%3E%E7%9B%B8%E4%B9%98%E4%BB%A5%E5%88%9B%E5%BB%BA%E7%AC%AC%202%20%E8%A1%8C%E4%B8%AD%E7%9A%84%3CEM%3E%3CSTRONG%3E%E6%A1%88%E4%BE%8B%3C%2FSTRONG%3E%3C%2FEM%3E%E3%80%82%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3E%E4%BE%8B%E5%A6%82%EF%BC%8C%E6%88%91%E6%9C%9F%E6%9C%9B%E4%BF%AE%E6%94%B9%E5%90%8E%E7%9A%84%3CEM%3E%3CSTRONG%3ER%3C%2FSTRONG%3E%3C%2FEM%3E%20(row2)%3CSTRONG%3E%20%3C%2FSTRONG%3E%E4%B8%BA%201.12%EF%BC%8C%3CEM%3E%3CSTRONG%3E%E6%A1%88%E4%BE%8B%3C%2FSTRONG%3E%3C%2FEM%3E%EF%BC%88%E7%AC%AC%202%20%E8%A1%8C%EF%BC%89%E4%B8%BA%20%5B1.12%2C%201.12%2C%202.24%2C%201.12%5D%3C%2FP%3E%3CP%3E1.4%20*%201-%EF%BC%88%20%3CFONT%20color%3D%22%23339966%22%3E%3CSTRONG%3E5%3C%2FSTRONG%3E%3C%2FFONT%3E%20*%20%3CFONT%20color%3D%22%23FF0000%22%3E4%2F100%3C%2FFONT%3E%20%3CFONT%20color%3D%22%23FF0000%22%3E%EF%BC%89%3C%2FFONT%3E%20%3D%201.12%3C%2FP%3E%3CP%3E1.12%20*%20%5B1%2C%201%2C%202%2C%201%5D%20%3D%20%5B1.12%2C%201.12%2C%202.24%2C%201.12%5D%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3E%E7%84%B6%E5%90%8E%EF%BC%8C%E6%88%91%E9%A2%84%E8%AE%A1%E4%BF%AE%E6%94%B9%E5%90%8E%E7%9A%84%3CEM%3E%3CSTRONG%3ER%3C%2FSTRONG%3E%3C%2FEM%3E%20%EF%BC%88%E7%AC%AC%203%20%E8%A1%8C%EF%BC%89%E4%B8%BA%200.71%EF%BC%8C%3CEM%3E%3CSTRONG%3E%E6%A1%88%E4%BE%8B%3C%2FSTRONG%3E%3C%2FEM%3E%EF%BC%88%E7%AC%AC%203%20%E8%A1%8C%EF%BC%89%E4%B8%BA%20%5B0.8%2C%200.8%2C%201.6%2C%200.8%5D%3C%2FP%3E%3CP%3E1.67%20*%201-%EF%BC%88%20%3CFONT%20color%3D%22%23339966%22%3E%3CSTRONG%3E10.6%3C%2FSTRONG%3E%3C%2FFONT%3E%20*%20%3CFONT%20color%3D%22%23FF0000%22%3E4%2F100%3C%2FFONT%3E%20%3CFONT%20color%3D%22%23FF0000%22%3E%EF%BC%89%3C%2FFONT%3E%20%3D%200.71%3C%2FP%3E%3CP%3E%3CFONT%20color%3D%22%23339966%22%3E%3CSTRONG%3E10.6%3C%2FSTRONG%3E%3C%2FFONT%3E%E6%9D%A5%E8%87%AA%E7%AC%AC%201%20%E8%A1%8C%E7%9A%84%3CFONT%20color%3D%22%23000000%22%3E%3CSTRONG%3E5%20%E4%B8%AA%3C%2FSTRONG%3E%3C%2FFONT%3E%E6%A1%88%E4%BE%8B%E5%92%8C%E7%AC%AC%E4%BA%8C%E8%A1%8C%E7%9A%84%3CSTRONG%3E5.6%20%E4%B8%AA%3C%2FSTRONG%3E%E6%A1%88%E4%BE%8B%E3%80%82%3C%2FP%3E%3CP%3E0.71%20*%20%5B1.12%2C%201.12%2C%202.24%2C%201.12%5D%20%3D%20%5B0.8%2C%200.8%2C%201.6%2C%200.8%5D%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3E%E6%88%91%E5%9C%A8%E8%8E%B7%E5%8F%96%3CSTRONG%3E%3CFONT%20color%3D%22%23339966%22%3E%E7%BB%BF%E8%89%B2%3C%2FFONT%3E%3C%2FSTRONG%3E%E5%80%BC%E6%97%B6%E9%81%87%E5%88%B0%E4%BA%86%E9%97%AE%E9%A2%98%E3%80%82%E6%88%91%E7%9B%AE%E5%89%8D%E5%B0%9D%E8%AF%95%E7%BC%96%E5%86%99%20JMP%20%E8%84%9A%E6%9C%AC%EF%BC%8C%E5%A6%82%E4%B8%8B%E6%89%80%E7%A4%BA%E3%80%82%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3EIf(%20Row()%20%3D%3D%201%2C%0A%09Matrix(%20%7B1%2C%201%2C%202%2C%201%7D%20)%2C%0A%09%3AR%20*%20(1%20-%20(Summation(%20i%20%3D%201%2C%20N%20Row()%20-%201%2C%20Sum(%20%3ACases%20)%20)%20*%204)%20%2F%20Total%20Population)%20*%20Lag(%20%3ACases%2C%201%20)%0A)%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%20%3C%2FP%3E%3CP%3E%E6%88%91%E5%B0%9D%E8%AF%95%E4%BA%86%3CFONT%20color%3D%22%230000FF%22%3EIndex%3C%2FFONT%3E%20%E3%80%81%20%3CFONT%20color%3D%22%230000FF%22%3ELag%3C%2FFONT%3E%20%E3%80%81%20%3CFONT%20color%3D%22%230000FF%22%3ERow()%20-%201%3C%2FFONT%3E%20%E3%80%81%20%3CFONT%20color%3D%22%230000FF%22%3ECol%20%E7%B4%AF%E8%AE%A1%3C%2FFONT%3E%E5%92%8C%20%E3%80%81%20%3CFONT%20color%3D%22%230000FF%22%3ESummation%3C%2FFONT%3E%E7%AD%89%E6%9D%A5%E8%8E%B7%E5%8F%96%E4%BF%AE%E9%A5%B0%E7%AC%A6%EF%BC%8C%E4%BD%86%E9%83%BD%E6%B2%A1%E6%9C%89%E5%A5%8F%E6%95%88%E3%80%82%E6%88%91%E4%B8%BB%E8%A6%81%E5%BE%97%E5%88%B0%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3E1)%20%E9%9D%9E%E6%B3%95%E5%BC%95%E7%94%A8%E6%88%96%3C%2FP%3E%3CP%3E2)%20%E4%B8%8D%E5%8F%AF%E4%B8%8B%E6%A0%87%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3E%E5%86%8D%E6%AC%A1%E6%84%9F%E8%B0%A2%E6%82%A8%E4%BB%98%E5%87%BA%E7%9A%84%E6%97%B6%E9%97%B4%E5%92%8C%E4%B8%93%E4%B8%9A%E7%9F%A5%E8%AF%86%E3%80%82%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-739418%22%20slang%3D%22de-DE%22%20mode%3D%22CREATE%22%3E%E5%9B%9E%E5%A4%8D%EF%BC%9ACol%20Cumulative%20Sum%20%E4%B8%8D%E8%B0%83%E7%94%A8%E5%BD%93%E5%89%8D%E8%A1%8C%E7%9A%84%E5%80%BC%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-739418%22%20slang%3D%22de-DE%22%20mode%3D%22CREATE%22%3E%3CP%3E%E9%9D%9E%E5%B8%B8%E6%84%9F%E8%B0%A2%E3%80%82%20%3CFONT%20color%3D%22%233366FF%22%3Efor%3C%2FFONT%3E%E5%BE%AA%E7%8E%AF%E4%BC%BC%E4%B9%8E%E6%98%AF%E8%BF%99%E9%87%8C%E7%9A%84%E5%85%B3%E9%94%AE%E3%80%82%20%E6%88%91%E8%BF%98%E6%B2%A1%E6%9C%89%E5%AD%A6%E4%B9%A0%3CFONT%20color%3D%22%233366FF%22%3EEval%3C%2FFONT%3E%20%E3%80%81%20%3CFONT%20color%3D%22%233366FF%22%3EEval%20Expr%3C%2FFONT%3E%E5%92%8C%3CFONT%20color%3D%22%233366FF%22%3EExpr%3C%2FFONT%3E%E8%BF%99%E4%BA%9B%E5%87%BD%E6%95%B0%E3%80%82%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3E%E4%BD%A0%E6%98%AF%E5%AF%B9%E7%9A%84%EF%BC%8C%E6%88%91%E5%9C%A8%E4%BE%8B%E5%AD%90%E4%B8%AD%E7%9A%84%E8%AE%A1%E7%AE%97%E6%98%AF%E9%94%99%E8%AF%AF%E7%9A%84%E3%80%82%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-739085%22%20slang%3D%22de-DE%22%20mode%3D%22CREATE%22%3E%E5%9B%9E%E5%A4%8D%EF%BC%9ACol%20Cumulative%20Sum%20%E4%B8%8D%E8%B0%83%E7%94%A8%E5%BD%93%E5%89%8D%E8%A1%8C%E7%9A%84%E5%80%BC%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-739085%22%20slang%3D%22de-DE%22%20mode%3D%22CREATE%22%3E%3CP%3E%E5%BD%93%E6%88%91%E5%9C%A8%E5%85%AC%E5%BC%8F%E4%B8%AD%E4%BD%BF%E7%94%A8%20(%3AWeek)%20%E6%97%B6%EF%BC%8C%E5%87%BA%E7%8E%B0%E4%BA%86%E9%9D%9E%E6%B3%95%E5%BC%95%E7%94%A8%E9%97%AE%E9%A2%98%E3%80%82%E5%BD%93%E5%89%8D%E8%A1%8C%20(%3AWeek)%20%E5%B0%9A%E6%9C%AA%E5%AE%8C%E5%85%A8%E8%AE%A1%E7%AE%97%E3%80%82%E7%90%86%E8%AE%BA%E4%B8%8A%EF%BC%8C%E6%88%91%E5%8F%AA%E8%83%BD%E4%BB%8E%E4%B8%8A%E4%B8%80%E8%A1%8C%E8%B0%83%E7%94%A8%20(%3AWeek)%E3%80%82%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-739086%22%20slang%3D%22de-DE%22%20mode%3D%22CREATE%22%3E%E5%9B%9E%E5%A4%8D%EF%BC%9ACol%20Cumulative%20Sum%20%E4%B8%8D%E8%B0%83%E7%94%A8%E5%BD%93%E5%89%8D%E8%A1%8C%E7%9A%84%E5%80%BC%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-739086%22%20slang%3D%22de-DE%22%20mode%3D%22CREATE%22%3E%3CP%3E%E5%A6%82%E6%9E%9C%E6%88%91%E7%90%86%E8%A7%A3%E6%AD%A3%E7%A1%AE%E7%9A%84%E8%AF%9D%EF%BC%8C%E6%88%91%E8%AE%A4%E4%B8%BA%E8%BF%99%E5%8F%AF%E8%83%BD%E6%98%AF%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3EIf(%20Row()%20!%3D%201%2C%0A%09Sum(%20%3AWeek%5BIndex(%201%2C%20Row()%20-%201%20)%5D%20)%2C%0A%090%0A)%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-739101%22%20slang%3D%22de-DE%22%20mode%3D%22CREATE%22%3E%E5%9B%9E%E5%A4%8D%EF%BC%9ACol%20Cumulative%20Sum%20%E4%B8%8D%E8%B0%83%E7%94%A8%E5%BD%93%E5%89%8D%E8%A1%8C%E7%9A%84%E5%80%BC%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-739101%22%20slang%3D%22de-DE%22%20mode%3D%22CREATE%22%3E%3CP%3E%E6%88%91%E4%BC%9A%E7%BB%A7%E7%BB%AD%E5%AD%A6%E4%B9%A0%20JMP%E3%80%82%E7%9B%AE%E5%89%8D%EF%BC%8C%E6%88%91%E5%8F%AA%E4%BC%9A%E5%9D%9A%E6%8C%81%E4%BD%BF%E7%94%A8%20Excel%20%E7%94%B5%E5%AD%90%E8%A1%A8%E6%A0%BC%E3%80%82%E6%84%9F%E8%B0%A2%E5%A4%A7%E5%AE%B6%E7%9A%84%E5%9B%9E%E5%A4%8D%E3%80%82%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3E%3CEM%3ESim%20Cases%3C%2FEM%3E%E6%98%AF%E4%B8%80%E5%88%97%EF%BC%8C%E6%88%91%E5%9C%A8%E5%88%9B%E5%BB%BA%E6%96%B0%E8%A1%8C%E6%97%B6%E4%BD%BF%E7%94%A8%E4%BA%86%E5%89%8D%E5%87%A0%E8%A1%8C%E7%9A%84%3CEM%3ESim%20Cases%3C%2FEM%3E%20%E3%80%82%E6%89%80%E4%BB%A5%E6%88%91%E7%8C%9C%E6%83%B3%E5%AE%83%E6%97%A2%E6%98%AF%E4%B8%80%E5%88%97%EF%BC%8C%E5%8F%88%E6%98%AF%E5%90%8C%E4%B8%80%E5%88%97%E5%86%85%E7%9A%84%E5%8F%98%E9%87%8F%E3%80%82%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-739105%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E5%9B%9E%E5%A4%8D%EF%BC%9ACol%20Cumulative%20Sum%20%E4%B8%8D%E8%B0%83%E7%94%A8%E5%BD%93%E5%89%8D%E8%A1%8C%E7%9A%84%E5%80%BC%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-739105%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EJMP%20%E8%A1%A8%E6%A0%BC%E5%92%8C%E7%94%B5%E5%AD%90%E8%A1%A8%E6%A0%BC%E7%9A%84%E8%A1%8C%E4%B8%BA%E6%96%B9%E5%BC%8F%E5%AE%8C%E5%85%A8%E4%B8%8D%E5%90%8C%EF%BC%8C%E8%BF%99%E7%AF%87%E6%97%A7%E5%B8%96%E5%AD%90%E5%8F%AF%E8%83%BD%E5%80%BC%E5%BE%97%E4%B8%80%E8%AF%BB%EF%BC%8C%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2FDiscussions%2FJMP-is-Not-a-Spreadsheet%2Fm-p%2F214307%23U214307%22%20class%3D%22lia-mention-container-editor-message%20lia-img-icon-forum-thread%20lia-fa-icon%20lia-fa-forum%20lia-fa-thread%20lia-fa%22%20target%3D%22_blank%22%3EJMP%20%E4%B8%8D%E6%98%AF%E7%94%B5%E5%AD%90%E8%A1%A8%E6%A0%BC%EF%BC%8C%3C%2FA%3E%E5%9B%A0%E4%B8%BA%E5%AE%83%E6%8F%90%E4%BE%9B%E4%BA%86%E4%B8%80%E4%BA%9B%E7%A4%BA%E4%BE%8B%E5%92%8C%E8%A7%A3%E9%87%8A%E3%80%82%E6%82%A8%E5%8F%AF%E4%BB%A5%E5%9C%A8%20JMP%20%E4%B8%AD%E5%AE%8C%E6%88%90%E5%A4%A7%E9%83%A8%E5%88%86%E5%B7%A5%E4%BD%9C%EF%BC%8C%E4%BD%86%E5%8F%AF%E8%83%BD%E9%9C%80%E8%A6%81%E4%B8%80%E4%BA%9B%E6%97%B6%E9%97%B4%E6%89%8D%E8%83%BD%E7%90%86%E8%A7%A3%20JMP%20%E4%B8%AD%E5%88%97%2B%E8%A1%8C%E7%9A%84%E8%A1%8C%E4%B8%BA%E6%96%B9%E5%BC%8F%E4%B8%8E%20Excel%20%E4%B8%AD%E5%8D%95%E4%B8%AA%E5%8D%95%E5%85%83%E6%A0%BC%E7%9A%84%E8%A1%8C%E4%B8%BA%E6%96%B9%E5%BC%8F%E3%80%82%3C%2FP%3E%3C%2FLINGO-BODY%3E
Choose Language Hide Translation Bar
tMinnx
Level III

Col Cumulative Sum without calling the current row's value

Hello, I am quite new to writing JMP scripts and primarily use "Edit Formula" for my work. I have been browsing solutions related to Col Cumulative Sum and could not find one for my specific problem. The simplified version of my data table is as follows.

 

RowWeekCol Cumulative SumMy Wish
1110
2231
3363
44106
551510
662115

 

The formula below works if the current row value of "Week" is fixed or if I have two separate columns "Week" and "My Wish."

 

 

If( Row() != 1,
	Lag( Col Cumulative Sum( :Week ), 1 ),
	0
)

 

The issue is that the value of the previous row's "Week" is fixed but the current row's is not. And I only have one column "Week" to work with. I am developing a formula that simulates progression based on the previous simulation value. I am simulating the current row's "Week" value based on the previous row's.

 

Suppose I am working on Row 4 in the column "Week." I want to cumulatively sum all the previous "Week" values without calling the current "Week" value in the function. Otherwise, it creates an illegal reference or cycling problem in my case.

 

I tried using subscript instead of lag since the lag function calls the current row's "Week" value. It did not work.

 

If( Row() != 1,
	Col Cumulative Sum( :Week )[Row() - 1],
	0
)

I hope my explanation was clear enough. Thank you for your time and expertise in advance. I use JMP Pro 17.

 

 

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
txnelson
Super User

Re: Col Cumulative Sum without calling the current row's value

Is "Sim Cases" a matrix or a column in a data table?

 

I do not understand 

You appear to be making your solution overly complex.

sim cases = [3,5,2,8];

sum1 = sum(sim cases);
sum2 = sum(([1 1 1 1]*sim cases)[1]);
show(sum1,sum2);

Both sum1 and sum2 provide the same value

sum1 = 18;
sum2 = 18;

I encourage you to read the Discovering JMP document available under the Help pull down menu.

Jim

View solution in original post

txnelson
Super User

Re: Col Cumulative Sum without calling the current row's value

Here is my solution, however, it does not match your solution.  I believe your calculations as shown are incorrect for Row 3. See my script, which includes your sample data table.

Names Default To Here( 1 );
dt = New Table( "Example",
	Add Rows( 4 ),
	New Column( "R",
		Numeric,
		"Continuous",
		Set Values( [., 1.4, 1.67, 2.3] )
	),
	New Column( "Cases",
		Expression,
		"None",
		Set Values( {[1, 1, 2, 1], Empty(), Empty(), Empty()} )
	)
);

// The calculation script
casesSum = 0;
For(i=2,i<=nrows(dt),i++,
		Eval( Eval Expr( casesMatrix = Expr( :cases[i - 1] ) ) );
		:R[i] = :R[i] * (1 - (Sum( casesMatrix )+casesSum) * 4 / 100);
		:Cases[i] = casesMatrix * :R[i];
		casesSum = casesSum + sum(casesMatrix);
);


// Row 3 R does not seem to be correct
// I can not come up with .71, I come up with .96192
show(1.4 * (1 - (5 * 4/100)) ); 
show(1.67 * (1 - (10.6 * 4/100)) ); 



txnelson_0-1711546109146.png

 

Jim

View solution in original post

15 REPLIES 15
jthi
Super User

Re: Col Cumulative Sum without calling the current row's value

You can deduct current weeks value from the cumulative sum

Col Cumulative Sum(:Week) - :Week

jthi_0-1711447034404.png

 

-Jarmo
tMinnx
Level III

Re: Col Cumulative Sum without calling the current row's value

The moment I use (:Week) in my formula I get an illegal reference problem. The current row (:Week) has not been fully calculated yet. I can only recall (:Week) from the previous row in theory.

jthi
Super User

Re: Col Cumulative Sum without calling the current row's value

I would use separate columns to avoid all sorts of issues, but I'm not exactly sure what you are trying to achieve as you have full data in your example. Maybe something like this if Col Cumulative Sum doesn't work for you (calculate value using Lag and variable)

 

If(Row() == 1,
	val = 0,
	val = val + Lag(:Week);
);
val;

 

 

-Jarmo
tMinnx
Level III

Re: Col Cumulative Sum without calling the current row's value

Yes, at first, I tried to emulate in the JMP data table what I usually do in Excel spreadsheets by separating columns. I would then call the values of the previous row of a different column. The JMP data table does not behave as Excel spreadsheets, and I am encountering cyclical problems.

 

So, I keep changing strategies and my current understanding is to keep every required variable in one column to avoid cyclical problems.

txnelson
Super User

Re: Col Cumulative Sum without calling the current row's value

If I am understanding correctly, I think this might be the solution

If( Row() != 1,
	Sum( :Week[Index( 1, Row() - 1 )] ),
	0
)
Jim
tMinnx
Level III

Re: Col Cumulative Sum without calling the current row's value

Thank you for your suggestion on using the Index subscript. I now encounter the issue "object not subscriptable."

 

My week example was over-simplified and I have a matrix Sim Cases of 4 rows and 1 column in place of week. To transform it into one summarized numerical value, I multiplied the matrix with [1 1 1 1] and added a subscript [1]. It was then followed by the Index subscript.

 

Sum( ([1 1 1 1] * :Sim Cases)[1][Index( 1, Row() - 1 )] )

I think the resulting numerical value from the original 4x1 matrix is not accepting any subscript after [1]. Or it could be because of the illegal reference (recursion) again.

txnelson
Super User

Re: Col Cumulative Sum without calling the current row's value

Is "Sim Cases" a matrix or a column in a data table?

 

I do not understand 

You appear to be making your solution overly complex.

sim cases = [3,5,2,8];

sum1 = sum(sim cases);
sum2 = sum(([1 1 1 1]*sim cases)[1]);
show(sum1,sum2);

Both sum1 and sum2 provide the same value

sum1 = 18;
sum2 = 18;

I encourage you to read the Discovering JMP document available under the Help pull down menu.

Jim
tMinnx
Level III

Re: Col Cumulative Sum without calling the current row's value

I will keep learning JMP. For now, I will just stick to my Excel spreadsheet. Thanks everyone for your responses.

 

Sim Cases is a column and I am using Sim Cases of previous rows in creating new rows. So I guess it is both a column and a variable inside that same column.

jthi
Super User

Re: Col Cumulative Sum without calling the current row's value

How JMP tables and spreadsheets behave are totally different and this old post might be a good read JMP is Not a Spreadsheet as it provides some examples and explanation. You can do most of the stuff in JMP but it can take some time to get your head around how columns+rows behave in JMP vs single cell in excel.

-Jarmo