I have a requirement to report on the amount of time used for an end-to-end proc

I have a requirement to report on the amount of time used for an end-to-end process flow. There are some complexities within the process flow that may cause ad-hoc extensions to the time allowance for that flow, so I am looking at creating a database table to record the initial time allowance, time used up already (for completed tasks within the process flow) and additional time allowances. The resultant data is to be displayed on reporting dashboards.
My question is around the best way to represent those positive and negative amounts of time. I see that there is a Time data type in Appian, but is that used to represent an amount of time, or the time of day? (Can it be negative?)

OriginalPostID-219721

OriginalPostID-219721

  Discussion posts and replies are publicly visible

  • You can use these functions to implement your use case:
    forum.appian.com/.../Date_and_Time_Functions.html

    You can compare two days using (>, <, etc ...)

    Can it be negative? Give it a test drive yourself with static data ...
  • Hi @mohamedb, I'm ok with calculating the difference between dates, what I was asking about was how to represent these values in the database.
    I see that MySQL has a Time data type, but I'm unconvinced that the Appian Time data type is the correct mapping for the CDT.
    Just wondering if other people have used this data type for this purpose.
  • Mike, the Time data type represents a time of day, not an amount of time. In order to appropriately map to Appian's Time data type, the MySQL type would need to be datetime.
  • @mikej

    We made a difference between the two timings and that difference has been converted to day : hr : mins : secs format and inserted into DB.

    It's like use difference between the time and that results you can pass it into day()
    hour() minute() seconds() and create your own format

    Created a VIEW and by using database functions we added to all the approvals time of one particular order and that is been queried for report and it is shown. This seems to be quite accurate time calculated for each orders
  • Thanks @scottf281. It looked that way from the docs, thanks for confirming.

    Thanks for your reply @mohammedz. So you're handling the conversion logic in Appian and storing the values as Text?
  • Former Member
    0 Former Member
    This may add complexity to your scenario, but you could gather the difference between 2 timestamps to get an interval in seconds as an integer. Integers can be positive or negative, and gathering the interval in total seconds can keep that as a common point of reference for conversions to minutes, hours, days, weeks, months, years, etc. This gives you the ability to perform calculations on the integer.

    You could then have another data type as String to format the display of the integer as you desire. For example, your interval displays as -123 seconds, and you do not need to do any further calculations on this value, and instead want to display it in a nice format. With Text you could display it as: "- 00:02:03" or "-02 minutes & 03 seconds".

    It would be best to have this as 2 separate fields so you can call them as you need -- integer to perform your calculations/conversions, and text to display as you desire.

    Might not be what you're looking for, but figured I'd throw the idea out there.
  • Thanks Sean. Using integer values was my backup plan for this, but I just wanted to scope out if there were other options. Interesting idea to store both the 'raw' integer and textual value - I'll see if that is useful for my use case.