conditional expression in spreadsheet

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!
Post Reply
garya
Posts: 412
Joined: Tue Nov 20, 2018 1:00 am
Location: Ovando, MT, USA

conditional expression in spreadsheet

Post by garya »

Probably something stupid, but I can't get the following to work as an expression in a spreadsheet (Mdl, NumWells_A,B are cell aliases):

Code: Select all

= (Mdl == 4) ? NumWells_A : NumWells_B
Do relationals not work in spreadsheets in v 0.18?
If not, do they work in 0.19?

OS: FreeBSD 11.3-RELEASE-p12
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.0.18.4
Build type: Release
Python version: 3.7.8
Qt version: 5.14.2
Coin version: 4.0.0
OCC version: 7.4.0.beta
Locale: C/Default (C)

Thanks,
Gary
drmacro
Veteran
Posts: 8979
Joined: Sun Mar 02, 2014 4:35 pm

Re: conditional expression in spreadsheet

Post by drmacro »

Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
chrisb
Veteran
Posts: 54177
Joined: Tue Mar 17, 2015 9:14 am

Re: conditional expression in spreadsheet

Post by chrisb »

It works here in 0.19 if I omit the brackets around the condition.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
garya
Posts: 412
Joined: Tue Nov 20, 2018 1:00 am
Location: Ovando, MT, USA

Re: conditional expression in spreadsheet

Post by garya »

Thanks both for the replies. It appears the parens around the expression screw things up.
I will make a note in the docs.
chrisb
Veteran
Posts: 54177
Joined: Tue Mar 17, 2015 9:14 am

Re: conditional expression in spreadsheet

Post by chrisb »

There is a pull request concerning expressions from realthunder in the queue, which may fix this. Can somebody who has his branch installed please test this?
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Syres
Veteran
Posts: 2898
Joined: Thu Aug 09, 2018 11:14 am

Re: conditional expression in spreadsheet

Post by Syres »

chrisb wrote: Wed Sep 23, 2020 6:07 am There is a pull request concerning expressions from realthunder in the queue, which may fix this. Can somebody who has his branch installed please test this?
I've tested with ExprCompleter branch and it works with the brackets omitted:

Code: Select all

=Mdl == 4 ? NumWells_A : NumWells_B
OS: Windows 7 SP 1 (6.1)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.21652 +28 (Git)
Build type: Release
Branch: ExprCompleter
Hash: a1c4e0c86da1058a8e39f3d67df704ecde654708
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/United Kingdom (en_GB)
garya
Posts: 412
Joined: Tue Nov 20, 2018 1:00 am
Location: Ovando, MT, USA

Re: conditional expression in spreadsheet

Post by garya »

Syres wrote: Wed Sep 23, 2020 4:30 pm I've tested with ExprCompleter branch and it works with the brackets omitted:

Code: Select all

=Mdl == 4 ? NumWells_A : NumWells_B
The issue is not without the quotes; it's *with* the quotes
Post Reply