cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ciprianpopovici
Helper II
Helper II

Leave request- Monthly report

Hello,

 

I have created an application for tracking leave requests and I have to solve a request from colleagues and I am looking for a simple solution. Colleagues also want to have in one of the screens a monthly report of the days off. The report must contain the name of the month and the number of days spent in that month. If you have an elegant solution, please help me. I can get back to you with more details bout app. I collect the number of days between  from date and to date, if the month from the from date  is not equal with the month to date, i collect in two variables the days in first month and the days in second month.

 but i don't know how to achieve the report that was requested.

 

Thank you 

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-jefferni
Community Support
Community Support

Hi @ciprianpopovici ,

 

Would you like to create a table report that based on natural months for the logged in user to display all the leave requests belong to it?

 

If so, you will have to separate this kind of leave according to different months due to the existence of cross-month leave. In other words, a single cross-month leave request should be separately recorded in the data source according to single natural months.

 

If above scenario is acceptable, further more you will need to use collections to retrieve the logged in user data from your data source and count leave days in each month. Below are the steps:

1. Use a button OnSelect or if you are using a Date Picker EndDate use OnChange to create a date range collection.

2. Collect another collection to filter the data source, get the collection to include user name from requestor column, start date larger than date range collection start date value and end date less then date range collection end date value.

3. Add a Month column to the above collection, get the month name based on each requests raised by the user.

4. It will be easy to count the leave days within a single month using the CountIf function.

 

Hope this helps.

 

Best regards,

Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

1 REPLY 1
v-jefferni
Community Support
Community Support

Hi @ciprianpopovici ,

 

Would you like to create a table report that based on natural months for the logged in user to display all the leave requests belong to it?

 

If so, you will have to separate this kind of leave according to different months due to the existence of cross-month leave. In other words, a single cross-month leave request should be separately recorded in the data source according to single natural months.

 

If above scenario is acceptable, further more you will need to use collections to retrieve the logged in user data from your data source and count leave days in each month. Below are the steps:

1. Use a button OnSelect or if you are using a Date Picker EndDate use OnChange to create a date range collection.

2. Collect another collection to filter the data source, get the collection to include user name from requestor column, start date larger than date range collection start date value and end date less then date range collection end date value.

3. Add a Month column to the above collection, get the month name based on each requests raised by the user.

4. It will be easy to count the leave days within a single month using the CountIf function.

 

Hope this helps.

 

Best regards,

Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Users online (3,409)