-1

I have around 606,000 rows of appointment data and want to pull certain things out of it.

First, I want to split it out by site, and then the number of appointments booked on each date at each site.

Something like:

Iterate through `Site` column
    For every `site` in `Site`
        For every `date` in `Date`
            Count total number of appointments booked

Hopefully this example makes things a little clearer.

Ultimately, I want to be able to look at the next seven days and see how many appointments are booked at each site across each of the seven days.

I would normally use a for within a for to achieve this (by site, then by day), but I'm confident that there is probably a simpler solution.

Mus
  • 7,290
  • 24
  • 86
  • 130

1 Answers1

0

Dpylr sound like it will be your best friend for this case. You can use the count() function to find counts of groups, sub-group or sub-sub-groups if you want. This other answer explains it

Count number of rows within each group