30 minutes incremental loop

Hello guys,

I have a question regarding to 30 minutes time incremental.

I have REST API workflow which works pretty well. As an input I use start date and end date.

For example:
start date: 2021-04-01T00:00:00
end date: 2021-04-30T23:59:59

REST API gives me back what I am asking for, but only 500 lines not more. Complete month has definitely more than 500 lines. I know there is in 30 minutes period never more than 500 lines. Due to this fact I need to split the whole month into 30 minutes periods and send more REST-API commands. Not just one for complete month, because I would receive ONLY 500 lines again. I have investigated REST-API has its own limits.

At the end I don’t send only one commands, but 30 days x 24 hours x 2 = 1440 commands separately and at the end collect complete month.

But how to create loop increasing my start date by 30 minutes till end date?

I look for something like this:
2021-04-01T00:00:00
2021-04-01T00:30:00
2021-04-01T01:00:00
2021-04-01T01:30:00
.
.
2021-04-30T23:30:00

Any idea?

Thank you very much.

Jiri

Hi Jiri,

why do you dont split the task in two parts?

The first part only build the table only for the days (e.g. 2021-04-01, 2021-04-02, etc.)
and the second task to build the time scheme for only 1 day (e.g. 00:00, 00:30, 01:00, etc.)

and the use the cross-joiner-node to combine both tables?

BR
Hermann

1 Like

Hello @morpheus,

No I didn’t try it, but theoretically it should work. I am going to try it.

But for other users: please feel free to give me some another hints

Thank you

Jiri

Hi @sm0lda Your problem, if I understand it correctly, is very similar to this one from a few days ago, and I suspect my solution to that would be similar for you

I have attached a modified version of that workflow

Duplicate Sample Without Looping-2.knwf (19.5 KB)
(re-edited - and updated comments on nodes to reflect new requirement)

4 Likes

Hi @sm0lda
As @takbb your question is very similar to a question asked yesterday. And as KNIME has multiple options to solve almost everything. Here is an example using a loop.
30_minutes_incremental_loop.knwf (28.3 KB)
Schermafdruk van 2021-04-29 15-48-21
The Counting Loop, creates x new time stapmp with an interval of (in this case) 30 seconds.

gr. Hans

3 Likes

I have to say I like the idea coming from the “Matrix” with the crossjoin

If you want to do it with python then this could be an option (I used a table but you can also create a metanode and use configuration nodes)

3 Likes

@Daniel_Weikert Now that’s just showing off! :joy: Brilliant!

3 Likes

Just one of the few times I can actually contribute here :wink:
As far as I have seen you have become one of the main contributors to this great community. (No matter the topic! :joy: ) I am always curious about the solutions you come up with next.
I really appreciate your posts and hope you will continue helping all of us here.

4 Likes

That’s very kind of you Daniel. I hope that mostly my answers are on the right track and don’t miss the point too much. I’m sure that for many of my solutions Knime has a better way that I don’t yet know about, but I also like reading other people’s solutions to the same problem (and other problems) as so often I then discover a different angle, or feature that I didn’t know about.

There’s plenty of questions asked that I can’t answer, especially when they are in more specialist areas, but I still like to read them anyway. :slight_smile:

4 Likes

Hello all,

nice ideas and discussion. Really enjoy reading it :slight_smile:

One more way to create needed interval is Create Date&Time Range node :wink:

Br,
Ivan

3 Likes

Thanks @ipazin, another node I didn’t know about to add to the growing toolbox… I knew you wouldn’t let me down… :joy:

1 Like

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