Help with code
I have this code in oracle
if (Income == “NULL”) {0}
else if (Emplid == Prior(Emplid) && Income != Prior(Income)) {1}
else if (Emplid != Prior(Emplid) && Income != “Unreported”) {1}
else {0}
I did this
It does not work; I appreciate any advice.
I have this code in oracleif (Income == “NULL”) {0}else if (Emplid == Prior(Emplid) && Income != Prior(Income)) {1}else if (Emplid != Prior(Emplid) && Income != “Unreported”) {1}else {0}I did this SELECT *, case WHEN Income = ‘NULL’ THEN 0 WHEN LAG(Emplid) OVER (ORDER BY Emplid ASC, Term ASC) = Emplid AND LAG(Income) OVER (ORDER BY Emplid ASC, Term ASC) != IncomeYY THEN 1 WHEN ROW_NUMBER() OVER (PARTITION BY Emplid, Income ORDER BY Term ASC) = 1 THEN 1 WHEN LAG(Emplid) OVER (ORDER BY Emplid ASC, Term ASC) != Emplid AND Income != ‘Unreported’ THEN 1 ELSE 0 END AS PREVIUOS_INCOME FROM TableIt does not work; I appreciate any advice. Read More