Number of Days in a Leave Request Form

  • 1 September 2020
  • 2 replies



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.




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



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:

Hope this helps 🙂.


Kind Regards 



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.