I’m trying to automate a report. When the report runs on Thursday, it needs to run the report with the dates of Friday-Sunday. When it runs on Monday is needs to run with the dates of Tuesday-Friday. Each day is it’s own report.
I know I can split them into individual jobs to accomplish it. I was wonder if it’s possible/sensible to accomplish both requirements in a single workflow.
Fine
its very simple buddy @rridlen
–if the process is run on Thursday…or any day let it be
inside the process at the very beginning use a variable inside a assign activity like this date_system = Datetime.Now.DayOfWeek
the output would be date_system = Thursday (this is not going to be used, and we can pass this a input to log message activity or write line activity which can be used for debugging)
where date_system is a variable of type string
–coming to the point
now inside the workflow we need to pass the date value to its variable
lets say we are using a variable named in_date_1 and in_date_2, a string variable along the process then the value of in_date_1 and in_date_2 should be mentioned as in_date_1 = Datetime.Now.AddDays(1).DayOfWeek.ToString //output is Friday in_date_2 = Datetime.Now.AddDays(3).DayOfWeek.ToString //output is Sunday
Thats all buddy you can use this in_date_1 and in_date_2 along the process
Hope this would help you
kindly try this and let know for any queries or clarification
Cheers @rridlen
In this pack, you’ll find an activity called “Custom Date Series”. Provide the date pattern you need and it will give you the required dates as needed without much of a hassle
This is an example pattern for your scenario where you need dates for friday to sunday “1111000”. If you give this pattern to the activity, it will generate the dates from friday to sunday. Here 1 represents a holiday and 0 represents a working day where you need to get the dates. The pattern starts from Monday and ends with Sunday. So first digit represents Monday…
Change the pattern as you need for every scenario and it will get it done for you