XTools Website

 

Table Restructure: Using expressions

 

 

Restructuring tables you have an option to apply expressions to the source fields.

Expressions can be used while restructuring tables in case if you use source fields and wish to apply transformations to them in order to come up with new field values or new geometry. In some way expressions can be considered as ArcMap field calculations, they have almost the same set of functions but can be applied on the fly to the table fields being restructured.

Another advantage of expressions is that they can be applied not only to attribute fields but also to the "Shape" field for geometry modifications reason.

 

To define and use expressions click on the "Edit expression..." button at the second step of the Table restructure wizard:

 

 

"Edit Expressions" window will appear providing the list of the available fields and the functions that can be applied:

 

 

To verify defined expression press the "Check" button. If the expression is valid a corresponding message will be given:

 

 

Note:

After expression is specified do not forget to check-in the "Use Expression" flag in order that the expression is processed during table restructuring.

 

 

Available functions for expressions

 

Available NUMBER functions and their formats:

 

  • Abs(x)

    Calculates the absolute value of x

  • Atan(x)

Calculates the arctangent of x

  • Cos(x)

    Calculates the cosine of x

  • Exp(x)

    Calculates the exponential of x

  • Floor(x)

    Calculates the floor of x

  • Log(x)

    Calculates the natural logarithm of x

  • Sin(x)

    Calculates the sine of x

  • Sqrt(x)

    Calculates the square root of x

  • Tan(x)

    Calculates the tangent of x

 

Available STRING functions and their formats:

 

  • Len(string)

Returs the length of string

  • LCase(string)

Returns a string converted to lowercase

  • Left(string, n)

Returns a string containing n characters from the left side of a string

  • LTrim(string)

Returns a string containing a copy of string with no leading spaces

  • Mid(string, start, length)

Returns a string containing length characters from string starting from start

  • Right(string, n)

Returns a string containing n characters from the right side of a string

  • RTrim(string)

Returns a string containing a copy of string with no trailing spaces

  • Space(n)

Returns a string consisting of n spaces

  • Trim(string)

Returns a string containing a copy of string with no leading or trailing spaces

  • UCase(string)

Returns string converted to uppercase

 

Available DATE functions and their formats:

 

  • Day(date)

Returns a numeric value from 1 through 31 representing the day of the month of date

  • Month(date)

    Returns a numeric value from 1 through 12 representing the month of date

  • Year(date)

    Returns a numeric value representing the year of date

  • Date(year, month, day)

    Constructs the date from the specified year, month and day

  • Today()

    Returns the current system date

 

Available GEOMETRY functions and their formats:

 

  • ShapeArea(geometry)

    Calculates the area of geometry

  • ShapeLength(geometry)

    Calculates the length of geometry

  • Centroid(geometry)

    Calculates the Centroid of geometry

  • ConvexHull(geometry)

    Calculates the Convex Hull of geometry

  • Envelope(geometry)

    Calculates the Envelope of geometry

  • FromPoint(geometry)

    Calculates the From Point of geometry

  • LabelPoint(geometry)

    Calculates the Label Point of geometry

  • ToPoint(geometry)

    Calculates the To Point of geometry

 

EXAMPLE:

 

Shape = Centroid([Shape])

 

- this expression will return centroids from, for example, input polygons features ("Use Expression" flag should be checked, and geometry type should be changed to Point in this case)

 

---

 

Table of Contents

-Search-

Back