Using generative AI for processing DATE type fields
- Problem Description:
I would like to use generative AI to produce code that adds an hour to each date in a column and inserts the result into a new column. How may I accomplish this?
Solution:
The ‘Generative AI for transforming data’ feature is found in the preparation editor:
Tip
The best results come from prompts that leave the least room for ambiguity and are as precise as possible!
Especially when working with dates, we recommend that indicating precisely the DATE type of the value (which can be confused with the LONG type) by specifying the target column yields better results ✨.
A prompt needs to be entered, this will allow the generation of both a preview of the result and the relevant code. Then, press the “Transform data” button to start the execution.
Here is an example of an instruction that addresses our problem:
Add an hour to the 'scanDate' column which is of type DATE, and put the result in a new column 'TestDate'
The generated code is accessible in the “Generated code for transformation” tab:
Once you are satisfied with the result, simply press the “Apply” button to return to the preparation editor.