Date&Time variable for specific plot range

Hey everyone!

I am learning knime in the past few days, it’s great but I still hit my head very hard here and there on how to decypher the answer he gives me during my workflow building.

Particularly, I have been stuck since morning with this problem:
I have a huge dataset sampled every second and want to plot it (line, scatter, whatever) in a specific range, user defined OUTSIDE the ploting node.

E.g.: Through a couple of “date&time input” interactive windows, the user choose a “begin” and an “end” date, these are given as flow variable to the plotting node (xAxisMin and xAxisMax), which should “zoom” or just plot within that interval
Result:
– Errors loading flow variables into node : Coding issue: For input string: “2019-03-14T08:51:08+01:00[Europe/Berlin]” –

After several experiments, I noticed that this two variables are taken as String and, in case you have a numeric axis (Integer or Double), that works like a charm. The problem is specific with date&time axis.

I supppose that, just like with numeric, knime reverts even date&time in some sort of numeric format and then plots it (similar to what excel does?). I just can’t figure out the conversion formula.

Clues/Suggestions?? I also tried “range sllider filter definition” but it only takes Doubles.

Thanks Everyone!

Hi @Suvrec,

Easiest way to go about this would be to actually use a Row Filter based on the inputs from the Date&Time Inputs. That way, axis ranges will only be based on the filtered data.

Cheers,
Roland

1 Like

Hi there @RolandBurger!
Thanks, that’s exactly what I did at the end, but it’s a just patch: in this way the plot will not update on new input, but you will need to re-run the whole metanode :confused:

I was hoping to make it little bit more interactive, the same way you could definitely do if they were simple numbers and not a date&time format!

Thanks for your suggestion anyway!

A

Have you thought about converting the input to a (long) integer like

2019-12-17T12:23:45
becomes
20191217122345

The same goes for the scale on your axis. You then filter just by the numeric start and end. You would have to set the labels separately so it still looks good on the chart.

Maybe you could create a sample workflow to discuss this further.

2 Likes

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.