Bug 93685 - WORKDAYINTL function has a new parameter that make old spreadsheet in error
Summary: WORKDAYINTL function has a new parameter that make old spreadsheet in error
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
5.0.0.5 release
Hardware: All All
: medium major
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2015-08-26 16:19 UTC by Rpnpif
Modified: 2015-09-19 13:12 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
A calc file with WORKDAY function from LO 4.4 (38.74 KB, application/vnd.oasis.opendocument.spreadsheet)
2015-08-27 14:46 UTC, Rpnpif
Details
Formula differ from Tips (100.08 KB, image/png)
2015-09-08 13:28 UTC, Jacques Guilleron
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rpnpif 2015-08-26 16:19:42 UTC
The WORKDAYINTL (named WORKDAY in the help?) from LO 4 has this schema :
WORKDAY(StartDate; Days; Holidays).

But in LO 5.0.1, it has this schema :
WORKDAY(StartDate; Days; number or strings; array) with array matching with Holydays in fact. A new parameter (number or strings) was created.

So old spreadsheet have errors because Holidays are arrays and number or strings are required with another meaning.

To  assure compatibility, the 4th parameter should be in the 3th position.

More, the English labels in the Function wizard are not clear ("number or string" and "array").

It is a bug that make obsolete all spreadsheet that use this parameters.

So please, fix as soon as possible.
Comment 1 Rpnpif 2015-08-26 16:34:31 UTC
Exist in 5.0.0.5.
Comment 2 Eike Rathke 2015-08-26 16:36:36 UTC
@Rpnpif:
Could you attach such a failing document, NOT saved with 5.0 but last saved with 4.x?
Comment 3 Rpnpif 2015-08-27 14:46:45 UTC
Created attachment 118222 [details]
A calc file with WORKDAY function from LO 4.4
Comment 4 Rpnpif 2015-08-27 14:47:44 UTC
My normal locale is fr_FR.UTF-8.
When I run :
LANG=C libreoffice4.4 Plan\ d_annee_2.ods
the function is named WORKDAY.

But if I run :
LANG=C libreoffice5.0 Plan\ d_annee_2.ods
the function is named WORKDAYINTL.

Is it normal ?
Comment 5 Rpnpif 2015-08-27 14:55:55 UTC
> LANG=C libreoffice4.4 Plan\ d_annee_2.ods

I think you have understand that I use Debian Linux and this command is typed in a X terminal. But this issue probably exists on another OS.

