Data modelling for creating a table in specific format
Hi,
I need to create a table with data in some required format in order to compute one Metric.
I have Monthly Open HC corresponding to months as below (Column 3).
Month_Yr
Yearly Open HC
Monthly Open HC
Mar 2019
0
61830
Apr 2019
61830
61832
May 2019
61830
61834
Jun 2019
61830
61836
Jul 2019
61830
61838
Aug 2019
61830
61833
Sep 2019
61830
61839
Oct 2019
61830
55677
Based on this Column 3 I.e. Monthly Open HC, Yearly Open HC is computed. Yearly Open HC is nothing but last year end Monthly Open HC replicated to all the months of Yearly Open HC as shown above, i.e. 61830 got replicated to all the months as Yearly Open HC.
Now the problem I am facing is that if my Monthly Open HC for last year end i.e. for Mar2019 is 0 then as per functionality this zero value gets replicated as Yearly Open HC for all the months. i.e.
Month_Yr
Yearly Open HC
Monthly Open HC
Mar 2019
0
0
Apr 2019
0
0
May 2019
0
0
Jun 2019
0
3456
Jul 2019
0
6345
Aug 2019
0
2345
Sep 2019
0
4567
Oct 2019
0
8976
but ideally any first non zero value should get replicated for all the months as Yearly Open HC. i.e. 3456 should get replicated.