Altair SmartWorks Analytics

 

Rounding Columns

The Round operation is found within the Column Changes node and allows you to round numerical strings from a specific column in your table according to some criterion.

Prerequisites

  • An Execution Profile with an active session linked to the workflow

  • A Column Change node connected to a Data Frame node

  •  

Steps

  1. Configure the Column Changes node by double-clicking on the node or using the Open option provided in the node menu.

  2. The table displays in the Node Viewer.

  3. In the Configuration tab, select the column containing numeric strings you wish to round and then click on the Round item in the Column Changes menu.

  4.  

Rounding with Precision

The Round with Precision operation rounds numbers according to the precision (i.e., number of decimal places) you specify. For example, if you specify a precision of 0, numbers are rounded to the closest whole number. If you specify a precision of 1, numbers are rounded to the nearest one decimal place. Thus, if your number is 35.495 and you specify a precision of 1, the result is 35.5.

Steps

  1. Select Round > Round with Precision.

  2. Enter the number of decimal places to round numbers to in the field provided.

  3.  

  4. If you wish to create a new column for the rounded strings, tick the Create New Column box and provide a column name.

  5.  

  6. If you wish to apply the round operation to multiple columns, click on the Apply to multiple columns link and then choose which columns to apply the same operation to. Click Apply when you are done to save your selection(s). This option is disabled if you choose to create a new column in which to display the rounded strings in Step 3.

  7.  

  8. Select Apply when you are done.

  9. You can abandon the round operation by clicking the Cancel button instead.

    If you chose to create a new column, the new column is added to your table.

    If you did not choose to create a new column, the field values in the original column are updated.

     

  10. To check the code that will be executed for your specified Column Changes configuration, save your specifications and then click on the Code tab of the Column Changes Node Viewer. You can also use the tab that displays to refine the code further.

  11.  

  12. To complete the Column Changes node configuration, press Save. To cancel your changes and return to the Workflow Canvas, press Discard or simply close the Column Changes Node Viewer. To execute your column changes, click the Run button.

Rounding Up or Down

The Round Up and Down operations respectively round numbers up and down to a whole number.

Simply select Round > Up or Down to modify the values in your column.

In the example below, the left-hand column shows the original column. The right-hand column shows the resulting column after the Round Up operation has been applied to it.

 

In the following example, the left-hand column shows the original column. The right-hand column shows the resulting column after the Round Down operation has been applied to it.

 

Removing Decimal Places and Negative Signs

The Remove Decimals and Remove Negative Sign operations remove decimals and negative signs, respectively, from all of the numbers in your selected column.  

Simply select Round > Remove > Decimals or Negative Sign to modify the values in your column.

In the example below, the left-hand column shows the original column. The right-hand column shows the resulting column after the Remove Negative Sign operation has been applied to it.

 

In the following example below, the left-hand column shows the original column. The right-hand column shows the resulting column after the Remove Decimals operation has been applied to it.