Regards.
Comment 6 MM 2015-09-03 18:40:56 UTC
I think WORKDAYINTL got fixed, now with 4 arguments instead of 3, to be better compatible with excel.
Comment 7 Rpnpif 2015-09-04 13:00:02 UTC
(In reply to MM from comment #6)
> I think WORKDAYINTL got fixed, now with 4 arguments instead of 3, to be
> better compatible with excel.

I understand but this make WORKDAYINTL now incompatible with the files created with LO 4.4 or older.

As in Excel, why not keep both WORKDAY with the old schema (3 arguments) and WORKDAY.INTL (not WORKDAYINTL) for new schema (4 arguments) ? Today, WORKDAYINTL replaces WORKDAY for the international (and English?) language.

Another alternative more versatile should be to detect the old schema or the new schema, basing on the type of the arguments to assure compatibility with earlier LO. I do not known if this is possible.
Comment 8 Rpnpif 2015-09-04 13:10:57 UTC
This issue seems to be more complicated.

I see that both WORKDAY and WORKDAY.INTL exist in Excel. But in LO 5, WORKDAYINTL replaces WORKDAY. So I think that the compatibility with Excel is not fixed. Am I right ?

My source : http://excelunplugged.com/2015/01/27/workday-and-workday-intl-in-excel/
Comment 9 Rpnpif 2015-09-04 15:40:16 UTC
Oh! This issue is fixed for me in LO 5.0.1.1 that I found only few minutes before.

I tried LO5.0.1 RC1 but without success.

Thank you!
Comment 10 Rpnpif 2015-09-04 18:00:43 UTC
Sorry, but this issue was not fixed. After removing LO, and install another time, this bug is still present. I do not understand why.
Comment 11 Robinson Tryon (qubit) 2015-09-04 19:13:27 UTC
(In reply to Rpnpif from comment #0)
> So old spreadsheet have errors because Holidays are arrays and number or
> strings are required with another meaning.
> 
> To  assure compatibility, the 4th parameter should be in the 3th position.

Sounds quite problematic.

(In reply to Rpnpif from comment #4)
> My normal locale is fr_FR.UTF-8.
> When I run :
> LANG=C libreoffice4.4 Plan\ d_annee_2.ods
> the function is named WORKDAY.
> 
> But if I run :
> LANG=C libreoffice5.0 Plan\ d_annee_2.ods
> the function is named WORKDAYINTL.

It's not quite clear to me how I should go about reproducing this issue. Could you please provide an enumerated list of steps that one can follow?

Status -> NEEDINFO
Comment 12 Rpnpif 2015-09-05 15:27:43 UTC
(In reply to Robinson Tryon (qubit) from comment #11)
> It's not quite clear to me how I should go about reproducing this issue.
> Could you please provide an enumerated list of steps that one can follow?

I agree with you, my explanation was not clear because this issue seems to have changed with LO5.0.1 after 5.0.0. WORKDAY that was replaced by WORKDAYINTL seems to be come back.

So, I use LO 5.0.1 on Debian Wheezy Linux. My locale are LANG=fr_FR.UTF-8. Note that LO on MS Windows has a similar issue but not exactly the same (see below).

1. Open the file in attachment in a terminal :
/opt/libreoffice5.0/program/soffice Plan\ d_annee_2.ods
2. Select B6.
3. Click on the icon Fx (Assistant Fonctions, the function wizard).
4. Click in the zone Formule, on the name SERIE.JOUR.OUVRE. Above the argument are : Date initiale, Jours, nombre de chaînes, matrice. Note that is the type of the argument, not their names and there are four arguments.
5. Click on OK without modifying nothing. Now an error 502 appear.in the cells that contain SERIE.JOUR.OUVRE. No good reason for this error.

Now with the English version of LO 5.0.1 on Debian Linux.
1. Open the file in attachment in a terminal :
LANG=C /opt/libreoffice5.0/program/soffice Plan\ d_annee_2.ods
2. Select B6.
3. Click on the icon Fx (the function wizard).
4. Click in the zone Formula, on the name WORKDAY, the arguments are Start date, Days, Holidays as in LO 4.4.
5. Click on OK. All works fine, no error.

So I think that the French version of LO 5.0.1.2 has errors that are not in the English version.

On MS Windows, with the French version, the arguments are translated as : date initiale, jours and Congés et fêtes (should be the same as on Linux). So, with three arguments but clicking on OK get the same error 502.

I hope that my explanation is more clear.

Regards.
Comment 13 Jacques Guilleron 2015-09-06 10:14:50 UTC
Hi,

* So I think that the French version of LO 5.0.1.2 has errors that are not in the * English version.

Right. In french UI, function wizard, Functions tab, Date&Time category, there's two different functions named SERIE.JOUR.OUVRE. INTL is missing to the end of the second one. I reported that on the french qa list. This is corrected now and will be available in master, next LO 4.4 and 5.0.
With Windows 7 Home Prmeium, only the first function is available. Selecting the second one send back to the first one, so only three arguments. Error 502 comes from the fact you are adding a fourth argument.
Comment 14 Rpnpif 2015-09-06 11:03:24 UTC
(In reply to Jacques Guilleron from comment #13)
Thank you for this good news.
Error 502 does not come from the fact I am adding a fourth argument because I used only three arguments to SERIE.JOUR.OUVRE. Look well in the attached file.

Cordialement,
Comment 15 Joel Madero 2015-09-06 16:44:57 UTC
With Comment 14 it seems like Comment 13 is describing a separate issue. Moving this back to UNCONFIRMED.
Comment 16 Jacques Guilleron 2015-09-08 13:28:41 UTC
Created attachment 118523 [details]
Formula differ from Tips
Comment 17 Jacques Guilleron 2015-09-08 14:13:57 UTC
Hi Rpnpif,

To confirm what you said:
Since LO 4.3, in the french UI, due to the fact that two functions have the same name, when using SERIE.JOUR.OUVRE, formula displayed (Workday) and formula registered (Workday.intl) in the file differ, as shows it the screen shot.
A double semicolon can be used for the third argument to get the correct displaying, but this will be to correct when the fix will be applied.

Jacques
Comment 18 Jacques Guilleron 2015-09-19 08:37:27 UTC
Works fine now with 
LO 5.0.2.2 Build ID: 37b43f919e4de5eeaca9b9755ed688758a8251fe 
Locale : fr-FR (fr_FR)
& Windows 7 Home Premium

Have a fine day
Comment 19 Rpnpif 2015-09-19 13:12:05 UTC
It works fine also with Debian Linux 8 (Jessie).

Thanks.