PG =(OPi,q-OPi,q–4)/book equity
OP=REVTQ–COGSQ–XSGAQ–XINTQ
book equity =TXDITCQ-PSTKQ or SEQQ or CEQQ+PSTKQ or ATQ–LTQ
all data comes from wrds
follow the rule of calculation, how can i get OP lagged four quarters, thanks a lot if you can show me the codes!