Hi Community,
I have a input data as attached, I want to calculate 6 months rolling average engagement rate based on success score, where 1 means sent and engaged whereas 0 means sent but not engaged.
I want each NPI to have as many records populated as from past 6 months from min date present in data till max date present in the data
i.e. is the min date in the data is 27th April 2024 and mx date is 14th Dec 2024, each NPI should have date populated from 27th Oct 2023 till 14th Dec 2024, now for the success score column impute missing value as -1.
coming to the engagement rate, it should be calculated as standing on the current date record looking back 6 months data is there any 0 or 1 present if yes then ER = count of 1/count of 0&1, and if the data is not present within the 6 month window the ER should be imputed again with -1.
I'm attaching the input and output both here in the excel, this is a little urgent requirement please, let me know if more clarification is needed.