cancel
Showing results for 
Search instead for 
Did you mean: 

Analityc - Key Figure for calculate number of days.

Former Member
0 Kudos

Hi All,

I would like to know if there is any way to calculate on a key figure how many day pass from a specifyc date to the dayToday.

The idea is to have a report some like:

i.e:

     Date       KeyFigure 1

     11/09         5       (11/09 - 16/09(date today) )

I could'nt find any funtionality for this.

Is this possible?

Regards

Sergio Agüero.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member

Hello Sergio Aguero

You can calculate the number of days passed by creating your own key figure wherein you can have the start date for example and the End Date. This is possible if the date fields are available as key figures. In C4C 1508 version, date fields have been made as key figures which were otherwise characteristics. So only if a date field is avaiable as Key Figure then you can use them in calculation. Not all date fields may be available as Key FIgures. So if in case you are using a specific data source for your report and there you find the date fields as characteristics then you can report to us so that we can consult our developers to analyze the feasibility of having them available as key figures for you to meet your requirement. Let us know if you have created any incident for this issue.

Just to add to it, you wont have any specific key figure such as Date alone in standard key figures, you may have key figures like start date, close/end date, created on etc. For example in the data source - Opportunity Header and Item, you have key figures like start date, close date, today etc. In this case, you can calculate the number of days between start date and today by subtracting today from start date (today-start date) but date may not be available as key figures in all cases.

Hope this helps.

-GowriShankar V

Former Member
0 Kudos

Hi Gowri,

We actually have a similar issue. We are trying to get the duration between today and the escalation date in Data Source-Ticket but Escalation date is only available as a characteristic and not a key figure.

Would this be feasible?

Regards,

Jeffry Antonio

Former Member
0 Kudos

Hi Gowri,

Thanks a lot for you respons it was very helpfull as always.

The only doubt I have is regarding use some function in the Calculation Key Figure área to retrieve the today's day value.

Is it that posible? 

Former Member
0 Kudos

Hello Jeffry Antonio

I previewed the Ticket Data Source and I could see that only Escalation Status is available as a characteristic. Though there are many Date based key Figures like Today, Closing Date, Completion Date,Posting Date, I could not find the Escalation Date even as a characteristic. Did you happen to extend that field to Ticket Data Source?

-GowriShankar

Former Member
0 Kudos

Hello Sergio Aguero

We do not have any function which when used in a key figure can give today's day value but there is another function called Date which returns the integer value in date format:

DATEValue as Date - Returns the integer value in date format.DATE("KF1")

I request you to refer to a very informative document -http://scn.sap.com/docs/DOC-63315 which explains the use of all the functions and operators while creating a Key Figure.

Hope this helps.

-GowriShankar

Former Member
0 Kudos

Updated: Sept 26, 2015

There a few techniques to achieve Aging reports (calculating duration between two time points) for Service scenarios.

Starting in 1508 there are some key enhancements to the main "Ticket" data source that will allow you to configure Aging reports.

In the Ticket data source you will find the following key figures:

Notice that we include "Today" as a key figure. We included this key figure so you can create a custom calculated key figures where you can use "Today" - "Timepoint" to calculate a duration in Days. The Ticket has standard timepoints that represent specific time stamps that a ticket always goes through in this lifecycle sequence which mirrors the ticket status lifecycle:

1. Posted On (Reported On- when the issue is reported)

2. Created On (sometimes the ticket was created in an external system and via API/migration the ticket has a Created On date after the Reported On date)

3. Initial Review On (when the ticket is set to In Process status)

6. Completed On (when the ticket is set to Completed status)

7. Closed on (when the ticket is set to Closed status -> you can set a completed ticket to closed via the time based workflow engine to prevent any change to the ticket)

Anytime during the above lifecycle after a ticket is in process and prior to a completed ticket can go into:

a. Escalated "state" which the Escalated On timepoint is captured

b. Arrived On (when the technician has arrived on site and has captured an on site arrival time)

c. Resolved On (when the technician/agent has resolved the issue)

d. Changed On (when the ticket was last saved)

Today based age duration is usually relevant only for tickets that are not completed in closed status (you usually measure age for SLA compliance for tickets that are either in open or in process). Thus you will take an extra step to create a restricted key figure on the calculated key figure to only capture an Age duration for tickets in status in process or open to filter out tickets that are completed or closed.

All the above examples only work with duration calculations in days. C4C analytics can only calculate duration between Dates and Integers/Decimals. If you need to calculate age in minutes/seconds, you will need to do the following options:

