Calculate years diff in Expression node

**The difference between datum (=date-format) and Today

Steps to reproduce:

  1. Create a table with a date
    2.Connect to Expression node
    3.Ask KAI - I want to have a new column that gives me the difference in years between datum and today

Actual results:

Expected results:
A function that works.

Attachments:

**OS:**Win11

In my first attemp with a smilair question for KAI , KAI suggested:
now() - $datum$ (or something similair). I like the now function, as a representation of today, but more or less the same error came up.

What I realy miss in KAI is his memory. Once executed your input is lost. In case the output is not quite what you want, and you need to make some adjustments, you have to write the input for KAI all over again (from your own memory)

2 Likes

I wonder if KAI is running into the same thing that I run into all of the time where the error is actually from the mismatch of data types. I certainly agree that followup questions / memory would be a massive improvement. It also seems like KAI should be able to see error messages and catch its own errors…

2 Likes

Created ticket ID: QA-1110

1 Like

Hi @HansS and @iCFO,

Thanks for the valuable feedback!

You’re right — K-AI currently doesn’t know about the new temporal functions. They’ve already been implemented but aren’t yet available in the public service. Support for date/time expressions will be released in the K-AI service at the date of the KNIME Analytics Platform 5.5 release.

The now() function didn’t make it into that release but is on our roadmap (AP-24036).

Prompt memory (AP-23135) and using compile errors to refine suggestions (AP-24506) are also on our list — appreciate the great ideas!

2 Likes

Dear @HansS,

We updated the AI service provided with the Hacking Days Business Hub instance so that you can try the new features of KAI while testing 5.5 RC.

To use KAI provided with the Hacking Days Business Hub, you have to add the Hacking Days Business Hub instance (mountpoint) to your AP and then select KAI from this instance in preference → KNIME → KNIME Modern UI → AI Assistant.

The default is “My-KNIME-Hub” which is the AI assistant provided by KNIME Community Hub. After adding the Hacking Days Business Hub, you would have another option as “knime-business-hub” as well (assuming you didn’t chosse a different mountpoint ID).

Internal ticket ID: AP-24036
Summary: Add “now” and “today” Expression functions that returns the current zoned date time
Fix version(s): 5.6.0
Other related open ticket(s):
AP-24506: Re-iterate K-AI code generation suggestions by feeding in errors
AP-23135: Provide access to previous prompts in Scripting Editor AI Bar

1 Like