How to get a number of nodes created per month in views using aggregator?

Created on 8 January 2025, 3 months ago

Problem/Motivation

I want to create a view with aggregation function to get a number of nodes created per month. I have done it long time ago in Drupal 7, but now it does not work in Drupal 10.4 or in Drupal 11. I have php 8.3 and mysql 8 on my site. See attachment.

My view looks like;

  • I used a table layout, enabled aggreation, added field "nid" with "Count distinct".
  • then I added a sort criteria by "post date" with "monthly" granularity.
  • then I added a "post date" field with custom format "M-Y". I select "min" instead of "group results together.

The result I get is attached. The query generated is also attached as screenshot.
I know I am doing something wrong. Please help me to achieve this. Thank you.

💬 Support request
Status

Active

Version

2.1

Component

Documentation

Created by

🇳🇱Netherlands a.kahn

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024