Option 1: export the data into excel and use the timepoints to calculate the diff of Date/Time in excel

Option 2: use standard age key figures in seconds for a few standard duration scenarios such as

Total Time at Requestor (aggregate duration in seconds that a ticket is in customer action)

Total Time at Processor (aggregate duration in seconds that a ticket is in processor action)

For the standard durations that are in seconds, you can configure a custom key figure to calculate the duration in hours, days, etc... using simple math of Total Time at Processor (seconds) / 3600 = Total Time at Processor (hours)

Option 3: add Integer or Decimal fields to the Ticket, and using workflow engine field update rules to capture each timepoint as a UNIX EPOCH timestamp (these are counter based timestamps that increment from 1970 and beyond).

At a high level do the following

1. Add a decimal extension field to the BO (the decimal field is used to store a UNIX EPOCH time stamp)

2. Create a field update workflow rule that will populate this extension field the EPOCH Time in the extension field (This has been available since 1505 as a key user activity).

3. Add a calculated extension field if you want to calculate a duration between two decimal extension fields

4. Add key figures into analytics to do reporting

Then you can decide how to do durations. Duration can be calculated either in analytics (run an analytical report which will calculate duration when the report is run) or stored as a calculated field on the BO. The former is good for compliance/KPI reporting, such as give me distribution of tickets with a duration, counters on specific durations, etc... The later is good if you need to drive a workflow process from the duration (when the duration exceeds a threshold, then trigger a workflow to do something else)

To calculate duration in the BO as a calculated field, create a calculation rule where you subtract one decimal field from another field (similar to how you would do this in analytics).

Former Member
0 Kudos

Look at my updated post. I think you can configure your requirement using the "Today" key figure and the standard date key figures in the "Tickets" data source. There are few more key figures and characteristics for all time points in the "Tickets with Timepoints" data source. Join the two data sources and you should have what you need to calculate age via C4C analytics and/or excel.

CC: ,

Former Member
0 Kudos

Thanks a lot Rai Kasai for your help. It help me a lot.

Regards,

Sergio Agüero.

Former Member
0 Kudos

Hi Gowri,

The ticket data source is a summary data source that has basic header data. If you want all timepoints, go to the Ticket with Timepoints datasource. Join this data source with the Ticket datasource to give you a complete set.

The Timepoints datasource as Escalated on as Date, DateTime, Date Local, and DateTime Local.

In the next release we are planning to move the "Date" based timepoints from a characteristic into a keyfigure so you can calculate duration in days.

Former Member
0 Kudos

Hello Rei Kasai

Thanks for your update. Very informative indeed.

-GowriShankar V

nikhilwalsetwar
Contributor
0 Kudos

Hi Rei,

Could you please provide me clue related to below post?

Current date and Time in Key Figure | SCN

Thanks in advance,

Nikhil

Former Member
0 Kudos

Hi Rei,

I have a similar scenario and sadly what you describe is not working for me.

Scenario: I have created a number of time stamps extension fields using a workflow rule. Note that the update function Time-stamp is only available for date format fields, not decimal fields as you described.

Now I want to calculate the time between those time-stamps. Because they are in date format, the calculated extension field (option 3) does not work.

Surely there must be a way to convert a date characteristic into a key figure?

Many thanks,
Karen

Former Member
0 Kudos

Hi Rei,

Regarding:

"Total Time at Requester (aggregate duration in seconds that a ticket is in customer action)

Total Time at Processor (aggregate duration in seconds that a ticket is in processor action"

Can you confirm if these counters are driven by the "Assignment Status" (i.e. Processor, requester, planner, Partner, Provider) as defined in fine tuning?

Total Time at Requester: Total time ticket has a "Requestor" status assigned

Total Time at Processor: Total time ticket has a "Processor" status assigned

Answers (1)

Answers (1)

Former Member
0 Kudos

HI Rei,

On the 2 steps described here:

1. Add a decimal extension field to the BO (the decimal field is used to store a UNIX EPOCH time stamp)

2. Create a field update workflow rule that will populate this extension field the EPOCH Time in the extension field (This has been available since 1505 as a key user activity).

I created an extension field, but when i create the Workflow rule i am not sure how to store the UNIX EPOCH time-stamp.

I only have Update type "Value". What am i doing wrong?

UPDATE: Just discovered you need to created a Date/time field, not a decimal field

?