Transform Templates - Boolean

This topic discusses application of the Transform panel with Tables on a boolean field in a table.   See the Transform panel and Transform Templates topics for use and for links to lists of templates for other data types for tables and use of the Transform panel with other components, such as Drawings and Images.

Tables, Boolean Types

And

Performs an AND operation on the source fields and puts the result into the target field.  

 

Preview: Put in Temp_Boolean the result of And using A_Boolean and B_Boolean.

il_trans_and.png

Areas

If the geom in the source field contains an area put a TRUE or 1 into the boolean target field.  If not, put a FALSE or 0 into the target.

 

Preview: Put in Temp_Boolean the result of Areas applied to Geom.

il_trans_areas_boolean.png

Between

If the source field value is between the specified upper and lower bounds, inclusive, put a TRUE or 1 into the boolean target field and if not equal put a  FALSE or 0 into the target.  The upper and lower bounds can be specified either by a field or by choosing Expression and then entering a number.

 

il_trans_between_boolean_dlg.png

Preview: Put in Temp_Boolean the result if the value in the Numbers field is Between the lower bound of the number in the Fractions and the Upper bound specified.  Instead of choosing a field for the Upper bound,  we click into the Upper bound box and choose Expression, and then we enter the number 12468.

il_trans_between_boolean.png

Note that in the fourth record the value of 12468 is equal to the upper bound specified so for that record Numbers is considered Between the lower bound of the value in Fractions and the specified upper bound of 12468.

Copy

Copy the source field into the target field.

 

Preview: Copy A_Boolean into Temp_Boolean.

il_trans_copy_boolean.png

Equal

Compare the two source fields.  If equal put a TRUE or 1 into the boolean target field and if not equal put a  FALSE or 0 into the target.

 

Preview: Put in Temp_Boolean the result of Equal comparing A_Boolean and B_Boolean.

il_trans_equal_boolean.png

Preview: Put in Temp_Boolean the result of Equal comparing Comment and Comment2.

il_trans_equal2_boolean.png

The Equal template works on all data types, such as two boolean fields in the first example and two nvarchar fields in the second example.  Because the result is a boolean it requires a boolean type as the target in the table and thus is listed in the Boolean templates for tables.  Note also that if one of the two source fields is a NULL, that is, not a determinable value, the result also is not determinable, a NULL.

Geoms with Curves

If the geom in the source field contains a curved segment put a TRUE or 1 into the boolean target field.  If not, put a FALSE or 0 into the target.

 

Preview: Put in Temp_Boolean the result of Geoms with Curves examining Geom.

il_trans_geom_curves.png

In the fifth record above, a geom specifying a line, the line object contains at least one curvilinear segment so a boolean True or 1 is written into the target for that record. None of the other objects are defined using any curvilinear segments so for those records a boolean False or 0 is put into the target.  See the Editing Drawings topic.

Geoms with Z

If the geom in the source field contains a Z value put a TRUE or 1 into the boolean target field.  If not, put a FALSE or 0 into the target.

 

Preview: Put in Temp_Boolean the result of Geoms with Z examining Geom.

il_trans_geom_z.png

In the table above those records with a geom specifying an area also contain a Z value so a boolean True or 1 is written into the target for those records. None of the other objects are defined with a Z value so for those records a boolean False or 0 is put into the target.  

Greater

If the source field is greater than the comparison field put a TRUE or 1 into the boolean target field and if not greater put a FALSE or 0 into the target.  The Compare to value can be specified either by a field or by choosing Expression and then entering a number.

 

il_trans_greater_boolean_dlg.png

 

Preview: Put in Temp_Boolean the result if Numbers is Greater than Fractions.

il_trans_greater_boolean.png

Note the result for the fifth record is false since being equal is not the same as being greater than.

Greater or Equal

If the source field is greater than or equal to the comparison field put a TRUE or 1 into the boolean target field and if not greater or equal put a FALSE or 0 into the target.

 

Preview: Put in Temp_Boolean the result if Numbers is Greater or Equal than Fractions.

il_trans_greater_equal_boolean.png

Note the result for the fifth record is true since being equal meets the condition of being greater than or equal to.

JSON Boolean

A means to extract boolean values that are embedded into JSON strings as the boolean value for a named JSON entity.  Scan the source field to find the specified name and if it exists and has a boolean value put the value into the target field.

 

il_trans_json_boolean3.png

 

The example table above has a field called JSON_Info that contains JSON strings which provide information about archaeological sites, for example, whether there are photos of the site and whether items other than coins were found at the site.   The JSON string for the first record above is:

 

{ "Site": "Krinkberg", "NonCoin": true, "Photo": false }

 

Some of the named entities have boolean values and some have string values.  Using the JSON Boolean template we can extract boolean values for those entities that have boolean values.

 

il_trans_json_boolean_dlg.png

Preview: Find the JSON Boolean for the name NonCoin within the field JSON_Info and put it into the boolean field  Bool.   We have first chosen Value from the pull down list for Name and then entered NonCoin.  Note that no quotes are used to set off the NonCoin string.

il_trans_json_boolean.png

The JSON string for the first record contains a boolean true value for NonCoin:

 

{ "Site": "Krinkberg", "NonCoin": true, "Photo": false }

 

The template therefore places true into the value of Bool for the first record.

 

il_trans_json_boolean_dlg2.png

 

Preview: Find the JSON Boolean for the name Photo within the field JSON_Info and put it into the boolean field  Bool.

il_trans_json_boolean2.png

Considering the JSON string for the first record:

 

{ "Site": "Krinkberg", "NonCoin": true, "Photo": false }

 

The template therefore places false into the value of Bool for the first record.

 

See the Example: Construct JSON String using Select and Transform topic for an example creating the table illustrated above.

Less

If the source field is less than the comparison field put a TRUE or 1 into the boolean target field and if not less put a FALSE or 0 into the target.

 

Preview: Put in Temp_Boolean the result if Numbers is Less than Fractions.

il_trans_less_boolean.png

Less or Equal

If the source field is less than or equal to the comparison field put a TRUE or 1 into the boolean target field and if not less or equal put a FALSE or 0 into the target.

 

Preview: Put in Temp_Boolean the result if Numbers is Less or Equal than Fractions.

il_trans_less_equal_boolean.png

Like

If the source field matches the Pattern put a TRUE or 1 into the boolean target field and if not put a FALSE or 0 into the target.  The Pattern (%_) box includes a reminder in the form of the (%_) part of the caption that wildcards as can be used with the SQL LIKE Operator may be used within the pattern.

 

il_trans_like_boolean_dlg.png

Preview: Put in Temp_Boolean the result if Comment2 is Like the pattern Menhir.  No quote characters are used around the string Menhir.

il_trans_like_boolean.png

Lines

If the geom in the source field contains a line put a TRUE or 1 into the boolean target field.  If not, put a FALSE or 0 into the target.

 

Preview: Put in Temp_Boolean the result of Lines examining Geom.

il_trans_lines_boolean.png

Maximum Value

Put a TRUE or 1 into the boolean target field if either of the two boolean source fields is TRUE or 1 and otherwise put a FALSE or 0 into the target.

 

Preview: Put in Temp_Boolean the result of Maximum Value comparing A_Boolean and B_Boolean.

il_trans_max_value_boolean.png

Minimum Value

Put a FALSE or 0 into the boolean target field if either of the two boolean source fields is FALSE or 0 and otherwise put a  TRUE or 1 into the target.

 

Preview: Put in Temp_Boolean the result of Minimum Value comparing A_Boolean and B_Boolean.

il_trans_min_value_boolean.png

Non-null Values

If the source field does not contain a NULL put a TRUE or 1 into the boolean target field and if not put a FALSE or 0 into the target.

 

Preview: Put in Temp_Boolean the result of Non-null Values for Comment2.

il_trans_is_notnull_boolean.png

Normalized Geoms

When normalizing geometry Manifold sets a flag to alert any subsequent processes the object has already been normalized.   This template checks the internal flag to see if geom values have been normalized.  If so, put a TRUE or 1 into the boolean target field and if not, put a FALSE or 0 into the target.

 

il_trans_normalize_geom1_boolean.png

Preview: Put in Temp_Boolean the result of Normalized Geoms applied to Geom.  None of the objects in the drawing have yet been normalized.

 

il_trans_normalize_geom2_boolean.png

We open the drawing, we select three objects and then we run the Normalize template with the Restrict to selection option checked.  That normalizes only the three selected objects.

 

il_trans_normalize_geom3_boolean.png

Clicking on the table to move the focus to the table, we click the Normalize Geoms template to see that the geometry for three selected records (which correspond to the three objects we selected in the drawing) has been normalized.

Not

Performs a NOT operation on the source fields and puts the result into the target field.

 

Preview: Put in Temp_Boolean the result of Binary Not using A_Boolean.

il_trans_not.png

Not Equal

Compare the two source fields.  If not equal put a TRUE or 1 into the boolean target field and if equal put a  FALSE or 0 into the target.

 

Preview: Put in Temp_Boolean the result of Not Equal comparing A_Boolean and B_Boolean.

il_trans_not_equal_boolean.png

Preview: Put in Temp_Boolean the result of Not Equal comparing Comment and Comment2.

il_trans_not_equal2_boolean.png

The Not Equal template works on all data types, such as two boolean fields in the first example and two nvarchar fields in the second example.  Because the result is a boolean it requires a boolean type as the target in the table and thus is listed in the Boolean templates for tables.  Note also that if one of the two source fields is a NULL, that is, not a determinable value, the result also is not determinable, a NULL.

Null Values

If the source field contains a NULL put a TRUE or 1 into the boolean target field and if not put a FALSE or 0 into the target.

 

Preview: Put in Temp_Boolean the result of Null Values for Comment2.

il_trans_is_null_boolean.png

Or

Performs an OR operation on the source fields and puts the result into the target field.

 

Preview: Put in Temp_Boolean the result of Binary Or using A_Boolean and B_Boolean.

il_trans_or.png

Points

If the geom in the source field contains a point put a TRUE or 1 into the boolean target field.  If not, put a FALSE or 0 into the target.

 

Preview: Put in Temp_Boolean the result of Points examining Geom.

il_trans_points_boolean.png

Text Contains

If the source field contains a match to specified text put a TRUE or 1 into the boolean target field and if not put a FALSE or 0 into the target.

 

il_trans_text_contains_boolean_dlg.png

Preview: Put in Temp_Boolean the result of Text Contains applied to Comment using the text des.  No quote characters are used to set off the des string.

il_trans_text_contains_boolean.png

Text Contains, Intl

Same as Text Contains but with optional specification of the language used.

Text Ends with

If the source field ends with the specified text put a TRUE or 1 into the boolean target field and if not put a FALSE or 0 into the target.

 

il_trans_text_ends_with_boolean_dlg.png

Preview: Put in Temp_Boolean the result of Text Ends with applied to Comment using the text es.  No quote characters are used to set off the es string.

il_trans_text_ends_with_boolean.png

Text Ends with, Intl

Same as Text Ends with but with optional specification of the language used.

Text Matches Regexp

If the source field matches the specified regular expression put a TRUE or 1 into the boolean target field and if not put a FALSE or 0 into the target.

 

il_trans_text_matches_regexp_boolean_dlg.png

Preview: Put in Temp_Boolean the result of Text Contains applied to Comment using the pattern .*de.*.  No quote characters are used to set off the regular expression .*de.* string.

il_trans_text_matches_regexp_boolean.png

The regular expression matches any sequence of zero or more characters followed by a de and then one or more characters of any kind.  For example, it matches any text value that has a de or a des somewhere in the text (but not a de at the very end).  The second and fourth records do not have a de anywhere so they result in a FALSE or 0 being put into the target.

Text Sounds like

If the source field sounds like the specified text put a TRUE or 1 into the boolean target field and if not put a FALSE or 0 into the target.

 

il_trans_text_sounds_like_boolean_dlg.png

Preview: Put in Temp_Boolean the result of Text Sounds like applied to Comment2 using the text menhere.  No quote characters are used to set off the menhere string.

il_trans_text_sounds_like_boolean.png

The template's function uses a Soundex algorithm to determine if the pronunciation of two text strings in English language would be similar despite slight variations in spelling.  Although intended for English it will frequently work well enough in some other languages to be useful. This example shows a useful match even though the contents of the source field are clearly in French language.

Text Starts with

If the source field starts with the specified text put a TRUE or 1 into the boolean target field and if not put a FALSE or 0 into the target.

 

il_trans_text_starts_with_boolean_dlg.png

Preview: Put in Temp_Boolean the result of Text Starts with applied to Comment using the text Dolmens.  No quote characters are used to set off the Dolmens string.

il_trans_text_starts_with_boolean.png

Text Starts with, Intl

Same as Text Starts with but with optional specification of the language used.

Xor

Performs an XOR operation on the source fields and puts the result into the target field.

 

Preview: Put in Temp_Boolean the result of Binary Xor using A_Boolean and B_Boolean.

il_trans_xor.png

 

See Also

Contents Pane

 

Transform

 

Contents - Transform

 

Transform Templates

 

Transform Templates - Drawings

 

Transform Templates - Images

 

Transform Templates - Binary

 

Transform Templates - Datetime

 

Transform Templates - Geom

 

Transform Templates - Numeric

 

Transform Templates - Text

 

Transform Templates - Tile