Adding date to the running table based on Workflow

I create an old date filter to avoid adding old data to the database from sources I regularly get data from.

In summary, what I want to do is. Read today’s date and then add the previous day’s date to the reference date table. Let the workflow read the dates from the table and filter the dates that are past the due date.

today: 14.09.2023
Date to be added to the date table: 13.09.2023

It will continue each day by adding the previous day’s dates one under the other.

date table:

  • 13.09.2023
    to be continued
    Can you send a sample workflow?

Hi @umutcankurt , presumably your reference table will be stored as a file so that on each invocation it reads the file and appends a new “yesterday” date, if it isn’t already present?

I’m not sure if this is entirely what you had in mind but I’ve bundled a small workflow into a metanode, so that it acts like a simple table. When it executes it finds yesterday’s date and appends it to the end of a csv file stored in the workflow’s data area, and returns the current date table in full.

The additional try-catch around the CSV handles the case when the csv file doesn’t already exist, in which case it gets created.


Persistently store historic date table.knwf (29.1 KB)

btw, there are other ways to get yesterday’s date (such as using one of various nodes to retrieve current execution time), but I prefer hacking String Manipulation :wink:
and then using String to Date&Time


Hi; @takbb Thanks so much for sharing. When I run it tomorrow


It will add the previous day’s date to the bottom of the table every day, right?
Previous old dates need to remain in the table because

Hi @umutcankurt, that’s the theory yes! If it doesn’t work… post back tomorrow and I’ll fix it :wink:

1 Like

:wink: :+1:
Thank you again in advance for your help with the solution.

1 Like

No problem @umutcankurt . and thanks for marking the post as Solution.

I just uploaded an updated workflow in the above post because I discovered that the CSV Reader wasn’t properly detecting the date format when it reads the data. This meant then when first run, it would return the table as “Local Date” datatype, but on subsequent runs, it returned it as String.

So I modified the transformation setting in the csv reader to explicitly state it is Date. I also added a ROWID node at the end to tidy up the returned rowids.

1 Like

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