1
I am not entirely clear on your requirement.
Let's assume for arguments sake that M is 4 and N is 6. If a user accesses the same account for sensitive information for 5 days in a row, does that count as 1 visit for all 5 days or only for days 4 and 5? And does it only count if at least 4 of the days are in the sliding window of 6 days, or when any of the 5 days are in the 6 day window?
So, what would your expected output look like in this instance?
OK, let's suppose M is 4 and N is 10, so a user could have two periods of continuous access of 4 days each within the 10 day period. What would the output look like then?
Or is it that M*2 > N is always true?
Please explain why the number of visits is 5 when the user has only accessed the account for the first 4 days (presumably 10th, 11th, 12th and 13th)?
OK so the number of "visits" is because the 10 day periods 6-15, 7-16, 8-17, 9-18 and 10-19 all contain the same period of 4 consecutive visits (10, 11, 12 and 13)?
OK so what would you get if there were two periods of 4 consecutive days (10, 11, 12 and 13, and 16, 17, 18 and 19)?
If the same person and department access the same account for 2 consecutive 4-day periods, they will receive:
Start time: 5, End time: 14, Name, Department, Account, Number of occurrences: 4
Start time: 6, end time: 15, name, department, account number: 4
Start time: 7, end time: 16, name, department, account number: 5
Start time: 8, end time: 17, name, department, account number: 6
Start time: 9, end time: 18, name, department, account number: 7
Start time: 10, end time: 19, name, department, account number: 8
Start time: 11, end time: 20, name, department, account number: 7
Start time: 12, end time: 21, name, department, account number: 6
Starting time: 13, ending time: 22, name, department, account number: 5
Starting time: 14, ending time: 22, name, department, account number: 4
Start time: 15, end time: 23, name, department, account number: 4
Start time: 16, end time: 24, name, department, account number: 4
Because our data is collected today and yesterday, according to what you said, 10 is the cycle (N) and 4 is the number of days (M) (also the number of times, because the same person or department accessing one account on the same day is recorded as 1 day)
Why is
Start time: 7, end time: 16, name, department, account number: 5when you don't know on the 16th that this is the start of another set of 4 consecutive accesses?
What would you get if it was accessed on 10, 11, 12, 13, 16, 18, 19, 20, 21?
| 14/01/2025 | 15/01/2025 | 16/01/2025 | 17/01/2025 | 18/01/2025 | 19/01/2025 | 20/01/2025 | 21/01/2025 | 22/01/2025 | ||
| 05/01/2025 | ||||||||||
| 06/01/2025 | ||||||||||
| 07/01/2025 | ||||||||||
| 08/01/2025 | ||||||||||
| 09/01/2025 | ||||||||||
| 10/01/2025 | x | |||||||||
| 11/01/2025 | x | |||||||||
| 12/01/2025 | x | |||||||||
| 13/01/2025 | x | |||||||||
| 14/01/2025 | ||||||||||
| 15/01/2025 | ||||||||||
| 16/01/2025 | x | |||||||||
| 17/01/2025 | ||||||||||
| 18/01/2025 | x | |||||||||
| 19/01/2025 | x | |||||||||
| 20/01/2025 | x | |||||||||
| 21/01/2025 | x | |||||||||
| 22/01/2025 |
Here is a simple table with dates and whether the user as accessed the account (marked with an 'x')
Across the top are the date of when the report is run looking back 10 days including the day the report is run.
What do you expect the count to be for each of those days?
Do you expect a single count at the end for the whole period?
What does that count represent and why?
Please fill in all the detail.