Ciao a tutti!
Come utilizzare JSL o una formula per convertire il testo della colonna 1 nel formato dell'ora della colonna 2.
Grazie!

Ecco un formato che funzionerà con gli esempi che hai fornito.Dovrà essere ottimizzato per altre combinazioni di valori e struttura.In allegato è una tabella di dati di esempio con la formula applicata
If( Row() == 1,
moList = {"January", "February", "March", "April", "May", "June", "July",
"August", "September", "October", "November", "December"};
moAbvList = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep",
"Oct", "Nov", "Dec"};
);
If(
Word( 3, :Mdfc, " /-" ) == "",
theDay = Num( Substr( :Mdfc, 1, 2 ) );
theMonth = Contains( moAbvList, Substr( :Mdfc, 4, 3 ) );
theYear = Num( Word( -1, :Mdfc, "abcdefghijklmnopqrstuvwxyz" ) );
Show( theday, themonth, theyear, Substr( :Mdfc, 4, 3 ) );,
Is Missing( Num( Word( 2, :Mdfc, " /-" ) ) ) == 1,
theDay = Num( Word( 1, :Mdfc, " /-" ) );
theMonth = Contains( moList, Word( 2, :Mdfc, " /-" ) );
theYear = Num( Word( 3, :Mdfc, " /-" ) );,
Is Missing( Num( Word( 1, :Mdfc, " /-" ) ) ) == 1,
theDay = Num( Word( 2, :Mdfc, " /-" ) );
theMonth = Contains( moList, Word( 1, :Mdfc, " /-" ) );
theYear = Num( Word( 3, :Mdfc, " /-" ) );,
theDay = Num( Word( 2, :Mdfc, " /-" ) );
theMonth = Num( Word( 1, :Mdfc, " /-" ) );
theYear = Num( Word( 3, :Mdfc, " /-" ) );
);
Date MDY( theMonth, theDay, theYear );Questo è lo stile, grazie!
L'effetto è lo stesso:
format(x, "y/m/d") ———— format(x, "aaaaammgg")
IL Formato() La funzione viene utilizzata per convertire a Valore data, ora o data/ora di JMP a una stringa di testo.
Per esempio:
x=informat("20000214");
show(format(x, "m/d/y"));
show(format(x, "d/m/y"));
show(format(x, "Date Long"));
show(format(x, "Monddyyyy"));
Risultati in questo nel registro:
Format(x, "m/d/y") = "02/14/2000";
Format(x, "d/m/y") = "14/02/2000";
Format(x, "Date Long") = "Monday, February 14, 2000";
Format(x, "Monddyyyy") = "Feb142000";
In che modo JMP può ottenere il testo dell'anno, del mese e del giorno dal formato della data?
Scusa se ti disturbo ancora, grazie!

@txnelson La formula di funzionerà ma c'è anche una formula leggermente più semplice che funzionerà.

Questo usa Informazioni() per convertire i valori di data e ora.
Informat( Word( 1, :Column 1 ) ) +Informat( Word( 2, :Column 1 ), "h:m" )
Ecco la formula per la conversione
Date DMY(
Num( Substr( :date, 7, 2 ) ),
Num( Substr( :date, 5, 2 ) ),
Num( Substr( :date, 1, 4 ) ) ) +
60 * 60 * Num( Word( 2, :date, " :" ) ) +
60 * Num( Word( -1, :date, " :" ) )