Bug 105683 - Allow expressions with references in inline arrays, not only constants
Summary: Allow expressions with references in inline arrays, not only constants
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
(earliest affected) rc
Hardware: All All
: medium enhancement
Assignee: Not Assigned
Depends on:
Blocks: Cell-Reference
  Show dependency treegraph
Reported: 2017-02-01 21:52 UTC by mpb
Modified: 2020-02-18 09:30 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Note You need to log in before you can comment on or make changes to this bug.
Description mpb 2017-02-01 21:52:14 UTC
Consider the following spreadsheet with 2 columns and 6 rows:

symbol      price
a           10
b           20
a           30
=DSUM ( A1:B4, "price", {"symbol";"a"} )
=DSUM ( A1:B4, "price", {"symbol";A2} )

The SearchCriteria of the first DSUM is hard coded to the value "a", and the expression evaluates correctly to 40.

The SearchCriteria of the second DSUM refers to the cell A2.  The value of A2 is "a".  However, this expression causes an error: "Err:512".

It would be nice if Calc could correctly evaluate the second DSUM expression.

Aside:  The second DSUM expression does evaluate correctly inside a GoogleDocs Spreadsheet.

Steps to Reproduce:
Recreate the example spreadsheet in the description.

Actual Results:  

Expected Results:

Reproducible: Always

User Profile Reset: No

Additional Info:

User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/53.0.2785.143 Chrome/53.0.2785.143 Safari/537.36
Comment 1 m.a.riosv 2017-02-02 00:41:09 UTC
It happens with all inner arrays, not only with DSUM.
Comment 2 Regina Henschel 2017-02-02 22:45:19 UTC
In LibreOffice inline arrays may only have constant number or constant string but no reference.

There is this note in the spec,
Note: Expression authors should be aware that use of Expression other than constant Number or constant String may impair interoperability.

Nevertheless it is allowed in ODF. Therefore a valid enhancement request.

I change the summary to reflect, that it is not a problem with the DSUM function but with inline arrays.
Comment 3 m.a.riosv 2017-02-03 00:56:06 UTC
Thanks for the light on the issue.
Comment 4 Alex Thurgood 2020-02-18 09:30:54 UTC
*** Bug 130722 has been marked as a duplicate of this bug. ***