Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello everyone,
I'm having an issue trying to organize a date field into buckets and then calculating the net work days within those buckets.
For example:
I want to organize my lone "Date" field into buckets between the 7th and 21st of each month, and then the 22nd to the 6th.
From here I want to use networkdays() to calculate the number of working days in those buckets. I also want to calculate the total days within the date buckets.
6/7/18 - 6/21/18 | 6/22/18-7/6/18 | 7/7/18-7/21/18 | 7/22/18-8/6/18 | 8/7/18-8/21/18 | |
---|---|---|---|---|---|
Working Days | 11 | 11 | 10 | 11 | 11 |
Total Days | 15 | 15 | 15 | 16 | 16 |
Any assistance would be greatly appreciated.
Maybe use Apply Map?
Test:
Mapping LOAD * INLINE [
Day, Bucket
7, B
8, B
9, B
10, B
11, B
12, B
13, B
14, B
15, B
16, B
17, B
18, B
19, B
20, B
21, B
22, B
23, A
24, A
25, A
26, A
27, A
28, A
29, A
30, A
31, A
26, A
27, A
28, A
29, A
30, A
31, A
];
MasterCalendar:
Load *,
ApplyMap('Test',Day,'Others') as Bucket;
Load
day(YOURDATEFIELDHERE) as Day,
weekDay(YOURDATEFIELDHERE) as [Week Day],
....
...
In front end use Count (WeekDay) as Working Days and Count (Days) as Total Days
Hello Shabaz,
I think this is close. I'd like to get the month before the date number, ideally. Count of weekday in this case is the same as count(Days) since WeekDay() gives you the name of the day.
Create a variables for Min and Max Date, use it below...
NetWorkDays($(varMinDate),$(varMaxDate)) as WorkDays,
And count the WorkDays?