Xplan Xmerge Coding – Boolean fields

Xplan Quick Xplain

The third dimension of Boolean fields

3 states of Boolean fields

This Xmerge Quick Xplain looks at the 3 states of Boolean fields

Boolean fields are generally considered to only have two states: True or False.  Depending on what you are trying to achieve, taking advantage of the null or none state can be very handy.

  1. True: value = 1, text = Yes
  2. False: value = 0, text = No
  3. None: value=None, text=None

This can be good because often clients may consider data not entered to be ‘Not disclosed’ or ‘not provided’ – options which a Boolean field cannot include in its binary (Yes/No) drop down.  By considering the third state of None we can get our client their not disclosed option without having to consider alternatives such as using a new field, which has implications for existing data and moves us away from using standard system fields.

Boolean Coding

Historically if a Boolean field didn’t have a value assigned it would produce a blank result in your merge document so we could utilise coding like this:

<:if str($client.valueOf(‘will_exists’)) in [‘0′,’1’]:>
<:=$client.will_exists.text:>
<:else:>
Not disclosed
<:end:>

With the above coding we will always get Yes/No/Not Disclosed (or whatever the client wants to call this).

There may be times when you want to condition off all 3 states, in which case we might use:

<:if str($client.valueOf(‘will_exists’)) in [‘0′,’1’]:>
<:if str($client.valueOf(‘will_exists’)) in [‘1’]:>
Yes
<:else:>
No
<:end:>
<:else:>
Not disclosed
<:end:>

Earlier, I said historically, that’s because these days in newer versions of Xplan Boolean fields will always return a result Yes/No/None or depending on how you’ve coded it 1,0,None.  So there are no more blanks but chances are we still want to condition as ‘None’ doesn’t mean anything to a client or even staff members.

Choices, Choices

Even though we have this 3rd aspect of Boolean fields we can take advantage of, inherently you can now see how limiting they also are. 

When building larger documents that might a) capture important information (client or compliance) or when building fields that can directly go into the output consider if a choice field might not be the better approach for improved flexibility in the future.  Data capture needs and clients change their minds over time, by using a choice field you give them that flexibility.

Matthew Townsend
Xplan Consultant and Developer | Wealth Management Technologist at Create Something
Matthew is an experienced and innovative Xplan consultant and developer, having worked on and developed some of the largest advice projects in the industry. Passionate about building great experiences in xplan that enable businesses and clients to get the most out of this powerful software.

Matthew Townsend

Matthew is an experienced and innovative Xplan consultant and developer, having worked on and developed some of the largest advice projects in the industry. Passionate about building great experiences in xplan that enable businesses and clients to get the most out of this powerful software.

This Post Has 2 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *