- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Calcul duration between 2 dates
My name is Martin, I’m french, so would you please forgive my english.
I start jmp and I’m no talented with logiciels and computers, but I am motived to progress.
My question is simple :
How can I create a new variable « duration » (in month) between the difference of two variables (date begin/date end) in dd/mm/yy.
Thank you for your comprehension.
Sincerely,
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Calcul duration between 2 dates
The result of the Date Difference() function, is not a JMP DateTime. It is just the number of Months. So you need to set the format for the Diff Date to "Best", not a JMP DateTime format.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Calcul duration between 2 dates
Assuming your "date begin" and "date end" columns are valid JMP Date/Time values, then the new formula for calculating the difference is
Date Difference( :date begin, :date end, "month" )
Here is an image of the attached example data table that has the date begin and date end columns and a new column, Difference that uses the above formula
If your date begin and date end are Character columns and not JMP Date/Time columns, you will need to convert them to Date/Time columns before being able to calculate the difference. This can be done easily and has been covered multiple times in previous Discussion entries.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Calcul duration between 2 dates
Good information about JMP date, time, datetime, and duration columns here:
Using dates, times, datetimes and durations in JMP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Calcul duration between 2 dates
Hello txnelson,
I don't understand, I can not suceed.
Would you like to see my data table ?
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Calcul duration between 2 dates
I suspect that my Example data table confused the issue. I have attached a new example data table. It has 2 columns which represent the beginning date(date de début) and the ending date(date de fin). I assume that you have a data table that has such columns. All that needs to be done, is to then add a new column which in the example data table is called "Columne 3", which is the column that takes the beginning date and ending date columns and finds the difference.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Calcul duration between 2 dates
Nelson,
First, I appreciate et thank you your answer.
I try but I don't understand where is my mistake. I know it is very very very simple as problem....
But I really want to progress with jmp.
Here muy example to corrige even if you could.
Best regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Calcul duration between 2 dates
The result of the Date Difference() function, is not a JMP DateTime. It is just the number of Months. So you need to set the format for the Diff Date to "Best", not a JMP DateTime format.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Calcul duration between 2 dates
Thank you so much to help me to progress.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Calcul duration between 2 dates
I really appreciate your help.
I will try it.
Sincerely,