Hi All,
We are on HANA SP8 version.
I am aware that we cannot select directly from analytical view with out grouping by.
My requirement was to join the analytical view with a temp table to filter some records and then do aggregation .
Below query is failing with
feature not supported: not allowed over OLAP VIEW : search without aggregation, grouping by expression other than view column or user defined function with string type
ALERT_NEW - analytical view
TMP_SELECTION_FILTER - physical temp table
Query:
SELECT
A.DDDD_ID, A.PRODUCT_ID, A.CAPTURE_DATE ,
COUNT(DISTINCT (A.CAPTURE_DATE)) AS PINDAYS
FROM "ALERT_NEW"as A
inner
join"TMP_SELECTION_FILTER"AS SF
ON SF.EPH_ID = A.SELECTION_ID
AND
A.VALID_ALERT = 'Y'
GROUP
BYA.DDDD_ID, A.PRODUCT_ID, A.CAPTURE_DATE;
But if I remove the distinct in the count , query is working
Query:
SELECT
A.DDDD_ID, A.PRODUCT_ID, A.CAPTURE_DATE ,
COUNT(A.CAPTURE_DATE) AS PINDAYS
FROM "ALERT_NEW"as A
inner
join"TMP_SELECTION_FILTER"AS SF
ON SF.EPH_ID = A.SELECTION_ID
AND
A.VALID_ALERT = 'Y'
GROUP
BYA.DDDD_ID, A.PRODUCT_ID, A.CAPTURE_DATE;
Any idea why distinct is causing the issue. I still need to get the distinct count .
Regards,
Suman.