Conditional Expression (spreadsheet etc)

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
paullee
Veteran
Posts: 5098
Joined: Wed May 04, 2016 3:58 pm

Conditional Expression (spreadsheet etc)

Post by paullee »

Hi there,

I am digging into documentation about Conditional Expression in Wiki and trying to build one without success, wiki indicates -

'The conditional statement works like this: = condition ? resultTrue : resultFalse
The condition is defined as an expression that evaluates to either 0 (for false) or non-zero for true. The following comparison operators are defined: ==, !=, >, <, >=, and <=. "


I am trying in spreadsheet and my all attempts return errors. Any ideas?

Does it have any difference to use it in Spreadsheet or anywhere as an Expression in any Data Field as Formula?

Thanks.
Screenshot from 2017-03-25 07-06-52.png
Screenshot from 2017-03-25 07-06-52.png (146.12 KiB) Viewed 2760 times
Attachments
Test _ Conditional Expression.fcstd
(7.23 KiB) Downloaded 85 times
User avatar
salp
Posts: 250
Joined: Thu Nov 21, 2013 11:58 pm
Location: Putnam, NY

Re: Conditional Expression (spreadsheet etc)

Post by salp »

First, please include the information on which FreeCad version you are using.

You are entering the equation wrong, the correct format is "=A1 == 1 ? 1 : 0"

OS: Linux Mint 18 Sarah
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.10611 (Git)
Build type: None
Branch: master
Hash: 44a9ecd25f27ec3efe52c9de9c95ef2b3e19dd17
Python version: 2.7.12
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.1.0
paullee
Veteran
Posts: 5098
Joined: Wed May 04, 2016 3:58 pm

Re: Conditional Expression (spreadsheet etc)

Post by paullee »

salp wrote:First, please include the information on which FreeCad version you are using.

You are entering the equation wrong, the correct format is "=A1 == 1 ? 1 : 0"
Really thanks for the hint! I am moving on building my solution.
Post Reply