Hi, I want to show the last calendar month that I'm going to send by email so the recipients know what date range the report covers. I don't want this to be editable by them. For example I would send a report on 1st of each month, so on 1st August it would go out and the report heading would be "July 2024". Then in the report settings I'll have it set to last month as the date range.
How do I display last month as dynamic text within a report?
I've followed instructions to add a calculated field and then use a scorecard but I get an error that it can't connect to my data set. My data source is a GA4 account. Do I need to use a different data source to get date information?
Thanks.
Give this a spin.
FORMAT_DATETIME("%B",DATETIME_SUB(DATETIME_TRUNC(CURRENT_DATETIME(), MONTH), INTERVAL 1 DAY))
This gets the current date time, then truncates it to the current month, takes away 1 day (so that it's now the previous month), finally formats as a full length month name.
Use that code as a custom field, drag it into a table, format as you wish.
User | Count |
---|---|
3 | |
2 | |
2 | |
1 | |
1 |