Formula - Media settimanale per i primi tre trimestri in un annoCiao,
I dati vengono visualizzati su base giornaliera (lunedì - sabato). Ho convertito la data in giorni della settimana, settimane, mesi, trimestri, anni.
Iam sta cercando di ottenere il valore medio settimanale per il periodo dal 1 ° gennaio 2015 al 10/3/2015. Questo verrà visualizzato il 10/5/2015 e conterrebbe lo stesso valore per il resto dell'anno.
Quindi, in sostanza, è un valore medio settimanale per Q1 - Q3.
Penso di poterlo fare in una tabella, tuttavia sto cercando una formula su come farlo.
Qualsiasi aiuto sarebbe molto apprezzato.
Grazie,
Ri: Formula - Media settimanale per i primi tre trimestri in un annoLo farò assolutamente.
Grazie per tutto il tuo aiutoRi: Formula - Media settimanale per i primi tre trimestri in un annoSuggerisco di prendere ognuna delle funzioni di seguito, e cercarle nell'indice Scripting, e studiare gli esempi forniti per ciascuno di essi
Aiuto ==> Indice di scripting
Ecco la mia spiegazione della formula che ti ho passato
// Create a pointer to the data table so it can be referenced in the
// "Get Rows Where" function
dt = Current Data Table();
// The formula is applied to each row of the data table
// setting tYear equal to :Year sets the value of tYear to the
// Year for the current row. This is a little trick that allows
// for the "Get Rows Where" function to have something to compare to
tYear = :Year;
// For the current row, check to see if the current rows value of Date
// falls between January 1st and October 5th for the current year
If( Date MDY( 1, 1, :Year ) >= :date <= Date MDY( 10, 5, :Year ),
// If it is in between those dates then calculate the Mean of
// the column for Value where all the rows where Week is equal
// to the current row's value of week, and where all the rows where
// Year is equal to the current rows value of year
temp = Col Mean( :Value, :Week, :Year )
,
// If the current row's date isn't between the dates above, then
// find all of the rows where Week is equal to week 39, and year is
// equal to the row;'s current year. Then find the mean of those values
temp = Mean( :Value[dt << get rows where( :Week == 39 & tYear == :Year )] )
);
// The value that JMP returns to a formula is the last value exeuted in the formula
// Therefore, by placing the variable "temp" as the last thing seen, the
// calculated value of temp is what the formula value is
temp;Ri: Formula - Media settimanale per i primi tre trimestri in un annoCiao,
Sono nuovo di Jmp e della sua lingua. Se non ti dispiace che me lo chieda, potresti chiedermi di indicarmi la formula che hai elencato.
La formula ha funzionato e prodotto ciò di cui aveva bisogno per produrre, ma sto cercando di capirlo in inglese.
Ancora una volta, grazie per il tuo aiuto
Ri: Formula - Media settimanale per i primi tre trimestri in un annoGrazie,
I risultati erano leggermente diversi da quello che stavo cercando (ho ottenuto media settimana contro media per tutte le settimane da Q1 a Q3), e poi mi sono reso conto che i risultati prodotti dalla formula sono esattamente ciò di cui ho bisogno. La mia domanda originale avrebbe dovuto essere cambiata.
Apprezzo il tuo aiuto con questo.
Grazie mille.
Mi hai salvato un sacco di tempo
Ri: Formula - Media settimanale per i primi tre trimestri in un annoEcco una sceneggiatura che credo funzionerà ...... Non l'ho provato, ma penso che vedrete il concetto. L'unica ipotesi che ho fatto è stata la settimana lavorativa del 5 ottobre.
dt = Current Data Table();
tYear = :Year;
If( Date MDY( 1, 1, :Year ) >= :date <= Date MDY( 10, 5, :Year ),
temp = Col Mean( :Value, :Week, :Year ),
temp = Mean( :Value[dt << get rows where( :Week == 39 & tYear == :Year )] )
);
temp;
Ri: Formula - Media settimanale per i primi tre trimestri in un annoMi dispiace, ho dimenticato di dire che, all'inizio del nuovo anno, avrò valore 0 fino al quarto trimestre e poi ripeterò il processo con nuove serie di dati per quell'anno.
Grazie