I'm trying to figure out how I would configure an expression rule to perform a rolling sum by userId.
For a given person, calculate how many hours they worked for a rolling 7 days, and if they have exceeded 10 hours then return true. Otherwise, false.
My data looks like this:
Given the table above, it calculates from the current date (inclusive) for the last 7 days.
Is it possible to configure a calculation like this in Appian? For all intents and purposes, once they have broken the 10 hour mark a separate table would be updated to mark the number of times in a given month they broke the 10 hour consecutive hours.
If it is possible, how would I go about doing this?
p.s. sorry if i used some nomenclature wrong. Appian is a new experience for me.
Discussion posts and replies are publicly visible
At what time do you want to do this? At record query time, at record update time, in a process, at UI level?
For which purpose? A validation?
Do you need to do this for many users at the same time or only one?
The process would run daily to process the entire set of records and calculate for the given date. More succinctly if I go back to my example above. It would run once at the end of the day for the 8th and determine that the current result is false. Then on the 9th it would run at the end of the day and determine result is true.
Record query time -> No
Record update time -> Maybe
in a process -> Yes
UI -> No
The purpose is to have a points accumulation system. When they break this threshold they achieve a point. The following day if they break the threshold they earn a point.
The user would only ever see their points they have accumulated by month.
This process should run daily and process the total calculation for all users that exist in the table.
IMHO, this sounds like a stored procedure might be a good option.
That was the way I was immediately leaning, but i come from a db / backend development background. So I was trying to see if there was an Appian way before I turned that direction.
Well, this is something you could do in Appian, in theory, but Appian is not meant to do any sort of larger data processing.