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.
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.
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.
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.
Send to your destination
Route the transformed integer field to your chosen destination, such as a data warehouse, BI tool, or spreadsheet for analysis.