I’m trying to implement a worflow using a DateTime range node; I need for example a week of time serie with a 1 hour of spacing.
So I need of a switch case node: I need to loop on this calendar and if the time is from 00:00 to 07:00 I need to set a variable to a value, if the time is in the range 07:00 and 18:00 I need a variable is set to 0, if the time is in 18:00 to 23:00 I need to set another value.
I don’t understand how to set a loop node with a switch case node to set my conditions.
Any help is apreciated.
As you can see the image above, I set a variable rows (I don’t know how many rows can be expected). After that, i set the start date/time and at the ending point, i set +1 hour (+1h) ant set the date and time.
When you run it, the node will generate all rows necessary with this interval.
thank you for your suggestion, they drive me to an acceptable solution.
But there are some problems: If I use my nodes it seems they don’t work, so I import the @denisfi workflow and it works correctly. It may be a version problem I’m using Knime 4.7.0. @denisfi can you explain your regex expression?
Another question is: if in the rule engine node the setted values they can be taken from another node, as example a math formula node?
In the pic there is my actual workflow, so i need the rule engine take the values from the 2 math formula nodes.
I use you example…so I have modified rules adding an extract datetime node and it works fine.
I attached my workwflow…if you see in the rules, I have the values 10 and 100 and I want the value100 is PMax and 10 is the value Prid, PMAx and Prid are caluclated with the 2 math formula nodes.
I don’t understand the match from each line, but as you can see from this new workflow, you can set and calc using a regular math formula, not the multicolumns because this options will apply the same calc for multiples columns to make it quick calc for all cases. Using the simple math formula, I can put the Pmax and the Prid at the same single line.
Not what do you need to do with the time to match with the calc? just a merge/joiner?
Great work! With the row with CSV reader I have the 2 variables: PMax and Prid, so this I want is:
if the time is in 0 to 6, the condition is equal to Prid, if time is 7 the value must be Pmax, if the time is in 8-18 the value is 0, and in the end if time is in 18-23 the value is PMax.
I hope now it is clear what I expect.