Stirng manipulation

Good morning everyone, how are you?

It’s been a while, haha. I was out of the corporate world for a while, so I ended up not using Knime as much and forgot some simple functions that I used very frequently.

Well, I have a database that shows me the times the ticket was opened. Basically, I want to add a condition saying that if the value is between 7 am and 12 pm, it should be included as a morning, for example.

1 Like

You can use a Rule Engine node.
Assign AM PM Based on Hours.knwf (61.0 KB)


5 Likes

Hello @Gabriel2020
You can test to code ‘String Manipulation’ node as follows:

string(toBoolean(toInt($Ticket Created - Hour$) >= 7)).equals(“true”) &&
string(toBoolean(toInt($Ticket Created - Hour$) <= 12)).equals(“true”)
? “morning”
: “other”

BR

2 Likes

1 Like

Hi @Gabriel2020

Check your input row 66 to see the exception.
You can test with: ‘Insert Missing as Null‘ check box, share a sample of the data…

BR

2 Likes

Hi @Gabriel2020 , the syntax error will most likely be because the code contains double quotes that have been modified when they were posted to the forum.

Retype the double quotes so instead of appearing as

“… “
They appear as

"..."
1 Like

Curious why you insist on using a String Manipulation node. My workflow works and is much simpler.