Saitama
Novice

Number of Days in a Leave Request Form

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.

 

8928i601006B62F4D6D00.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!

0 Kudos
Reply
2 Replies
Prineel
Scout

Re: Number of Days in a Leave Request Form

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....


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.

Reply
Saitama
Novice

Re: Number of Days in a Leave Request Form

Hi Prineel,

 

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

0 Kudos
Reply