I have some problem about defining previous date. I want to find previous date that not be weekends (Saturday and Sunday) and holidays. I need to reverse shift day until the previous date is correct. Such as
If current date is 24-Aug-2020 (Monday) and 21-Aug-2020 (Friday) is holiday. I need to reverse shift day until previous date is 20-Aug-2020.
There are more people struggling with weekend days and holidays. This Forum search on holiday might give you some answers.
It depends a bit whether you need to have one e.g. variable containing the correct previous date in your workflow, or whether you have a table containing dates and apply this logic on a datecolumn, to get for all those dates the previous date.
If it’s just a single date to determine you might make a small snippet of java in a Java Edit Variable node.
If it’s something to be applied to a table containing a date column, you probably want to follow another approach.
The simple part in this is the weekend day. Although a weekend (or non-working day) is not the same in all countries, in a country it is the same every week.
To determine if this day is a weekenday you could use the Extract Date&Time Fields node. Choose the “Day of week” (number or name whatever you prefer).
The problem is the holiday. Holidays are different everywhere in the world (different between countries and sometimes even between regions). You would need to have a table or something to capture those dates which you recognize as holidays.
Maybe you can explain a bit more how this is to be incorporated in your workflow.