cancel
Showing results for 
Search instead for 
Did you mean: 

SAP C4C Service - Time Calculation Fields

kendal_evans1
Explorer

Hi experts,

I am trying to find a way to calculate the time that elapsed between creating a ticket (Created On) and Completion Date

I have tried using KUT by creating a Calculated Extension Field, but I cannot get this to work. To gain access to Date/Time fields, I can only choose 'Text' option. The only operator is '&'. I do not understand this.

Is there any way to calculate or report on time elapsed between Created On and Completion Date?

Please assist

Regards,

Kendal

0 Kudos

Hi Leslie,

We have a similar requirement for reporting purposes where we have to capture the first Agent response time (as key figures) for analysis. Was your issue resolved? What should be the approach in our case?

Regards,
Ayushi Verma

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Kendal,

The time to completion (from Reported On till Completion Date) is available in the Tickets Datasource as Ticket Handling Time.

If you want to calculate the time elapsed between two other events not covered by standard, your approach is going in the right direction. You actually need at least 2 custom fields: one to store the timestamp of the first event, one to store the timestamp of the second event. If yo uwant, you can add also a calculated field with the difference, or you can simply handle this in reporting via a calculated key figure. These fields should be of type Quantity, because they will all store a number in Seconds.

You can now define two workflow rules of type Field Update, to store the current date/time in the fields when the relevant events happen (for example, you could define a rule on Save, with condition on Status change from "In Process" to "Complete"). When defining the field update, you can pick the Calculated option to ask the system to store the timestamp.

All custom fields of type Quantity are automatically available as key figures in reporting, so you can easily define a calculated key figure as the difference of those two fields (and further divide it by 60 to get the time in minutes, etc.).

Hope this helps,
Gab

kendal_evans1
Explorer
0 Kudos

Hi Gab,

I am busy trying this for another event, what you have described above - when a ticket goes into a status that is 'provider action' then my understanding is that it should accumulate time in the key figure for Time at Provider and the same for a status that is Requestor Action feeding the key figure Total Time at Requestor. However, I have found that the Time at Requestor has time in it for tickets that are In Process (Provider Action). This raises the question - Is time at requestor linked to Requestor Action Statuses? And similarly is Time at Provider key figure linked to status Provider Action?

If not, then my understanding of this is wrong and I need to find a new approach to calculate total time a ticket spent with the provider and total time it spent with the requestor.

For e.g. If a ticket's total handling time was 7 hours, this could be the timeline -

1hour - Open (Provider Action)

1hour - In Process (Provider Action)

2hours - Customer Action/More info needed/Customer to Test (Requestor Action)

2hours - In Process (Provider Action)

1hour - Solution Proposed (Requestor Action)

Complete

I want to depict this in a report that shows

Time with Provider: 4hours

Time with Requestor: 3hours

I am testing to see if this is possible, but it would be great if you could validate this. Am I on the correct path?

Regards,

Kendal

Answers (4)

Answers (4)

yamilito01
Explorer
0 Kudos

Dear SAP team,

We have created into sales quote scenario two extension fields witch help us to monitor when an internal process start and finish, this are date/time type fields. What we need is the difference in days between this two dates, witch would result in a numeric value.

We tried using the field update workflow rule by the formula " #F2# - #F1# " witch syntaxis marks as correct

  • Field to be updated, decimal (with no decimal) type
  • Start time field (F1), date/time type
  • End time field (F2), date/time type

Apparently the workflow is configured correctly but when it´s executed the workflow monitor (into the sales document) marks as failed "An error occured while evaluating the formula". We alredy tried differents formulas combinations always with syntax correct but never works.

We already tried with "Duration" and "Now" functions but they weren´t useful for our case because the result of both functions is a "date" and what we need is the difference in days between two dates, witch would result in a numeric value.

Does anyone know if this is possible to achieve and what's the correct function or syntax needed?

I´ll look forward for any useful information.

Thanks in advance for your help and best regards,

0 Kudos

Hi Gab,

I am also facing this issue. I wan't to create a custom field as copy of a date/time field. The source field is in an activity (opend activity) of a ticket, the target field should be in the overview of activities in the ticket it self (under tab "activities"). If done this with other fields (like Completion in %), this works. But Date / Time fields seems not to update.

Will there be more Options in the future as well? e.g. not only "&" in Calculation, Change of calculation rule of field after first creation...

thanks

best regards

Holger

former_member622
Employee
Employee
0 Kudos

Hi Gab

I orginally tried with the text field as it was the only one which showed the Calculated button:


Neither Date or Time have this option and DateTime is not available at all


I have tried with workflows but they do not populate the field in the way I want. In the end I came up with an idea but I require help in order to realize it as I have searched the community and found nothing:

1. Create a 'copy' of the Last Agent Interaction Date Time Key figure. This is already available under Ticket Time Points and Contact Party Datasource.

2. Restrict this in some way that it only updates once - In the same way that the Initial Review Date and Created On fields act.

3. Enable this figure for viewing on the Ticket Screen.

Thank you for your help on the matter, Your time on this is always appreciated.

Best Regards
Les

Former Member
0 Kudos

Hi Leslie,

What I meant is that if you use a feld of type Date or Time, you will be able to define workflow field updates of type "Calculated". See the screenshot below. The field itself is not "calculated" (does not have the calculated field, which in fact is not even available for those field types).

Kind regards,
Gab

former_member622
Employee
Employee
0 Kudos

Hi Gab

Yes, that is exactly what I'm looking for but unfortunately it is not an option on my instance. I can get a date stamp, I can get a timestamp but do not have the option for Current DateTime.

As you can see below:

Field Picker (Tickets Screen):

Workflow choosing Date:

Workflow choosing Time:

Former Member
0 Kudos

Hi Leslie,

Apologies for the delay. Not sure if you have figure this out in the meantime. You should try defining your extension field as a Decimal Number (with no decimals). The calculated field update will store the timestamp in the field as a number of seconds (since a fixed past date). By storing the timestamp for two different events in two different decimal fields, you will be able to calculate the number of seconds elapsed as the difference between the fields.

Hope this helps!
Gab

former_member622
Employee
Employee
0 Kudos

Hi Gab

I am trying out your advice in order to record a timestamp of when the first response was sent to the customer. The goal is to show this in the timeline section in the same way as other timestamped values e.g. Created On etc.

However, I am having some trouble. I created an extension field in the Timeline section and then I created a workflow with the following conditions...

When I define the action, I only get the option to add a text value. There is no option to link the update to another system field or calculate a value.

Is there another way I can timestamp this?

Thanks and Regards
Les

Former Member
0 Kudos

Hi Leslie,

What field type is Initial Response? The "Calculated" update type should be available for all fields of type Date, Time, and DateTime. Perhaps you defined Initial Response as a Text field?

Kind regards,
Gab