Hello, I’m working on a project where I’m trying to replicate a table in SAS that I originally created in SQL. I’ve already completed the necessary joins and filters using Query Builder. However, I’m having trouble with the following column that I need to include in my SELECT statement and save as tkz_count: SELECT ................, (CASE WHEN ROW_NUMBER() OVER (PARTITION BY a.POLICY_ENDORSEMENT_SK, cc.TKZ_ID ORDER BY 1) = 1 AND e.POLICY_STATUS_ID = 5 THEN 1 WHEN ROW_NUMBER() OVER (PARTITION BY a.POLICY_ENDORSEMENT_SK, cc.TKZ_ID ORDER BY 1) = 1 AND e.POLICY_STATUS_ID = 3 THEN -1 WHEN ROW_NUMBER() OVER (PARTITION BY a.POLICY_ENDORSEMENT_SK, cc.TKZ_ID ORDER BY 1) = 1 AND a.ENDORSEMENT_TYPE_CODE = 28 THEN 1 ELSE 0 END) TKZ_COUNT FROM ........ I tried using computed columns in query builder and proc sql, but I couldn’t get it to work. Any help would be greatly appreciated. Thanks!
... View more