Using charts to calculate absolute value - Cloud

Talend Cloud Data Preparation Getting Started Guide

Version
Cloud
Language
English
Product
Talend Cloud
Module
Talend Data Preparation
Content
Data Quality and Preparation > Cleansing data
Last publication date
2024-03-05

Calculating the absolute value of a number is one of the various mathematical functions available to use on your data.

If you take a close look at the Number_of_rentals column, you will notice that some of the numbers have a negative value.

Example of a negative value found in a column.

These cells are not marked as incorrect in the quality bar because they still fit the semantic type automatically set as integer. Nevertheless, this is unusable data. As a consequence, you are going to apply a function to remove the negative sign for all these numbers.

To calculate the absolute value of your data, proceed as follows:

Procedure

  1. Click the header of the Number_of_rentals column to select its content.
    Number_of_rentals column selected.

    In the statistics box, you can clearly see that some values are between -10 and 0.

    The statistics box displaying the value range.
  2. In the vertical bar chart at the bottom right of the screen, click the first bar from the left.
    The statistic box with the first bar from the left selected.

    This bar represents all the occurrences of the values that are equal to or below 0.

    A filter has now been applied on your data. Your preparation now only displays the lines with a value equal to or below zero for the number of rentals. You can now apply a function only on those cells.

    The filter is active.
  3. Under the functions list, in front of Apply changes to, select the Filtered rows radio button.
  4. In the functions list, click Calculate Absolute Value.
    In the functions list, the Calculate absolute value function is selected.

    All the negative values have been converted.

  5. To clear the filter, simply click the x icon, on the right of the filter.

Results

Your preparation now displays all your data again. If you take another look at the statistics box for the Number_of_rentals column, you can see that the minimum value is now 0 instead of -10. You have thus improved the quality and usability of your data.