Number of Days in a Leave Request Form

  • 1 September 2020
  • 2 replies
  • 1 view

Hi,

 

First of all I'm a complete newbie in K2 so please bear with me. I'm creating a leave request form and I would to compute the number of days between the start and end date automatically but holidays and weekends must be disregarded. I've seen a solution about creating a stored procedure but I'm trying to see if this will work. Basically, I created a smartform that list down all the dates which is the key property. I created another property with a value of either 1 for weekdays and 0 for weekends and holidays that is matched against each date. This is how it looks like after populating it.

 

15581iD236F3927C384A63.png

 

Let's say I have a range of dates based on the user's input in the start and end date, would it be possible to extract the values under the value property that correspond to this range and add them up?

 

Any help would be appreciated. Thank you!


2 replies

Hi,


 


If you create a listview using you smartobject (which is what i think you shared in your screenshot), go to edit mode, click on the "Value column" and select the "Column" tab on the right side panel (see sum.png), you can use the sum aggregation to add all values in you value column. Here is a link for more information on listview settings: https://help.k2.com/onlinehelp/k2five/userguide/5.3/default.htm#Create/Views/ListViewColumnSettings.htm%3FTocPath%3DCreate%7CSmartForms%7CViews%7CList%2520Views%7C_____2


Hope this helps 🙂.


 


Kind Regards 


Prineel


 


K2 will not accept any liability for any issues arising from actions taken in respect of information provided by any forum member.

Hi Prineel,

 

We ended up creating a stored procedure for this purpose. Thank you for your response anyway.

Reply