Skip to Content

Dimension/Measures for Durations (HH:MM:SS) in SAP Analytics Cloud

Hello Community,

I work with the SAP Analytics Cloud and would like to display processing times as HH:MM:SS in my story. These times should also be calculated in regard to selected filters.

In my backend system (a data model based on ABAP CDS View with an SAP S/4Hana with a live data connection) I've created a dimension (later as key figure) "Durations in Seconds". Here I've used the function "tstmp_seconds_between" predefined in the ABAP CDS View with the corresponding time stamps available in the dataset.

Furthermore I did some type conversions to use the built-in functions DIV and MOD. With the following code I finally calculated the dimensions for HH, MM and SS:

When you preview the ABAP CDS View, you get the following result:

The dimensions HH, MM and SS are calculated correctly from the number of seconds. The model behaves as expected.

I converted dimensions HH, MM and SS into key figures in the cube and query views:

If you look at the result in the SAP Analytics Cloud, you unfortunately get wrongly calculated values. It looks as if, among other things, the values for HH were not calculated correctly.

If you look at the above values "46 * 60 + 540", you get "3300". It is at least partially comprehensible. If we look again at the individual items (in SAC), they are also correct:

I suspect that the calculation must actually take place in the query. Possibly with annotation of the form "@AnalyticsDetails.query.formula", but to my knowledge the modulo operator is not supported, right?

The modulo operator is not present in the SAC either, is it not? As a reminder, this is a live data connection.

I am very grateful for hints or alternative solutions.

Thank you!



Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

0 Answers