Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have been reviewing this thread (Find Net Working Days) and others to resolve this issue, but I can't quite understand it enough to transfer it to my own purposes. Hopefully, you can help clear up the confusion
My data comes in as monthly totals. I don't have individual dates included in my data at all, and the two relevant pieces of data are [Month] and [Region]. I need to calculate the number of working days per month per region.
I will have a source table in an Excel file listing all of the holidays (shortened here to save space) which will take the place of the Inline Load in the prior thread's example. Rather than having a single holiday list to use, I will need to use one of these four depending on the data that comes in [Region].
US Holidays | UK Holidays | Hong Kong Holidays | India Holidays |
2-Jan | 2-Jan | 2-Jan | 26-Jan |
16-Jan | 14-Apr | 30-Jan | 24-Feb |
20-Feb | 17-Apr | 31-Jan | 13-Mar |
My source data is a sum of [Hours] executed by a specific resource in a given month. That resource is in a specific region, and I need to compare the value [Hours] to the available hours (number of work days * 8 hour shift). So my end function needs to look at a given month, count the Monday through Friday days and subtract the number of holidays in that month, based on the region of the resource.
Resource | Region | Month | Hours |
---|---|---|---|
Resource1 | US | January | 150 |
Resource2 | UK | February | 162 |
Resource3 | US | February | 148 |
Where I get lost in the linked thread's example is in the table tmpConcat. I can't quite get my head around what is happening here. If I replace the inline table tmpHoliday with my own Excel table with the four holiday lists, what do I need to add to my code in order to use the [Month] and [Region] fields to determine the correct number of working days?
Normally, I would try to load it as it is and watch what happens when I make changes. However, this is a new application in development, and I really can't get anything out of it to test without this most basic function. I figured I would get some guidance before diving in to set me on the right track.
I've figured out tmpConcat. It creates a comma-delimited list of holiday dates, to be used in the third value of the NetWorkDays function. It's more obvious than I was making it.
That leads me to believe that I can just use the code as it is (with my replacement holiday table) and that if I build a straight table chart with Month and Region as dimensions and a NetWorkDays function as the expression, I would get a table listing the number of work days each month and each year.
However, what I need for my application is a variable, which chooses the appropriate value for number of days to be used in a different formula; not the table itself. If I haven't made a mistake to this point, I think the help I need is with creating that variable.
I have a similar ask where I want to find network days based on attendance tracker for each employee..
Please help.