cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Query SAP Hana Extension 2.0

gabriel_gomez
Participant

I am currently creating a 2.0 extension to perform queries.
I am making the extension for sap Hana.
This is the query I am using
SELECT COUNT(VBELN) AS "Quantity", TO_DATE(AUDAT, 'YYYYMMDD') as Datevedia , CURRENT_DATE FROM SAPABAP1.VBAK WHERE ERNAM ='CNX_ERP_CPI' AND AUART ='ZB2C' AND AUDAT >= '20240221' GROUP BY TO_DATE(AUDAT , 'YYYYMMDD') ORDER BY TO_DATE(AUDAT, 'YYYYMMDD');
I have the following problem.
I want to group the results by day.
When the next day passes, the result accumulates and this should not happen. example 11:59 PM is 50 records. The next day should start with 0 records and not 50 from the previous day.
I don't know what I should do to accumulate correctly.

21-02-2024 23:59

gabriel_gomez_0-1708578693952.png

22-02-2024 00:10

gabriel_gomez_1-1708578758305.png

 

 

1 REPLY 1

Mike_L
Dynatrace Guru
Dynatrace Guru

Make sure that the metric is of type "gauge" and not "count", and then solve it within your query to return exactly the number you want to report on each execution.

Mike

Featured Posts