+DEFINE{ query_name 'rrcx_pdf_neighbor_cell';
+ max_lfta_disorder '1'; max_hfta_disorder '1';
+}
+PARAM{ window uint;}
+// rsrp, rsrq, sinr ranges are 0 .. 127
+// for now divide into 5 bins.
+
+select ($window*(tb+1))/1000 as TS, $window/1000.0 as measurementInterval,
+ physCellId as CELL_ID,
+ count(*) as cnt,
+ sum(GEQ(rsrp, 0)*LEQ(rsrp,21)) as rsrp_vbad,
+ sum(GEQ(rsrp,22)*LEQ(rsrp,36)) as rsrp_bad,
+ sum(GEQ(rsrp,37)*LEQ(rsrp,51)) as rsrp_medium,
+ sum(GEQ(rsrp,52)*LEQ(rsrp,66)) as rsrp_good,
+ sum(GEQ(rsrp,67)*LEQ(rsrp,127)) as rsrp_vgood
+from RRCXFER.nr_neighbor
+// where schemaId = 4
+group by timestamp_ms/$window as tb, physCellId
+;
+
+
+DEFINE{ query_name 'rrcx_pdf_serv_gnb';
+ max_lfta_disorder '1'; max_hfta_disorder '1';
+ comment 'distribution of the ssb rsrp of neighbor cells aggregated by cell id, computed from rrc transfer';
+}