Datalist Column Calculation

Confluence User - 12 Sep, 2020

Hi, I am working on a process that tracks the issues. I want to show the number of days the issue has been open when user shows the datalist. This is obviously not done at the form level. So I tried to setup a column so that it calculates the difference between current date to the date when the issue first started (which is recorded in the form). I tried to use javascript formatter to do it but was unsuccessful.


Anyone has experience with this?

datalists;forms

4


14 Sep, 2020
confluenceUser
confluenceUser

You can use JDBC Binder in Datalist Datasource and in your SQL, use Date Calculations:

MySQL provides several functions that you can use to perform calculations on dates, for example, to calculate ages or extract parts of dates.

Your "the number of days the issue has been open" is a calculation field and is a new column in your list.

14 Sep, 2020
confluenceUser
confluenceUser

thank you Matthew. The issue is that this "end date" is dynamic, which is the day that an user is reading the list. Therefore the "days opened" is whenever an user is showing the list compared to the "report date" that is in the database table.


Is that possible?

15 Sep, 2020
confluenceUser
confluenceUser

Use the Joget date hash variable "#date.yyyy-MM-dd#" to plugin today's date and MySQL datediff() function.

15 Sep, 2020
confluenceUser
1
confluenceUser

I ended up using Scheduler with Database Update Tool to run daily update for this. Don't know if it is the best way but it works for now.

RELATED QUESTIONS

Your answer


To answer a question you'll need an account.

Print