Cast to Int

Cast to Int

Description

Converts a value to the int type.

Category

Transformation

Supported Field Types

  • text
  • float
  • boolean

Output Field Type

  • int

Arguments

None

Pseudo-code (Python)

def func(val):
    """
        val: original value
    """
    if val:
        return int(val)
    else:
        return None

Use the Cast to Int transformation

Convert text, float, or boolean fields to integer type in your Kondado data pipeline.

1
Identify the field to convert

Locate the field in your source data that needs to be converted to integer — this could be a text, float, or boolean value that represents a whole number.

2
Apply the Cast to Int transformation

In your data transformation step, select the Cast to Int function and map it to the target field. No additional arguments are required.

3
Validate the output

Verify that the output field type is now int. If the original value is empty or null, the function returns None rather than throwing an error.

4
Send to your destination

Route the transformed integer field to your chosen destination, such as a data warehouse, BI tool, or spreadsheet for analysis.

Frequently asked questions

What input types does Cast to Int support?
Cast to Int supports three input field types: text, float, and boolean. Any of these can be converted to the int output type.
What happens if the input value is empty or null?
The function safely returns None when the input value is empty or null, preventing pipeline errors from missing data.
Does Cast to Int require any arguments or configuration?
No arguments are needed. Simply select the Cast to Int transformation and apply it to your target field — it works out of the box within Kondado's data transformation layer.
Where can I use the integer output after transformation?
The converted int field can be sent to any destination supported by Kondado, including data warehouses, BI tools, or spreadsheets for reporting and analysis.
Can Cast to Int handle decimal values from float fields?
Yes, float values are converted to int using standard integer conversion, which truncates decimal places rather than rounding. For example, 3.7 becomes 3 and 3.2 becomes 3.

Written by·Published 2024-12-20·Updated 2026-04-25