Get Current Month and last month

Hi
I have a string column in the form of yyyyMMdd
I want rows to filter by current month and last month.
For eg- Current month is September, then I want entries of only of September and August even if the date is 1st September.
I tried P2M in date row filter but it will also include July data if date is 1st September.
Also tried Time Difference node combined with row filter on attribute value. Same Issue.

Any ideas on how to do this?
Thanks

Hi @nd1992,

Here is an example to check:

date_filter

date_filter.knwf (29.3 KB)

I have created a date range using the Create Date&Time Range node and have filtered the main table based on the current month and the last month.

:blush:

Edited: Now filters the current and the last month. The previous workflow was filtering the current and the next month.

4 Likes

Thanks. Works !! :smile:

1 Like

Dear @nd1992,

Please check the edited version. The last workflow was filtering the next month instead of the last month.

The change is in the configurations of the Create Date&Time Range node where the โ€œIntervalโ€ value is now โ€œ-1Mโ€ instead of โ€œ1Mโ€.

Sorry for the mistake.

:blush:

1 Like

:+1::medal_military::knime:

1 Like

Yes,no worries. I made the changes accordingly. Thanks for the swift response. It helped a lot!! :slight_smile:

1 Like

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