Spreadsheet formula error on save/load

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
chrisb
Posts: 17489
Joined: Tue Mar 17, 2015 9:14 am

Spreadsheet formula error on save/load

Postby chrisb » Fri Mar 02, 2018 7:02 pm

When I enter the following formula in a spreadsheet e.g. in cell A2

Code: Select all

=A1 == 1 ? 1 : (A1 == 2 ? 2 : 3)
I get the result A2 equals A2 for values 1 and 2 and it is 3 for all other values.

Entering this formula removes immediately the brackets. The formula works still as described above.

However, if I save the file and reload it the formula looks like this:

Code: Select all

=(A1 == 1 ? 1 : A1) == 2 ? 2 : 3
which yields different values, e.g. a value of 1 in A1 yields 3 in A2 instead of 1.
I attach a file, but keep in mind, that you get the changed formula on loading.
Attachments
spreadsheetSaveReload.fcstd
(2.84 KiB) Downloaded 5 times
ulrich1a
Posts: 1872
Joined: Sun Jul 07, 2013 12:08 pm

Re: Spreadsheet formula error on save/load

Postby ulrich1a » Sat Mar 03, 2018 10:33 pm

I can confirm the issue. I made a bug-report: https://freecadweb.org/tracker/view.php?id=3363

The problem exist in the spreadsheet and in expressions, as they share the same library.

Ulrich