How to count the number of files in a folder

What I’m trying to do

I have a file tree structure with:

customer1
|_session1
|_session2
|_session3
customer2
|_session1
customer3
|_session1
|_session2
|_session3
|_session4
|_session5
|_session6

The folders are actually the full name of customers and each page a session with that customer.

I would like a table with a count of the sessions grouped by customer and and the end the TOTAL number of sessions. Something like:

Full Name      #sessions
customer1     3
customer2     1
customer3     6
    TOTAL     xx

What I tried

I tried different things with group by and playing with tags. I can:

  • get a table with all my customers (but not the number of session for each)
  • get a raw list of all sessions with the name of the customer (but no group by and no session count by customer).

But I don’t see how to achieve what I need. If somebody have an idea, I can try whatever is suggested.

Thank you.

Please show us the queries you’ve got, and I reckon we can get them to sum up the number of sessions.

The idea is to use GROUP BY file.folder(or something similar), and then do sum(rows.file.name) (or something similar). :smiley: