@borderraux: I included the strings "nn weekdays, nn weekend days" since you asked for it in your original post. However, you are able to modify the code and get the results you want. Good job. It is an interesting learning process.
By the way, the Python code returns 4,0 but your data shows 3 and 0.. This may be due to including/excuding both the dates in the calcuation instead of the gap between the 2 dates. You need to determine which logic is applicable for your specific requirement.
@ravisdxb , thank you ravi - i am completely new to Python programming (only used VBA in the past and IDEA scripting for the last 6m) so it will be a learning curve to accomodate Python potential into IDEA but taking into consideration how much you can achieve by incorporating python script into IDEA this is a way to go. I have started some online course on panda python as the library offers great options for data munging and cleansing so hopefully at some point in the future i will be able to write some functions in Python to be used in IDEA.
with regards to my data: yes , you are correct that my data shows 3 and 0 - this is the calculation I have done in Excel before exporting the file in to IDEA - I am dealing with hotel booking data hence the difference in my analysis and the results generated by your function (the python function takes into consideration each day within range of dates - start data, end date and all between while for my analysis I need only the night booked by the guests hence the difference).
Thank you for your help.
@borderraux: All the best on your journey with Python.
If you need 3,0 instead of 4,0 as the result, you just need to modify the code as below:
IDEA is a trademark of CaseWare International Inc., used by permission.
All material provided on the IDEAScripting website is presented as is without any warranty or guarantee. Anybody using any solution provided on this pages is encouraged to validate the effectiveness and reliability on their own.
IDEA Help Videos
IDEA Related Videos
IDEA Success Stories