Hi, I would like to know if it’s possible to create a data range which is “same period last month”. To compare for example, "1st May – 29th May" vs "1st April – 29th April". The thing is depending on the fact the month has 30 or 31 days, I can not see the way. And to subtract month or weeks to the current day it's useless.
This is fairly straightforward to set up in Analysis Workspace.
Go to the time section in the component menu and click on the plus sign. This will open up the Date Range Builder.
By default it shows you the current month as the date range. Click the grayed-out dates in the date range, next to where it currently shows "(This month)". This will open up the date range menu.
From this screen, click on the (rolling monthly - rolling monthly) text. This will open up some additional options. Don't uncheck the box to the left of "Use Rolling Dates".
You're going to edit the Start and End items that now appear on the screen.
In the Start section, click on "(none)". This opens up a small menu, where you will select "minus". After you select this a default value of "1 day" is shown. Click on "day" and change it to "month". The sentence should now read "Start of current month minus 1 month"
End: Click on "current month" and select "current day" in the menu that appears. Click on "(none)" and select "minus", then click on "1" and change it to "30". Make sure "days" is selected rather than "month".
In the end, your screen should look like this:
Pay attention to the Date Preview to make sure that it's showing the dates you'd expect. I typically don't include today's date in my reports, so I want the Date Preview to not show today's date (5/29/2019). If you wanted to include today's date in your reports, switch "Start of" to "End of".
Once you are satisfied with what you've built, click the "Apply" button. You'll want to change the title from the default date range to something that makes a bit more sense, such as "Month to date (last month)".
brentrad I need the data to refresh by itself every day, regardless of the month. In the Adobe service, I've been told it's not possible. I'd have to change the minus "X" days every month, depending if it's a 30 or a 31 day's month.
gonzaloc59790700, the segments that I typically use, and which I shared with you, are exclusive of the current day. I created an inclusive month-to-date segment that should probably work for what you are looking for. The settings are shown in the screenshot below.
To test this on your end,
Create a new blank Analysis Workspace project. The default dates that I see are May 1, 2019 - May 31,2019 because I created the project in May.
Drop Visits as the metric, and the freeform table will automatically use Day as the dimension.
Drag the "This month" Time segment and the new Month to Date segment underneath the Visits metric.
The table will show the applicable dates for each column. The last row in the "This month" column should show "May 31, 2019"), and the last row in the "Month to Date" column will show "May 1, 2019" but will have a 0. The last date with data in this column will be Apr 30, 2019.
You can create Segments based on the Time components.
I used a 30 day rolling example. As the OP mentioned, some months have more than 31 days. It would be worth testing out a 30-day and a 31-day version just to see what happens, since it's almost the end of May (31 days) and April has 30 days.
If you use "Start of current month minus 1 month" and "End of current day minus 1 month", you'll see that the Date Preview shows the same day only (e.g. Apr 1 2019 - Apr 1 2019). That obviously isn't helpful.
If you use "Start of current month minus 1 month" and "End of current month minus 1 month", the date range will be for the full previous month rather than month to date.
The date in the example is anchored to the current day, not the day that you have selected for the Analysis Workspace project date range. They are currently independent, and I don't think that there's a way to make the dates relative to a selection yet.