Hi I have a data set called data1
with 3 columns one is called Close.Date
the other one is called Closed.Won.MRR
the other one is called Sign.up.Date
A sample of the data
Close.Date Closed.Won.MRR Sign.up.Date
2020-04 447.0 2020-02
2020-03 100.0 2020-02
2022-04 536.4 2022-03
2022-06 150.0 2022-03
2022-06 125.0 2022-03
2022-06 147.0 2021-10
... ... ....
with this data and with code I already created a dataframe called cohort_table2
that on the rows has all the Sign.up.Date possible as string names on a column called Period
and on the columns have all the Close.Date possible as string column titles
it looks like this but right now is empty
Period 2020-02 2020-03 2020-04 ... ... ..
2020-02 0 0 0
2020-03 0 0 0
2020-04 0 0 0
.
.
.
.
how can I go row by row of my data and put it in the right bucket and that it keeps going summing each value in the right position until is finished, for example a record
Close.Date Closed.Won.MRR Sign.up.Date
2022-04 447.0 2022-04
it will put a value of 447 on the location for (row/ period) 2022-04 and column 2022-04 (close.Date), then it will move to the next record do the same until it finishes with all the records
for example for the first 2 records the dataframe cohort_table2
will look like this
Period 2020-02 2020-03 2020-04 ... ... ..
2020-02 0 100 447
2020-03 0 0 0
2020-04 0 0 0
.
.
.
.