Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
7 replies
Subscribers
7 subscribers
Views
2299 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
General
I have a requirement to report on the amount of time used for an end-to-end proc
mikej117
over 7 years ago
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
0
mohamedb
over 7 years ago
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 ...
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
mikej117
over 7 years ago
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.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
scott.frantz
over 7 years ago
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.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
mohammedz
A Score Level 2
over 7 years ago
@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
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
mikej117
over 7 years ago
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?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Former Member
over 7 years ago
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.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
mikej117
over 7 years ago
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.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel