I would appreciate any pointers on what is wrong with my case statement, if the Current CLUSTERn = Previous CLUSTERn Then add the Previous PRODCAT to the current line as PREVCAT...
ORA-30484: missing window specification for this function
30484. 00000 - "missing window specification for this function"
*Cause: All window functions should be followed by window specification,
like <function>(<argument list>) OVER (<window specification>)
*Action:
Error at Line: 11 Column: 30
SELECT CLUSTERn,
MEMBERn,
COUNT(*) OVER ( PARTITION BY CLUSTERn ORDER BY MEMBERn, PRODCAT, STARTd, ENDd ) AS NEWRANK,
CASE WHEN CLUSTERn = LAG(CLUSTERn) THEN LAG(PRODCAT) ELSE 'New' END AS PREVCAT,
STATUS,
PRODCAT,
JOINTYPE,
JOINRANK,
CSP,
PROGID,
PROMNAME,
PROMOID,
COHORT,
FWEEK,
STARTd,
ENDd,
SOURCE
FROM(