Former Member

# Calculating KeyFigures values for the time interval entered in the prompts

Hi All,

We have a requirement to be achieved in a Calculation View (preferably Graphical)

Here is the requirement, it is required to calculate the %KF- A value which is the result of division of KF Numerator with KF Denominator. How those KeyFigures are derived are as shown below.

This calculation to be based on the date entered by the user in the prompt during query execution. If the user enters date from Jan-1 till Jan-31, the report should display 31 records with one record each for the day and calculation to be based only for that time interval entered by the user.

% KF-A

KF Numerator

KF Denominator

Date1 - Distinct list of Dates in record set, based on date interval given in selection in prompt.

KF-Numerator

Date1/ KF

Denominator

on Date1

Count of documents with the following timestamp filters:

Timestamp (Date1, Prompt time) >= Date-A

AND

Timestamp (Date1, Prompt time) < Date-B

AND

Timestamp(Date1, Prompt time) >= Date-C

AND

Exclude records when Char-A = ‘x’

And few other date filters like the above three

Count of documents with the following timestamp filters:

Timestamp (Date1, Prompt time) >= Date-A

AND

Timestamp (Date1, Prompt time) < Date-B

AND

Exclude records when Char-A = ‘x’

And few other date filters like the above three

Date2

KF-Numerator

Date3/ KF

Denominator

on Date3

Same logic as above but replace Date1 with Date2

Same logic as above but replace Date1 with Date2

Date3

KF-Numerator

Date3/ KF

Denominator

on Date3

Same logic as above but replace Date1 with Date3

Same logic as above but replace Date1 with Date3

The problem we have here is how to do the calculations for each day between the intervals entered by the user and get the KF Numerator and KF Denominator value for that time interval.

We are trying to achieve this on an already built Calculation View. The final output would look something like this for the date between 1st Jan 2016 till 10th Jan 2016

Date Interval in prompt % KF A KF Numerator KF Denominator 1/1/2016 89.60% 198 221 1/2/2016 89.60% 198 221 1/3/2016 89.50% 205 229 1/4/2016 89.50% 205 229 1/5/2016 89.50% 205 229 1/6/2016 89.50% 205 229 1/7/2016 89.50% 205 229 1/8/2016 93.50% 215 230 1/9/2016 93.50% 215 230 1/10/2016 93.50% 215 230

This is like a loop concept in ABAP where in the values to be calculated for each day between the intervals entered in the prompt.

Regards,

Pramod

10|10000 characters needed characters exceeded

### Related questions

Posted on Sep 06, 2016 at 10:24 AM

This can be done in a graphical calculation view. You can use the input dates to join to a master data table to generate your dataset, a loop is not required.

See this post for a similar example -

Michael