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-826802%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ECome%20posso%20fare%20in%20modo%20che%20la%20funzione%20Lag%20venga%20%22reimpostata%22%20con%20ogni%20nuovo%20batch%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-826802%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3ECiao%2C%3C%2FP%3E%3CP%3EHo%20i%20seguenti%20dati%20e%20voglio%20usare%20la%20funzione%20Lag%20per%20calcolare%20la%20differenza%20tra%20ogni%20risultato%20e%20il%20risultato%20precedente%20(la%20tabella%20dei%20dati%20%C3%A8%20allegata%20anche%20a%20questo%20messaggio).%3C%2FP%3E%3CP%3ESto%20utilizzando%20JMP%2016.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22jgross_2-1736542505146.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22jgross_2-1736542505146.png%22%20style%3D%22width%3A%20246px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22jgross_2-1736542505146.png%22%20style%3D%22width%3A%20246px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22jgross_2-1736542505146.png%22%20style%3D%22width%3A%20246px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22jgross_2-1736542505146.png%22%20style%3D%22width%3A%20246px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22jgross_2-1736542505146.png%22%20style%3D%22width%3A%20246px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F71841i5F4F56B3D78F55ED%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22jgross_2-1736542505146.png%22%20alt%3D%22jgross_2-1736542505146.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EAttualmente%20sto%20utilizzando%20la%20seguente%20formula%20nella%20colonna%20%22Differenza%22%3A%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22jgross_0-1736542408545.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22jgross_0-1736542408545.png%22%20style%3D%22width%3A%20285px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22jgross_0-1736542408545.png%22%20style%3D%22width%3A%20285px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22jgross_0-1736542408545.png%22%20style%3D%22width%3A%20285px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22jgross_0-1736542408545.png%22%20style%3D%22width%3A%20285px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22jgross_0-1736542408545.png%22%20style%3D%22width%3A%20285px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F71839i66022B4EC7E17064%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22jgross_0-1736542408545.png%22%20alt%3D%22jgross_0-1736542408545.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3ECi%C3%B2%20che%20non%20riesco%20a%20capire%20%C3%A8%20come%20far%20s%C3%AC%20che%20il%20calcolo%20venga%20%22resettato%22%20una%20volta%20arrivato%20al%20Batch%20B.%20Mi%20rendo%20conto%20che%20anche%20con%20la%20mia%20formula%20attuale%2C%20solo%20il%20valore%20della%20differenza%20nella%20riga%2016%20%C3%A8%20errato%2C%20ma%20saprei%20comunque%20come%20impostare%20la%20formula%20in%20modo%20che%20funzioni%20correttamente%20all'interno%20dei%20batch.%3C%2FP%3E%3CP%3EQualcuno%20ha%20dei%20suggerimenti%3F%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EJeff%3C%2FP%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-826802%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3EAnalisi%20e%20modellazione%20dei%20dati%20di%20base%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-826812%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ER%3A%20Come%20posso%20fare%20in%20modo%20che%20la%20funzione%20Lag%20venga%20%22reimpostata%22%20con%20ogni%20nuovo%20batch%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-826812%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3Ecambia%20la%20tua%20formula%20in%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3EIf(%20%3A%22Time%20Point%20(months)%22n%20%3D%3D%200%2C%0A%09.%2C%0A%09%3AResult%20-%20Lag(%20%3AResult%20)%0A)%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-826813%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ER%3A%20Come%20posso%20fare%20in%20modo%20che%20la%20funzione%20Lag%20venga%20%22reimpostata%22%20con%20ogni%20nuovo%20batch%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-826813%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%C3%88%20anche%20possibile%20utilizzare%20la%20media%20mobile%20delle%20colonne%20per%20ottenere%20il%20valore%20precedente%20(%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2FDiscussions%2FData-preparation-substract-column-data-by-other-column%2Fm-p%2F762950%23U762950%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%3Epreparazione%20dei%20dati%3A%20sottrazione%20dei%20dati%20della%20colonna%20da%20un'altra%20colonna%3C%2FA%3E%20)%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3E%3AResult-%20(Col%20Moving%20Average(%3AResult%2C%201%2C%201%2C%200%2C%20%3ALot%20Number)%20*%202%20-%20%3AResult)%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3Ema%20nel%20tuo%20caso%20usare%20qualcosa%20come%20suggerito%20da%20Jim%20%C3%A8%20molto%20probabilmente%20meglio.%20Inoltre%20c'%C3%A8%20la%20funzione%20Dif%20che%20puoi%20usare%20al%20posto%20di%20Lag%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3EIf(%20%3A%22Time%20Point%20(months)%22n%20%3D%3D%200%2C%0A%09.%2C%0A%09Dif(%3AResult%2C%201)%0A)%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-826826%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ER%3A%20Come%20posso%20fare%20in%20modo%20che%20la%20funzione%20Lag%20venga%20%22reimpostata%22%20con%20ogni%20nuovo%20batch%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-826826%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EGrazie%20per%20le%20risposte%20rapide%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F2687%22%20target%3D%22_blank%22%3E%40txnelson%3C%2FA%3E%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F14366%22%20target%3D%22_blank%22%3E%40jthi%3C%2FA%3E%3C%2FP%3E%3CP%3EMolto%20apprezzato!!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-826840%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ER%3A%20Come%20posso%20fare%20in%20modo%20che%20la%20funzione%20Lag%20venga%20%22reimpostata%22%20con%20ogni%20nuovo%20batch%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-826840%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3ESe%20hai%20bisogno%20di%20tali%20operazioni%20%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3Edi%20ritardo%3C%2FFONT%3E%20raggruppate%20frequentemente%2C%20potresti%20dare%20un'occhiata%20a%3CBR%20%2F%3E%20%3CA%20href%3D%22https%3A%2F%2Fmarketplace.jmp.com%2Fappdetails%2FNormalization%2BGUI%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fmarketplace.jmp.com%2Fappdetails%2FNormalization%2BGUI%3C%2FA%3E%20nel%20Marketplace.%3CBR%20%2F%3E%3CBR%20%2F%3E%20Ha%20implementato%20l'N-1%20in%20combinazione%20con%20il%20raggruppamento%20basato%20sull'approccio%20di%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F14366%22%20target%3D%22_blank%22%3E%40jthi%3C%2FA%3E%20%3A%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22hogi_0-1736585657173.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22hogi_0-1736585657173.png%22%20style%3D%22width%3A%20269px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F71851iD016D41706668FF7%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22hogi_0-1736585657173.png%22%20alt%3D%22hogi_0-1736585657173.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3ECi%20vuole%20un%20po'%20di%20fatica%20per%20ricordare%20la%20sintassi%20esatta%20%3A%20)%3C%2FP%3E%3CP%3EInoltre%2C%20la%20piattaforma%20gestisce%20automaticamente%20le%20righe%20%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3Eescluse%3C%2FFONT%3E%20.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Choose Language Hide Translation Bar
jeff_gross
Level I

