Forum Discussion
Sum Weekdays to a starting date
Hello everyone!
I need a little help to get a solution for my BI.
I have a table that contains 4 columns as shown in the image below:
The first column identify the row's type: 1 or 0.
The second is a starting date (in brazilian date format).
The third is the number of days to be added to the starting date.
The last one is the end date (starting date + number of days to be added)
Conditions:
If the row's type (first column) is 1 than it must add only weekdays to the starting date.
If the row's type (first column) is 0 than it must add all weekdays to the starting date.
I already have a calendar table:
Date: It shows all dates since 2016.
DiasUteis: It shows 1 if it's a weekday and 0 if it's weekend.
Contagem Acumulada de Dias Uteis: It counts the accumulated number of weekdays (without any distinction, so it will be counting for the whole table).
I tried a lot of solutions but none of them seems to work... Can anyone please help me?
Regards!
1 Reply
- AnonymousNot applicable
Hi Anonymous ,
I wanted to apologize that I have not been clear in your post. Are the four columns of your first table sample data? And if I understand correctly, you may have a problem calculating the cumulative working days.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.