cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Try the Materials Informatics Toolkit, which is designed to easily handle SMILES data. This and other helpful add-ins are available in the JMP® Marketplace
%3CLINGO-SUB%20id%3D%22lingo-sub-739077%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ECol%20Cumulative%20Sum%20sans%20appeler%20la%20valeur%20de%20la%20ligne%20actuelle%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-739077%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EBonjour%2C%20je%20suis%20assez%20nouveau%20dans%20l'%C3%A9criture%20de%20scripts%20JMP%20et%20j'utilise%20principalement%20%22Edit%20Formula%22%20pour%20mon%20travail.%20J'ai%20parcouru%20les%20solutions%20li%C3%A9es%20%C3%A0%20%3CSTRONG%3ECol%20Cumulative%20Sum%3C%2FSTRONG%3E%20et%20je%20n'en%20ai%20pas%20trouv%C3%A9%20une%20pour%20mon%20probl%C3%A8me%20sp%C3%A9cifique.%20La%20version%20simplifi%C3%A9e%20de%20mon%20tableau%20de%20donn%C3%A9es%20est%20la%20suivante.%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CTABLE%20border%3D%221%22%3E%3CTBODY%3E%3CTR%3E%3CTD%3E%3CSTRONG%3ERang%C3%A9e%3C%2FSTRONG%3E%3C%2FTD%3E%3CTD%3E%3CSTRONG%3ESemaine%3C%2FSTRONG%3E%3C%2FTD%3E%3CTD%3E%3CSTRONG%3ECol%20Cumulative%20Sum%3C%2FSTRONG%3E%3C%2FTD%3E%3CTD%3E%3CSTRONG%3EMon%20souhait%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%3Edix%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%3Edix%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%3ELa%20formule%20ci-dessous%20fonctionne%20si%20la%20valeur%20actuelle%20de%20la%20ligne%20%C2%AB%26nbsp%3BSemaine%26nbsp%3B%C2%BB%20est%20fixe%20ou%20si%20j'ai%20deux%20colonnes%20distinctes%20%C2%AB%26nbsp%3BSemaine%26nbsp%3B%C2%BB%20et%20%C2%AB%26nbsp%3BMon%20souhait%26nbsp%3B%C2%BB.%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%3ELe%20probl%C3%A8me%20est%20que%20la%20valeur%20de%20la%20%22Semaine%22%20de%20la%20ligne%20pr%C3%A9c%C3%A9dente%20est%20fixe%20mais%20celle%20de%20la%20ligne%20actuelle%20ne%20l'est%20pas.%20Et%20je%20n'ai%20qu'une%20seule%20colonne%20%22Semaine%22%20avec%20laquelle%20travailler.%20Je%20d%C3%A9veloppe%20une%20formule%20qui%20simule%20la%20progression%20en%20fonction%20de%20la%20valeur%20de%20simulation%20pr%C3%A9c%C3%A9dente.%20Je%20simule%20la%20valeur%20%22Semaine%22%20de%20la%20ligne%20actuelle%20en%20fonction%20de%20celle%20de%20la%20ligne%20pr%C3%A9c%C3%A9dente.%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3ESupposons%20que%20je%20travaille%20sur%20la%20ligne%204%20de%20la%20colonne%20%C2%AB%26nbsp%3BSemaine%26nbsp%3B%C2%BB.%20Je%20souhaite%20additionner%20cumulativement%20toutes%20les%20valeurs%20%22Semaine%22%20pr%C3%A9c%C3%A9dentes%20sans%20appeler%20la%20valeur%20%22Semaine%22%20actuelle%20dans%20la%20fonction.%20Sinon%2C%20cela%20cr%C3%A9e%20un%20probl%C3%A8me%20de%20r%C3%A9f%C3%A9rence%20ill%C3%A9gale%20ou%20de%20cyclisme%20dans%20mon%20cas.%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3EJ'ai%20essay%C3%A9%20d'utiliser%20un%20indice%20au%20lieu%20de%20lag%20puisque%20la%20fonction%20lag%20appelle%20la%20valeur%20%22Semaine%22%20de%20la%20ligne%20actuelle.%20Cela%20n'a%20pas%20fonctionn%C3%A9.%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%3EJ'esp%C3%A8re%20que%20mon%20explication%20%C3%A9tait%20suffisamment%20claire.%20Merci%20d'avance%20pour%20votre%20temps%20et%20votre%20expertise.%20J'utilise%20JMP%20Pro%2017.%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%3EAutomatisation%20et%20scripts%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMod%C3%A9lisation%20pr%C3%A9dictive%20et%20apprentissage%20automatique%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-739418%22%20slang%3D%22de-DE%22%20mode%3D%22CREATE%22%3ERe%20%3A%20Somme%20cumul%C3%A9e%20des%20colonnes%20sans%20appeler%20la%20valeur%20de%20la%20ligne%20actuelle%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-739418%22%20slang%3D%22de-DE%22%20mode%3D%22CREATE%22%3E%3CP%3EMerci%20beaucoup.%20La%20%3CFONT%20color%3D%22%233366FF%22%3Eboucle%3C%2FFONT%3E%20for%20semble%20%C3%AAtre%20la%20cl%C3%A9%20ici.%20Je%20n'ai%20pas%20encore%20appris%20les%20fonctions%20%3CFONT%20color%3D%22%233366FF%22%3EEval%3C%2FFONT%3E%20%2C%20%3CFONT%20color%3D%22%233366FF%22%3EEval%20Expr%3C%2FFONT%3E%20et%20%3CFONT%20color%3D%22%233366FF%22%3EExpr%3C%2FFONT%3E%20.%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3EEt%20vous%20avez%20raison%2C%20mes%20calculs%20dans%20l'exemple%20%C3%A9taient%20erron%C3%A9s.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-739315%22%20slang%3D%22de-DE%22%20mode%3D%22CREATE%22%3ERe%20%3A%20Somme%20cumul%C3%A9e%20des%20colonnes%20sans%20appeler%20la%20valeur%20de%20la%20ligne%20actuelle%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-739315%22%20slang%3D%22de-DE%22%20mode%3D%22CREATE%22%3E%3CP%3EVoici%20ma%20solution%2C%20cependant%2C%20elle%20ne%20correspond%20pas%20%C3%A0%20la%20v%C3%B4tre.%20Je%20pense%20que%20vos%20calculs%20indiqu%C3%A9s%20sont%20incorrects%20pour%20la%20ligne%203.%20Consultez%20mon%20script%2C%20qui%20inclut%20votre%20exemple%20de%20tableau%20de%20donn%C3%A9es.%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-739262%22%20slang%3D%22de-DE%22%20mode%3D%22CREATE%22%3ERe%20%3A%20Somme%20cumul%C3%A9e%20des%20colonnes%20sans%20appeler%20la%20valeur%20de%20la%20ligne%20actuelle%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-739262%22%20slang%3D%22de-DE%22%20mode%3D%22CREATE%22%3E%3CP%3EBonjour%20%C3%A0%20nouveau.%20Je%20reformule%20ma%20question%20dans%20l'espoir%20de%20pouvoir%20faire%20dispara%C3%AEtre%20la%20frustration.%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CTABLE%20border%3D%221%22%3E%3CTBODY%3E%3CTR%3E%3CTD%3ERang%C3%A9e%3C%2FTD%3E%3CTD%3ER%3C%2FTD%3E%3CTD%3ECas%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%2C67%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%3EJ'ai%202%20colonnes%2C%20%3CSTRONG%3E%3CEM%3ER%3C%2FEM%3E%3C%2FSTRONG%3E%20et%20%3CSTRONG%3E%3CEM%3ECases%3C%2FEM%3E%3C%2FSTRONG%3E%20.%20%3CEM%3ELes%20cas%3C%2FEM%3E%20sont%20calcul%C3%A9s%20en%20multipliant%20%3CEM%3E%3CSTRONG%3ER%3C%2FSTRONG%3E%3C%2FEM%3E%20de%20la%20ligne%20actuelle%20par%20%3CEM%3E%3CSTRONG%3Eles%20cas%3C%2FSTRONG%3E%3C%2FEM%3E%20de%20la%20ligne%20pr%C3%A9c%C3%A9dente.%20De%20plus%2C%20%3CEM%3E%3CSTRONG%3ER%3C%2FSTRONG%3E%3C%2FEM%3E%20doit%20%C3%AAtre%20modifi%C3%A9%20(r%C3%A9duit)%20en%20fonction%20de%20la%20somme%20des%20%3CEM%3E%3CSTRONG%3Ecas%3C%2FSTRONG%3E%3C%2FEM%3E%20de%20la%20ligne%20pr%C3%A9c%C3%A9dente.%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3E%3CSTRONG%3E%3CEM%3ER%3C%2FEM%3E%3C%2FSTRONG%3E%20(ligne%202)%20dans%20la%20colonne%20%3CEM%3E%3CSTRONG%3ECas%3C%2FSTRONG%3E%3C%2FEM%3E%20%3D%20%3CEM%3E%3CSTRONG%3ER%3C%2FSTRONG%3E%3C%2FEM%3E%20(ligne%202)%20*%20modificateur%3C%2FP%3E%3CP%3Emodificateur%20%3D%201%20-%20%3CFONT%20color%3D%22%23000000%22%3E(%3C%2FFONT%3E%20%3CFONT%20color%3D%22%2300FF00%22%3E%3CFONT%20color%3D%22%23000000%22%3E(%3C%2FFONT%3E%20somme%20%3CFONT%20color%3D%22%23339966%22%3E%3CU%3Ecumul%C3%A9e%3C%2FU%3E%3C%2FFONT%3E%3C%2FFONT%3E%20%3CFONT%20color%3D%22%23339966%22%3E%3CU%3Edes%20%3CEM%3E%3CSTRONG%3Ecas%3C%2FSTRONG%3E%3C%2FEM%3E%20de%20la%20ligne%201%20%C3%A0%20la%20ligne%20pr%C3%A9c%C3%A9dant%20la%20ligne%20actuelle%3C%2FU%3E%3C%2FFONT%3E%20*%20%3CFONT%20color%3D%22%23FF0000%22%3E4%3C%2FFONT%3E%20%3CFONT%20color%3D%22%23000000%22%3E)%3C%2FFONT%3E%20%2F%20%3CFONT%20color%3D%22%23FF0000%22%3EPopulation%20totale%3C%2FFONT%3E%20%3CFONT%20color%3D%22%23000000%22%3E)%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20color%3D%22%23000000%22%3ELa%20population%20totale%20est%20un%20param%C3%A8tre%20et%20vaut%20100.%3C%2FFONT%3E%3C%2FP%3E%3CP%3ELe%20modificateur%20r%C3%A9sultant%3CSTRONG%3E%20%3C%2FSTRONG%3Eest%20multipli%C3%A9%20par%20%3CSTRONG%3E%3CEM%3Eles%20cas%3C%2FEM%3E%3C%2FSTRONG%3E%20de%20la%20ligne%201%20pour%20cr%C3%A9er%20%3CEM%3E%3CSTRONG%3Edes%20cas%3C%2FSTRONG%3E%3C%2FEM%3E%20dans%20la%20ligne%202.%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3EPar%20exemple%2C%20j'attends%20le%20%3CEM%3E%3CSTRONG%3ER%3C%2FSTRONG%3E%3C%2FEM%3E%20modifi%C3%A9%20(row2)%3CSTRONG%3E%20%3C%2FSTRONG%3E%C3%AAtre%201.12%20et%20%3CEM%3E%3CSTRONG%3Eles%20cas%3C%2FSTRONG%3E%3C%2FEM%3E%20(rang%C3%A9e%202)%20%C3%AAtre%20%5B1.12%2C%201.12%2C%202.24%2C%201.12%5D%3C%2FP%3E%3CP%3E1%2C4%20*%201%20-%20(%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%3C%2FFONT%3E%20%2F%20%3CFONT%20color%3D%22%23FF0000%22%3E100%3C%2FFONT%3E%20)%20%3D%201%2C12%3C%2FP%3E%3CP%3E1%2C12%20*%20%5B1%2C%201%2C%202%2C%201%5D%20%3D%20%5B1%2C12%2C%201%2C12%2C%202%2C24%2C%201%2C12%5D%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3EEnsuite%2C%20je%20m'attends%20%C3%A0%20ce%20que%20le%20%3CEM%3E%3CSTRONG%3ER%3C%2FSTRONG%3E%3C%2FEM%3E%20modifi%C3%A9%20(row3)%20soit%20de%200%2C71%20et%20que%20%3CEM%3E%3CSTRONG%3Eles%20Cases%3C%2FSTRONG%3E%3C%2FEM%3E%20(row3)%20soient%20%5B0%2C8%2C%200%2C8%2C%201%2C6%2C%200%2C8%5D%3C%2FP%3E%3CP%3E1%2C67%20*%201%20-%20(%20%3CFONT%20color%3D%22%23339966%22%3E%3CSTRONG%3E10%2C6%3C%2FSTRONG%3E%3C%2FFONT%3E%20*%20%3CFONT%20color%3D%22%23FF0000%22%3E4%3C%2FFONT%3E%20%2F%20%3CFONT%20color%3D%22%23FF0000%22%3E100%3C%2FFONT%3E%20)%20%3D%200%2C71%3C%2FP%3E%3CP%3E%3CFONT%20color%3D%22%23339966%22%3E%3CSTRONG%3E10%2C6%3C%2FSTRONG%3E%3C%2FFONT%3E%20provient%20de%20%3CFONT%20color%3D%22%23000000%22%3E%3CSTRONG%3E5%3C%2FSTRONG%3E%3C%2FFONT%3E%20cas%20dans%20la%20rang%C3%A9e%201%20et%20%3CSTRONG%3Ede%205%2C6%3C%2FSTRONG%3E%20cas%20dans%20la%20rang%C3%A9e%202.%3C%2FP%3E%3CP%3E0%2C71%20*%20%5B1%2C12%2C%201%2C12%2C%202%2C24%2C%201%2C12%5D%20%3D%20%5B0%2C8%2C%200%2C8%2C%201%2C6%2C%200%2C8%5D%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3EJ'ai%20du%20mal%20%C3%A0%20obtenir%20la%20valeur%20%3CSTRONG%3E%3CFONT%20color%3D%22%23339966%22%3Everte%3C%2FFONT%3E%3C%2FSTRONG%3E%20.%20Ma%20tentative%20actuelle%20d'%C3%A9criture%20d'un%20script%20JMP%20est%20la%20suivante.%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%3EJ'ai%20essay%C3%A9%20%3CFONT%20color%3D%22%230000FF%22%3EIndex%3C%2FFONT%3E%20%2C%20%3CFONT%20color%3D%22%230000FF%22%3ELag%3C%2FFONT%3E%20%2C%20%3CFONT%20color%3D%22%230000FF%22%3ERow()%20-%201%3C%2FFONT%3E%20%2C%20%3CFONT%20color%3D%22%230000FF%22%3ECol%20cumulative%20sum%3C%2FFONT%3E%20%2C%20%3CFONT%20color%3D%22%230000FF%22%3ESummation%3C%2FFONT%3E%20%2C%20etc.%20pour%20obtenir%20le%20modificateur%2C%20et%20rien%20n'a%20fonctionn%C3%A9.%20Je%20re%C3%A7ois%20principalement%20soit%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3E1)%20r%C3%A9f%C3%A9rencement%20ill%C3%A9gal%20ou%3C%2FP%3E%3CP%3E2)%20d%C3%A9sabonnement%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3EMerci%20encore%20pour%20votre%20temps%20et%20votre%20expertise.%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-739105%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Somme%20cumul%C3%A9e%20des%20colonnes%20sans%20appeler%20la%20valeur%20de%20la%20ligne%20actuelle%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-739105%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3ELe%20comportement%20des%20tables%20et%20des%20feuilles%20de%20calcul%20JMP%20est%20totalement%20diff%C3%A9rent%20et%20cet%20ancien%20article%20pourrait%20%C3%AAtre%20une%20bonne%20lecture.%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%20n'est%20pas%20une%20feuille%20de%20calcul%3C%2FA%3E%20car%20il%20fournit%20des%20exemples%20et%20des%20explications.%20Vous%20pouvez%20faire%20la%20plupart%20des%20choses%20dans%20JMP%2C%20mais%20cela%20peut%20prendre%20un%20certain%20temps%20pour%20comprendre%20comment%20les%20colonnes%20%2B%20lignes%20se%20comportent%20dans%20JMP%20par%20rapport%20%C3%A0%20une%20cellule%20unique%20dans%20Excel.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-739101%22%20slang%3D%22de-DE%22%20mode%3D%22CREATE%22%3ERe%20%3A%20Somme%20cumul%C3%A9e%20des%20colonnes%20sans%20appeler%20la%20valeur%20de%20la%20ligne%20actuelle%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-739101%22%20slang%3D%22de-DE%22%20mode%3D%22CREATE%22%3E%3CP%3EJe%20vais%20continuer%20%C3%A0%20apprendre%20JMP.%20Pour%20l'instant%2C%20je%20m'en%20tiendrai%20%C3%A0%20ma%20feuille%20de%20calcul%20Excel.%20Merci%20%C3%A0%20tous%20pour%20vos%20r%C3%A9ponses.%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3E%3CEM%3ESim%20Cases%3C%2FEM%3E%20est%20une%20colonne%20et%20j'utilise%20%3CEM%3Eles%20Sim%20Cases%3C%2FEM%3E%20des%20lignes%20pr%C3%A9c%C3%A9dentes%20pour%20cr%C3%A9er%20de%20nouvelles%20lignes.%20Je%20suppose%20donc%20que%20c'est%20%C3%A0%20la%20fois%20une%20colonne%20et%20une%20variable%20%C3%A0%20l'int%C3%A9rieur%20de%20cette%20m%C3%AAme%20colonne.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-739100%22%20slang%3D%22de-DE%22%20mode%3D%22CREATE%22%3ERe%20%3A%20Somme%20cumul%C3%A9e%20des%20colonnes%20sans%20appeler%20la%20valeur%20de%20la%20ligne%20actuelle%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-739100%22%20slang%3D%22de-DE%22%20mode%3D%22CREATE%22%3E%3CP%3E%22Sim%20Cases%22%20est-il%20une%20matrice%20ou%20une%20colonne%20dans%20un%20tableau%20de%20donn%C3%A9es%26nbsp%3B%3F%3C%2FP%3E%0A%3CP%3E%20%3C%2FP%3E%0A%3CP%3EJe%20ne%20comprends%20pas%3C%2FP%3E%0A%3CP%3EVous%20semblez%20rendre%20votre%20solution%20trop%20complexe.%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%20et%20sum2%20fournissent%20la%20m%C3%AAme%20valeur%3C%2FP%3E%0A%3CPRE%3Esum1%20%3D%2018%3B%0Asum2%20%3D%2018%3B%3C%2FPRE%3E%0A%3CP%3EJe%20vous%20encourage%20%C3%A0%20lire%20le%20document%20D%C3%A9couverte%20de%20JMP%20disponible%20dans%20le%20menu%20d%C3%A9roulant%20Aide.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-739096%22%20slang%3D%22de-DE%22%20mode%3D%22CREATE%22%3ERe%20%3A%20Somme%20cumul%C3%A9e%20des%20colonnes%20sans%20appeler%20la%20valeur%20de%20la%20ligne%20actuelle%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-739096%22%20slang%3D%22de-DE%22%20mode%3D%22CREATE%22%3E%3CP%3EOui%2C%20au%20d%C3%A9but%2C%20j'ai%20essay%C3%A9%20d'%C3%A9muler%20dans%20le%20tableau%20de%20donn%C3%A9es%20JMP%20ce%20que%20je%20fais%20habituellement%20dans%20les%20feuilles%20de%20calcul%20Excel%20en%20s%C3%A9parant%20les%20colonnes.%20J'appellerais%20alors%20les%20valeurs%20de%20la%20ligne%20pr%C3%A9c%C3%A9dente%20d'une%20colonne%20diff%C3%A9rente.%20Le%20tableau%20de%20donn%C3%A9es%20JMP%20ne%20se%20comporte%20pas%20comme%20une%20feuille%20de%20calcul%20Excel%20et%20je%20rencontre%20des%20probl%C3%A8mes%20cycliques.%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3EJe%20continue%20donc%20de%20changer%20de%20strat%C3%A9gie%20et%20ma%20compr%C3%A9hension%20actuelle%20est%20de%20conserver%20chaque%20variable%20requise%20dans%20une%20colonne%20pour%20%C3%A9viter%20les%20probl%C3%A8mes%20cycliques.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-739092%22%20slang%3D%22de-DE%22%20mode%3D%22CREATE%22%3ERe%20%3A%20Somme%20cumul%C3%A9e%20des%20colonnes%20sans%20appeler%20la%20valeur%20de%20la%20ligne%20actuelle%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-739092%22%20slang%3D%22de-DE%22%20mode%3D%22CREATE%22%3E%3CP%3EMerci%20pour%20votre%20suggestion%20sur%20l'utilisation%20de%20l'indice%20%3CFONT%20color%3D%22%233366FF%22%3EIndex%3C%2FFONT%3E%20.%20Je%20rencontre%20maintenant%20le%20probl%C3%A8me%20%22objet%20non%20inscriptible%22.%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3EMon%20exemple%20%3CEM%3Ede%20semaine%3C%2FEM%3E%20%C3%A9tait%20trop%20simplifi%C3%A9%20et%20j'ai%20une%20matrice%20%3CEM%3ESim%20Cases%3C%2FEM%3E%20de%204%20lignes%20et%201%20colonne%20%C3%A0%20la%20place%20de%20%3CEM%3Eweek%3C%2FEM%3E%20.%20Pour%20la%20transformer%20en%20une%20valeur%20num%C3%A9rique%20r%C3%A9sum%C3%A9e%2C%20j'ai%20multipli%C3%A9%20la%20matrice%20avec%20%5B1%201%201%201%5D%20et%20ajout%C3%A9%20un%20indice%20%5B%20%3CFONT%20color%3D%22%23339966%22%3E1%3C%2FFONT%3E%20%5D.%20Il%20a%20ensuite%20%C3%A9t%C3%A9%20suivi%20de%20l'indice%20%3CFONT%20color%3D%22%233366FF%22%3EIndex%3C%2FFONT%3E%20.%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%3EJe%20pense%20que%20la%20valeur%20num%C3%A9rique%20r%C3%A9sultante%20de%20la%20matrice%204x1%20d'origine%20n'accepte%20aucun%20indice%20apr%C3%A8s%20%5B%20%3CFONT%20color%3D%22%23339966%22%3E1%3C%2FFONT%3E%20%5D.%20Ou%20cela%20pourrait%20%C3%AAtre%20%C3%A0%20nouveau%20d%C3%BB%20%C3%A0%20la%20r%C3%A9f%C3%A9rence%20ill%C3%A9gale%20(r%C3%A9cursion).%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-739088%22%20slang%3D%22de-DE%22%20mode%3D%22CREATE%22%3ERe%20%3A%20Somme%20cumul%C3%A9e%20des%20colonnes%20sans%20appeler%20la%20valeur%20de%20la%20ligne%20actuelle%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-739088%22%20slang%3D%22de-DE%22%20mode%3D%22CREATE%22%3E%3CP%3EJ'utiliserais%20des%20colonnes%20s%C3%A9par%C3%A9es%20pour%20%C3%A9viter%20toutes%20sortes%20de%20probl%C3%A8mes%2C%20mais%20je%20ne%20suis%20pas%20exactement%20s%C3%BBr%20de%20ce%20que%20vous%20essayez%20de%20r%C3%A9aliser%20car%20vous%20disposez%20de%20donn%C3%A9es%20compl%C3%A8tes%20dans%20votre%20exemple.%20Peut-%C3%AAtre%20quelque%20chose%20comme%20%C3%A7a%20si%20Col%20Cumulative%20Sum%20ne%20fonctionne%20pas%20pour%20vous%20(calculez%20la%20valeur%20en%20utilisant%20le%20d%C3%A9calage%20et%20la%20variable)%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-739086%22%20slang%3D%22de-DE%22%20mode%3D%22CREATE%22%3ERe%20%3A%20Somme%20cumul%C3%A9e%20des%20colonnes%20sans%20appeler%20la%20valeur%20de%20la%20ligne%20actuelle%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-739086%22%20slang%3D%22de-DE%22%20mode%3D%22CREATE%22%3E%3CP%3ESi%20j'ai%20bien%20compris%2C%20je%20pense%20que%20cela%20pourrait%20%C3%AAtre%20la%20solution%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-739085%22%20slang%3D%22de-DE%22%20mode%3D%22CREATE%22%3ERe%20%3A%20Somme%20cumul%C3%A9e%20des%20colonnes%20sans%20appeler%20la%20valeur%20de%20la%20ligne%20actuelle%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-739085%22%20slang%3D%22de-DE%22%20mode%3D%22CREATE%22%3E%3CP%3EAu%20moment%20o%C3%B9%20j'utilise%20(%3AWeek)%20dans%20ma%20formule%2C%20j'obtiens%20un%20probl%C3%A8me%20de%20r%C3%A9f%C3%A9rence%20ill%C3%A9gale.%20La%20ligne%20actuelle%20(%3ASemaine)%20n'a%20pas%20encore%20%C3%A9t%C3%A9%20enti%C3%A8rement%20calcul%C3%A9e.%20Je%20ne%20peux%20que%20rappeler%20(%3AWeek)%20de%20la%20ligne%20pr%C3%A9c%C3%A9dente%20en%20th%C3%A9orie.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-739084%22%20slang%3D%22de-DE%22%20mode%3D%22CREATE%22%3ERe%20%3A%20Somme%20cumul%C3%A9e%20des%20colonnes%20sans%20appeler%20la%20valeur%20de%20la%20ligne%20actuelle%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-739084%22%20slang%3D%22de-DE%22%20mode%3D%22CREATE%22%3E%3CP%3EVous%20pouvez%20d%C3%A9duire%20la%20valeur%20des%20semaines%20en%20cours%20de%20la%20somme%20cumul%C3%A9e%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%3ERe%20%3A%20Somme%20cumul%C3%A9e%20des%20colonnes%20sans%20appeler%20la%20valeur%20de%20la%20ligne%20actuelle%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-747478%22%20slang%3D%22de-DE%22%20mode%3D%22CREATE%22%3E%3CP%3EBonjour%2C%20j'ai%20beaucoup%20appris%20sur%20l'%C3%A9criture%20de%20scripts%20JSL%20gr%C3%A2ce%20au%20forum%20et%20en%20regardant%20des%20vid%C3%A9os%20de%20conf%C3%A9rences.%20J'ai%20une%20question%20compl%C3%A9mentaire%20concernant%20le%20script%20suivant.%20J'ai%20obtenu%20les%20m%C3%AAmes%20r%C3%A9sultats%20avec%20la%20deuxi%C3%A8me%20ligne.%20Puis-je%20savoir%20pourquoi%20vous%20choisiriez%20la%20premi%C3%A8re%20ligne%20plut%C3%B4t%20que%20la%20seconde%26nbsp%3B%3F%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%3EDe%20plus%2C%20existe-t-il%20un%20moyen%20d'%C3%A9viter%20de%20modifier%20la%20colonne%20%C2%AB%26nbsp%3BR%26nbsp%3B%C2%BB%20et%20de%20conserver%20les%20valeurs%20d'origine%26nbsp%3B%3F%20Je%20souhaite%20que%20les%20valeurs%20R%20modifi%C3%A9es%20restent%20dans%20la%20colonne%20%C2%AB%20Cas%20%C2%BB%20sans%20appara%C3%AEtre%20nulle%20part.%20J'ai%20essay%C3%A9%20d'attribuer%20un%20nom%20de%20variable%20diff%C3%A9rent%2C%20%22Rx%22%2C%20au%20R%20modifi%C3%A9%20comme%20ci-dessous.%20Cependant%2C%20cette%20approche%20m'oblige%20%C3%A0%20cr%C3%A9er%20une%20colonne%20vide%20nomm%C3%A9e%20%22Rx%22%20pour%20fonctionner.%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%3EUn%20grand%20merci%20d'avance%20pour%20votre%20temps%20et%20votre%20expertise.%3C%2FP%3E%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%3ERe%20%3A%20Somme%20cumul%C3%A9e%20des%20colonnes%20sans%20appeler%20la%20valeur%20de%20la%20ligne%20actuelle%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-747595%22%20slang%3D%22de-DE%22%20mode%3D%22CREATE%22%3E%3CP%3EVous%20avez%20sugg%C3%A9r%C3%A9%20que%20la%202e%20ligne%20est%20g%C3%A9niale.%20La%20raison%20pour%20laquelle%20j'utilise%20la%20syntaxe%20que%20j'ai%20utilis%C3%A9e%20n'est%20qu'une%20vieille%20habitude.%3C%2FP%3E%0A%3CP%3E%20%3C%2FP%3E%0A%3CP%3ELa%20fa%C3%A7on%20dont%20Rx%20peut%20%C3%AAtre%20utilis%C3%A9%20sans%20cr%C3%A9er%20de%20colonne%20vide%20est%20de%20l%E2%80%99utiliser%20comme%20r%C3%A9f%C3%A9rence%20de%20variable%20m%C3%A9moire.%20Voici%20le%20code%20pour%20faire%20%C3%A7a%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
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