Quantcast
Channel: SCN : Unanswered Discussions - SAP HANA and In-Memory Computing
Viewing all articles
Browse latest Browse all 4343

Create Measures in SAP HANA

$
0
0

After joining a few tables in SAP HANA, I created an Analytical View with 5 columns. However, all of them are Dimensions. My Measures(Values) would consist of counting the values of the 5 columns.

 

I'm able to get the data I want using SQL statements which look like these:

 

select count(*) AS Meter_Reads, TO_DATE(IR.date_wid) AS Date_of_Read

From "ANLT_SBX"."INTERVAL_READ_F" IR ,

"ANLT_SBX"."ESIID_SDP_XREF" XR ,

"ANLT_SBX"."UAA_METER" UM

where IR.SDP_WID = XR.SDP_WID and XR.ESIID = UM.ESIID

group by IR.date_wid

order by IR.date_wid

 

 

select count(*) AS no_of_times, UM.MTR_NO

From "ANLT_SBX"."INTERVAL_READ_F" IR ,

"ANLT_SBX"."ESIID_SDP_XREF" XR ,

"ANLT_SBX"."UAA_METER" UM

where IR.SDP_WID = XR.SDP_WID and XR.ESIID = UM.ESIID

group by UM.MTR_NO

order by count(*)

 

 

as you can see both of the above queries have counting based on the group by function. which reduces my output dataset from a few thousand rows to less than a 100 which can then be easily represented on the dashboard.

 

Can someone please help me on how to create calculated columns for my Measures? I tried to create a calculated column to get the result dataset of the first query as count_meter_no which has the function as count("MTR_NO") But since the counting is based on the group by function, this column would only give me a value as 1

 

what am I doing wrong here?

 

Thanks for your help guys!


Viewing all articles
Browse latest Browse all 4343

Trending Articles