こんにちは、みんな、
ご助力いただければ幸いです。「04/22/2025 11:16 AM」という形式の日付/時刻を持つ列から、経過時間(時間単位)を生成する新しい列を作成しようとしています。
ありがとう!
バーバラ
解決策を投稿していただけますか?JMPでデータを正しく日付形式に設定していれば、差は秒単位になりますので、3600で割るか時間単位(1)で計算して時間に変換できます。あるいは、形式を「期間」に変更するだけでも構いません。これは不要かもしれません(通常は秒単位で計算し、形式をいろいろと試してみるのが良いのですが、状況によって異なります)。以下はJSL形式の例です。
Names Default To Here(1);
dt = New Table("demo",
Add Rows(4),
Compress File When Saved(1),
New Column("Times",
Numeric,
"Continuous",
Format("ddMonyyyy h:m:s", 22, 0),
Input Format("ddMonyyyy h:m:s", 0),
Set Values([3830699241, 3830702820, 3830710041, 3830882841])
)
);
dt << New Column("Dif", Numeric, Continuous, Format("hr:m:s", 13, 0), Set Property("Units", "hr:m:s"), Formula(
Dif(:Times)
));

</CODE>For more complicated comparisons you can use <A href="https://help.jmp.com/help?keyword=JSL%20Date%20Difference&lang=en&os=win&source=application&version=18.2.0" target="_blank" rel="noopener noreferrer">日付差()</A>, in this case it would look something like this (note that the intervalName is "hour" and not "second" in this example)</P>
<PRE><CODE class=" language-jsl">Date Difference(
Lag(:Times),
:Times,
"hour",
"fractional"
);