Bug 40835 - In ODF 1.2 FDIST has a 4th parameter "cumulative"
Summary: In ODF 1.2 FDIST has a 4th parameter "cumulative"
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: Other All
: medium enhancement
Assignee: Winfried Donkers
URL:
Whiteboard: odf target:4.4.2 target:4.5.0
Keywords:
Depends on: 81596
Blocks:
  Show dependency treegraph
 
Reported: 2011-09-13 07:11 UTC by wope
Modified: 2016-07-07 11:16 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description wope 2011-09-13 07:11:19 UTC
this is not implemented.
I'll try to do this
Comment 1 Jorendc 2014-06-25 08:21:17 UTC
Hi Winfried.

Sorry to bug you again, but might this one be fixed?
Following http://opengrok.libreoffice.org/xref/core/sc/source/ui/src/scfuncs.src#8515 this 'cumulative' is in the source code. The commit that added this is http://cgit.freedesktop.org/libreoffice/core/commit/?id=5a1fa549520aad341b1b8cfe59b1e1b6ed3e4164 but mentions it is about the Office 2010 excel compatibility. Does this excel and odf share the same code :-) (eg: is it fixed for ODF by that commit to?)

Thanks,
Joren
Comment 2 Winfried Donkers 2014-06-25 08:39:29 UTC
(In reply to comment #1)
Hi Joren,

The current Calc function FDIST is the ODF1.2 LEGACY.FDIST.
The ODF1.2 FDIST is not implemented as a 'calc' function, but as 'Excel 2010' function F.DIST.
So, the functionality is available ( 4.2 and up ).

ODF1.2 function names need not be identical to the function names in the user interface, its a document format standard. 

I will have a look if the function is saved cf. ODF1.2 in ods files and if necessary fix that.
Comment 3 Winfried Donkers 2014-06-25 11:59:03 UTC
F.DIST is not saved as ODF1.2 FDIST in ods files, so that needs to be fixed.
EXcel F.DIST has a mandatory 4th argument cumulative and ODF1.2 FDIST has an optional 4th argument; that needs fixing too.

This may take some time, I have other patches that need attention first.
Comment 4 Winfried Donkers 2014-07-21 11:40:01 UTC
Currently the xport to OOXML is broken (see fdo#81596), so I can't fix this bug report until that has been fixed.
Comment 5 Commit Notification 2014-12-09 16:29:23 UTC
Winfried Donkers committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=09e171656a85712d37338e653374ee15aef91591

fdo#40835 add 4th argument to FDIST when exporting to OOXML

It will be available in 4.5.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 6 Eike Rathke 2015-02-09 17:57:14 UTC
While checking to backport this also for 4-4 along with bug 81596 I found that exporting FDIST with 4 parameters is wrong. Also Excel expects 3 parameters for FDIST, only F.DIST expects 4. I'll revert the significant part of the patch.
Comment 7 Commit Notification 2015-02-09 20:00:16 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=5d3f89c0264b0bb8fbe750051ccc1c57c199f6ad

this FDIST has 3 parameters also in Excel, revert tdf#40835

It will be available in 4.5.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 8 Eike Rathke 2015-02-09 20:12:43 UTC
So, actually this is a request to properly implement the FDIST vs. LEGACY.FDIST vs. F.DIST madness ;-)
Comment 9 Winfried Donkers 2015-02-12 10:06:14 UTC
(In reply to Eike Rathke from comment #8)
> So, actually this is a request to properly implement the FDIST vs.
> LEGACY.FDIST vs. F.DIST madness ;-)

That is an understatement ;-)
There are 2 ODF functions (FDIST and LEGACY.FDIST) and 3 Excel functions (FDIST, F.DIST and F.DIST.RT).

In Calc, the current situation is:
Calc UI    ODF                      Excel
FDIST      LEGACY.FDIST             FDIST
F.DIST     COM.MICROSOFT.F.DIST     _xlfn.F.DIST
F.DIST.RT  COM.MICROSOFT.F.DIST.RT  _xlfn.F.DIST.RT
-          FDIST
(ODF's FDIST is not used)

I think the desired situation is:
Calc UI    ODF                     Excel
FDIST      COM.MICROSOFT.FDIST     FDIST
F.DIST     FDIST                   _xlfn.F.DIST     
F.DIST.RT  LEGACY.FDIST            _xlfn.F.DIST.RT
(in case of UI's F.DIST, on export to Excel add argument cum=true, if absent)

Implementing is not the problem, backward compatibility is.
I'll put this om the developer-mailinglist as other functions (at least (ISO)WEEKNUM and probably more Excel 2010  distribution functions) share the same problem.
Comment 10 Commit Notification 2015-03-10 15:59:06 UTC
Winfried Donkers committed a patch related to this issue.
It has been pushed to "libreoffice-4-4":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=237eb6d37a1c30c9c4907086f3dd895a2341d8ca&h=libreoffice-4-4

tdf#40835 add backward compatibility for ODFF function FDIST.

It will be available in 4.4.2.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 11 Commit Notification 2015-03-24 22:06:05 UTC
Winfried Donkers committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=f1f4167bac271f4b7f4ed766db4b077f94fd4daa

tdf#40835 add ODFF function FDIST

It will be available in 4.5.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.