Same number of days before and after a specific date

Hey knimers,
hope all are well
can anyone help in this matter as i m unable to figure it out by my self and i m still no expert
I have a daily data. we performed smth on a date let s say 01/12/2021 (dd/mm/yyyy), and we reached let s say 03/01/2022 which means that the period after 01/12/2021 is 33 days. How can i filter that same period of days but before 01/12/2021 dynamically.

thanks in advance

Hi
if I understood correctly,
you could create a daterange unsing createdatetimerange node and the do an inner join to filter
br

Converting the two boundaries to flow variables and then using a Rule Based Row Filter might work as well. @mh_elhassan do you have example data? Real or fake doesn’t matter, the structure is important. Bonus points for a result table :wink:

1 Like

Hey,
I am not sure i got your points
below is sample

what i need is to extract the 8 days during and 8 days before not the 11 days before.(if it not clear plz let me know)

Keep the campaign period, plus as many days before the campaign. Works with non-contiguous input. Does not work with multiple campaign periods interrupted by non-campaign periods. If you want to use the time interval from the campaign start to today, you can use the current execution time&date in the Date&Time Difference Node (the Math Formula Node will need some adaption as well).

Step1: get campaign period
Step2: find start and end date
Step3: calculate difference in days, add 1
Step4: shift start date by that number of days forward
Step5: convert to Flow Variable, insert into Rule-based Row Filter
Step5: use variables to filter desired period


filter_extended-period.knwf (38.1 KB)

1 Like