How Do I approach this for dates Bot RUN

Bot will run every Friday for each month with the dates as below

When Bot runs first and second Friday – pulls previous month from 16th to 29th or 30th or 31st depending on the month
When Bot runs third and fourth Friday – pulls current month from 1st to 15th
For December month when bot runs on fifth Friday - Pull the current month from 1st to 15th

Any Idea How do I approach this

Hi @Sam_H

First loop through dates and check which is the first friday of the month using dayofweek() function. Then use addsays to find all fridays…from there you have the logic that you need already

Cheers

@Anil_G Not getting idea how to do this any example you have

Regards
Sam

Hi @Sam_H

PFA the xaml with sample on how to do that. I have done the same logic what is mentioned above to get the first Friday and then add 7 days to it to get all Fridays. I did it using current month .you can replicate for all months


Dates.xaml (8.4 KB)

output
image

Hope its clear. Happy to help if you don’t understand

cheers

@Anil_G Thanks Its working wht about December week if we have 5 weeks

@Sam_H

That is all logic with if you need to implement. Day after getting first friday say dates then dates.adddays(n*7) will give you each friday when n is 0,1 pull data from previous 16 to 31
When n is 3,4 or 5 pull from 1 to 15 of current month

cheers

@Anil_G Thanks for this example

Could you please Xmal file again in Zip file

Thanks
Sam

@Sam_H

I did not get you…Is the xaml sent not working?

cheers

Pls share it Dates.xaml File in ZIP

its not getting opened

@Sam_H

BlankProcess5 - Copy.zip (3.1 KB)

1 Like

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