# Creating Key Figures – Data Operators

Hi,

This blog will approach Data Operators for creating new key figures.

If you want to check another available operators, please check the blog posts below:

### Data Operators in your system

• COUNT
• NDIV0
• NOERR
• %CT
• %GT
• DATE
• DELTA
• NODIM
• SUMCT
• SUMGT
• TIME

I’m going to provide with a practical example on the operators. Please consider the formulas used and change their values as below:

ValueOrKeyFigureToBeCompared1 = Confirmed Quantity

ValueOrKeyFigureToBeCompared2 = Ordered Quantity

After the explanation of each Data Operator, you will find a table with example of possible results based on the provided values and formulas.

COUNT

It counts the number of values per row.

Example: COUNT(“ValueOrKeyFigure1”)

NDIV0

Is zero if the calculation causes a division by zero. Otherwise, the regular result of the expression will be provided.

Example: NDV0(“ValueOrKeyFigure1”/ “ValueOrKeyFigure2”)

NOERR

Is zero if the calculation of the mathematical expression leads to an arithmetical error.

Example: NOERR(“ValueOrKeyFigure1”/ “ValueOrKeyFigure2”)

%CT

Indicates how high the percentage amount is with regard to the result. Result here means the result of the aggregation at the next-highest level (intermediate result).

Example: %CT(“ValueOrKeyFigure1”)

%GT

Indicates what percentage the amount is of the grand total. Grand total here means the result of the aggregation at the highest level of the list.

Example: %GT(“ValueOrKeyFigure1”)

DATE

Transforms a value into date.

DELTA

Returns value 1 if the <expression> is 0, otherwise 0

Example: DELTA(“ValueOrKeyFigure1”/ “ValueOrKeyFigure2”)

NODIM

It removes any unit or currency existent in the key figure value.

SUMCT

Returns the result of the operand to all rows or columns.

Example: %SUMCT(“ValueOrKeyFigure1”)

SUMGT

Example: %SUMGT(“ValueOrKeyFigure1”)

TIME

Switches the value of a key figure to time.

### Table with examples for Data Operators

I hope you all have been able to understand a bit more on Data Operators. If you have any doubt, please do not hesitate on commenting them below. ?

### Assigned Tags

You must be Logged on to comment or reply to a post.

Hello Elise,

Do you think we can create a fixed line running across bar charts? For example, I have a bar chart representing the number of opportunities per month for current year. Let's say the sales reps have a target of 10 opportunities per month. No, on my chart, I want to show this value 10 as a line. Think it is possible?

I tried creating a calculated key figure: Number of Opportunties EQ 10 but the result remains 0.

Any ideas?

Kind Regards

Naseef

Elise Teixeira
Blog Post Author

Hi Naseef,

I hope you are doing well.

Currently, SAP Hybris Cloud for Customer does not support target line in our charts/reports.

1. Go to Business Analytics work center and Design Key Figures view;
2. Click on New button;
3. Type a name (I typed “Target 10”);
4. Select a Data Source (I selected Opportunity Header and Item [CODOPPU])
5. Click on the radio button for Calculated Key Figure;
6. Go to the next step;
7. Type “10” in the formula label;
8. Finish it.

Now the created key figure will show only 10 independently on your other key figures value.

I have added this key figure to a bar chart within Opportunity Pipeline Report CODOPPU_Q0014, and it is being shown like this:

As I don’t believe that this chart is user friendly, I have tried changing it to Line chart type as below:

Please let me know if does it fit to your business needs. Also, I would like to kindly ask you to address an idea for standard target line into our SAP Customer Influences, as I strongly believe that this is an excellent suggestion. If you decide to do it so, please inform me the idea URL and I will be more than happy on voting for it as well.

Best regards,

Elise

Hi Elise! 🙂

Thanks a looot! That is indeed what I was trying to do except that instead of just adding the number on the formula label, I was trying an actual formula!

I am actually using it on a dual axis combination chart and so far works well. This is what I was trying to do:

I noticed though that on this type of chart, I cannot add a "Target" as you have shown based on the Y-axis (items won + lost on the screenshot). There was a final line I would have loved to add that is set at let's say 10M. If I proceed using the same logic as above, the whole graph gets messed up as I believe the result is being based on the Percentage (%) axis. I wanted to add another line showing for example 20M (straight line).

I have shared the idea:

https://influence.sap.com/sap/ino/#/idea/235722

Thanks again Elise, great help as always 🙂

Naseef

Elise Teixeira
Blog Post Author

Hi Naseef 😀

I have just voted on the submitted idea and asked my colleagues to do the same.

Elise 🙂

Hi Elise,

How do we convert a value to a Date? Whats teh format of the 'value' that is converted by a DATE To a constant value of MM-DD-YYYY or an acceptable format that can be used in Key figures as a date?

Regards,

Thank you for the very informative blog...! this is very helpful.

We have a below requirement in our business process,

We want to compare the Actual sales and Targets Amount in C4C. The primary key is Account+ Product Category+ Year+ Month. Actual Sales values are replicated from the BW system in to a Cloud datasource (CDS) and the Target Amount is maintained in Sales Target Planning.

Consider we do Left outer Join between these Datasource with Actual sales CDS as Anchor. In Actual sales CDS the entry for the Combination "Account 1 + Product Category 1 + 2020 + January" is not there, but the Target Amount maintained for this Combination in Sales Target planning. But in the Joined data source we will lose this row as the leading data source is not having this combination.

But as per our requirement, all the combinations of "Account+ Product Category+ Year+ Month" should available in the target report irrespective of this entry is available in Actual Sales CDS (or)  Sales Target Planning datasource.

I tried with the combined datasource as well, but here we get the entries with # and i think this is limitation explained by SAP in the KBA

https://apps.support.sap.com/sap/support/knowledge/en/2488796

Currently we are stuck here, Please suggest if we have some option to satisfy this requirement.