Variables Current date and Current date - x-month

Hello,

I would like to look at the last three month (calculate from the current date) of the entries of a table.

Eg.

Date Data
2016-01-01 a
2016-02-01 b
2016-03-01 c
2016-04-01 d
2016-05-01 e
2016-06-01 f
2016-07-01 g

It should be only the entries of May, June and July

Thank you for your help

Hi,

This is how I would do it:

1) Use the String to Date/Time node to convert the Date column from string to date/time data type (unless it is already so)

2) Use the Time Difference node, set to use the current Execution Date and on Month granularity, to add a column with the time difference in months between the current execution date and all dates in the table.

3) Use a Row Filter on the newly added time difference column, set to include rows by attribute value and with range 1 to 3, to filter out the rows that do not belong to the last 3 months from the execution date.

Cheers,
Marco.

1 Like

Hi,

I make it like you said and it works fine.

Thank you for your help.

Cherrs,