SharePoint View to automatically show only the current month? - sharepoint

I need to create a view that will automatically change from month to month to show only the current month (i.e. if current month is July - show items posted in July). Currently I have a view set up, but I have to manually change the month each time it changes (it's set up based on the first day of the current month and the last day of current month).
Thanks

You can do this by turning the problem on its head.
First you need to add two calculated columns that will work out the start an the end of the month. (This example uses [Due Date] but you can use any date/time column)
"Start of Month" =DATE(YEAR([Due Date]), MONTH([Due Date]), 1)
"End of Month" =DATE(YEAR([Due Date]), MONTH([Due Date])+1,1)-1
Then you setup a filter in your view for
"Start of Month" is less than or equal to [Today]
AND
"End of Month" is greater than or equal to [Today]
How To Use Filters in SharePoint to show items in the current Calendar Month

Create a CC "NextMonth" that adds one month to your date
=DATE(YEAR(Modified),MONTH(Modified)+1,"1")
create a view "ThisMonth" with this filter
"NextMonth" is greater than [Today]
this will always return the current month. can also be allpied to Year, to return current year
Create a CC "NextYear" that adds one year to your date
=DATE(YEAR(Modified)+1,MONTH(Modified),"1")
create a view "ThisYear" with this filter
"NextYear" is greater than [Today]
Now the trick is to return a view for last Month. Let me know if you figure this out

EDIT: Please see Ryan's solution below, it's more comprehensive.
I believe there is no out of the box solution for that. One trick can be to write code in default view which would actually set the month for you or redirect to any other view. Something like
SPWeb web = SPContext.Current.Web;
string[] monthViewUrls = { "url1", "url2", ... };
string currentMonthUrl = monthViewUrls[DateTime.Now.Month-1];
Response.Redirect(currentMonthUrl );
Hope this helps.

Can you live with the calendar view? That shows current month by default. Maybe you can start with that and try to customize it in SPD - it might retain its current month behavior.

Start of Previous Month
=DATE(YEAR(Created),MONTH(Created)-1,"1")
End of Previous Month
=DATE(YEAR(Created),MONTH(Created),-1)

Related

Amazon Quicksight Dynamic date filter

so everyday I receive sales data from the previous day. So today November 15 I have data from July 2021 until November 14 2021. What I want is to show this data for the current month by aggregating by day. I use a quicksight visual with a MTD (Month To Date) filter. Everything is fine so far.
The problem is on each first date of the month, I see "No Data" on my visual which is normal since I do not have any data from the current day/month but as I said earlier from the day before.
So what I want to achieve is:
Each 1st of current month: show data from the whole previous month
From 2nd to last day of current month: show data from the current month
Can someone help me please to know how I can achieve this?
I looked for ways to do this and I found dynamic default parameters but this option is not fine with me since I have to fill a username column according to the documentation (https://docs.aws.amazon.com/quicksight/latest/user/parameters-set-up.html) and I have many users so it will be not interesting to list all of them.
You can assign parameters to a group rather than a specific user which is much quicker
There is new functionality which allows you to set today or beginning/ending of month/quater/year as default.
See screenshot:
enter image description here

Power Automate: Send reminder out 3 months in advance

I have a Microsoft List that has a column called Expiration Date (text in format of MM/DD/YYYY) and Point of Contact (text in format of email#domain.com). How do I create a flow that sends an email out to the Point of Contact 3 months in advance?
My idea was to create a scheduled cloud flow that:
Repeats every day
Looks at every row in specific list
Compares if Expiration Date - 3 Months = Today
If True, send email to Point of Contact
I am currently stuck on step 3 to compare the date. I did Subtract from time to subtract 3 months from Expiration Date but now I do not know how to use this value to compare to today's date.
A better approach is to filter the list by using an OData filter. That will result in a list with all the elements you need.
For doing so, you need to specify the "Filter Query" field (in red):
First type
ExpirationDate eq ''
Then, between the quotes, add an expression, and select the functions addDays and utcNow in the following way:
addDays(utcNow(),92,'MM/dd/yyyy')
Please notice the following:
I'm adding 92 days to get the same day three months in advance for today (today is Oct 18th, so I'm looking for Jan 18th). Maybe adding just 90 days would work for you.
If you just want to add 3 to the month, you would need to get today's date to a variable with utcNow('MM') to get only the month, add 3 to it, and then create the expression accordingly.
I'm sorry the UI is in spanish. I'm from Mexico. But it's the same idea.
In the image, it reads "ExpirationDateText" because that's the way I named the field in my example. In your case, "ExpirationDate" should work.

Sharepoint 2013 - create a column that contain current date in sharepoint list

I am very new to sharepoint,
currently i am working to create a column that contains current date in sharepoint list.
the problem is i want the date automatically change based on today's date.
for example,
today is 19/12/2014,
and when it comes to tomorrow it will change automatically to 20/12/2015, and next.
It is one of the standard choices, if you choose column type "Date and time"- see the defaults section at the bottom.
You can add formula
=[Today]
if you have bad day thats mean you have messes up with servers time services but you can hitfix that:
=[Today] + 1
but it will only work after editing the item (I think), so programically solution is timerjob that run everyday and set last day dates to next date

"Next X Hours" filter is not working as expected in CRM 2011

I have added a custom field named "due by" in queueitem entity. Then I created a system view named "Calls due next 1 hour" again in the queueitem entity with filter condition as:
Field: due by Filter: Next X Hours Value: 1
But this view seems to behave wrongly. E.g. Suppose current system time is say H:MM AM/PM, then this view is displaying all the records which are due by till H+1:59 AM/PM. While I am expecting it to display all the records which are due by till H+1:MM AM/PM only.
Because of this issue, my custom view is displaying records in the range or around next 1 - 2 hours. E.g. if the current system time is 10:01 AM it displays records till 11:59 AM which is around 2 hours whereas if current system time is 10:59 AM, it again displays records till 11:59 AM which is 1 hour.
This seems to be a bug in "Next X Hours" filter of CRM because I have checked it for some other entities as well by creating a custom view with "Next X Hour" filter where X is set to 1 and all are displaying records till 59th minute of next hour.
I have posted this issue here just to confirm whether this is really a bug or only I am facing this.
Thanks
This is something that I see in a lot of CRM views' pre-built filters, especially around date fields - the name of the field does not really indicate what it will do. In addition to your example, the "Last Year" filter to me would indicate that it should return results from the last 365 days ("in the last year"), but in reality it returns all results where the calendar year is equal to current year - 1 (same with last month, last week, next year, next month, etc.). Your question seems to be about the same concept (the next 1 hour is where hour = current hour + 1).
The only solution is to be sure to test out all the filters so you know exactly how they behave instead of relying on how you interpret the wording. It's a bit obnoxious, but it has to be done.

Selection formula for capturing previous month data only in lotus notes

what selection formula we have to used for capturing previous month data only in a view in lotus notes 7.0 version
Please note that view selection formulas using variable times (#Now, #Today) are hell on server performance, since every time the view is accessed it needs to check when "now" is. In Notes and Domino 7, you would be far better off to use a hard-coded date range and a scheduled agent to change the view selection formula on a monthly or daily basis (depending on whether you mean "last month" or "between this date last month and today").
Please see the Performance Basics for Lotus Notes Developers whitepaper for more information.
You'll need to compare the date field in your documents to #Today minus one month, and select all documents with a date greater than or equal to that calculated date.
Use the #Adjust formula to calculate the current date minus one month:
SELECT #Adjust(#Today, 0;-1;0;0;0;0) >= YOURDATEFIELD

Resources