Using Shape File Expressions

When working with shape layer files, you have the ability to add columns to your files. You may know that you can populate these columns with static values. But you can also populate these values with formulas. Following is an example of how to add a new column to a file, create a formula field and create an alias for a column.

  1. For this example, we will start with a CSV file exported from the crater counting layer. The first step is to import this file:

    load file

    load file2

  2. Next, edit the columns of the file:

    edit columns

  3. Enter a name for a new column, make it a formula field type, click "Add Column" and select Real Number for the expression type:

    create field 1

    create field 2

  4. Enter the formula for the new column:

    create formula 1

  5. Make sure the "update all rows" checkbox is selected and click "Okay". This will send you to the table where you can see your new column:

    updated table 1

  6. Edit columns once again and create another column. This time, make it a boolean expression type:

    create formula 1
  7. Enter the formula for the new column as a conditional using the formula field previously created. Note the compile error:

    compile error 1

  8. To use any column that contains a space in the name, we must create an alias for that column:

    create alias
  9. Note that the alias now shows up in the alias table:

    create alias2

  10. Update the expression for the boolean value:

    use alias
  11. Click "Okay" and see the updated table with the boolean values set:

    updated table2

Congratulations! You've completed the Shape Layer: Using Shape File Expressions Tutorial!