How Can I Get The Lag Function to "Reset" With Each New Batch?

Hello, 

I have the following data and I want to use the Lag function to calculate the difference between each result and the result prior to it (the data table is also attached to this message).

I am using JMP 16.

 

jgross_2-1736542505146.png

Currently I'm using the following formula in the "Difference" column:

jgross_0-1736542408545.png

What I can't figure out is how to get the calculation to "reset" once it gets to Batch B. I realize that even with my current formula, only the difference value in row 16 is incorrect, but still I would know to setup the formula so that it works properly within batches.

Does anyone have any suggestions?

 

Jeff

 

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: How Can I Get The Lag Function to "Reset" With Each New Batch?

change your formula to

If( :"Time Point (months)"n == 0,
	.,
	:Result - Lag( :Result )
)

 

Jim

View solution in original post

4 REPLIES 4
txnelson
Super User

Re: How Can I Get The Lag Function to "Reset" With Each New Batch?

change your formula to

If( :"Time Point (months)"n == 0,
	.,
	:Result - Lag( :Result )
)

 

Jim
jeff_gross
Level I

Re: How Can I Get The Lag Function to "Reset" With Each New Batch?

Thank you for the quick replies @txnelson @jthi 

Much appreciated!!

hogi
Level XII

Re: How Can I Get The Lag Function to "Reset" With Each New Batch?

If you need such grouped lag operations frequently, you might have a look at 
https://marketplace.jmp.com/appdetails/Normalization+GUI in the Marketplace.

It implemented the N-1 in combination with grouping based on  @jthi 's approach:

hogi_0-1736585657173.png

 

This takes the pain to remember the exact syntax : )

In addition, the Platform handles Excluded rows automatically.

jthi
Super User

Re: How Can I Get The Lag Function to "Reset" With Each New Batch?

You can also utilize Col Moving Average to get the previous value (Data preparation- substract column data by other column )

:Result- (Col Moving Average(:Result, 1, 1, 0, :Lot Number) * 2 - :Result)

but in your case using something like Jim suggested is most likely better. Also there is Dif function you can use instead of Lag

If( :"Time Point (months)"n == 0,
	.,
	Dif(:Result, 1)
)
-Jarmo