Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Main:
LOAD * INLINE [
Values, Month, Year,Material_code
1, Oct, 2018, 2000001
2, Nov, 2018, 2000001
1, Dec, 2018, 2000001
0, Jan, 2019, 2000001
0, Feb, 2019, 2000001
0, Mar, 2019, 2000001
0, Apr, 2019, 2000001
5, May, 2019, 2000001
0, Jun, 2019, 2000001
0, Jul, 2019, 2000001
6, Oct, 2018, 2000002
9, Nov, 2018, 2000002
4, Dec, 2018, 2000002
0, Jan, 2019, 2000002
0, Feb, 2019, 2000002
0, Mar, 2019, 2000002
7, Apr, 2019, 2000002
0, May, 2019, 2000002
2, Jun, 2019, 2000002
0, Jul, 2019, 2000002
];
This is Just an example of my requirement,
My requirement is :
Main:
LOAD * INLINE [
Values, Month, Year,Material_code
1, Oct, 2018, 2000001
2, Nov, 2018, 2000001
1, Dec, 2018, 2000001
1, Jan, 2019, 2000001
1, Feb, 2019, 2000001
1, Mar, 2019, 2000001
1, Apr, 2019, 2000001
5, May, 2019, 2000001
5, Jun, 2019, 2000001
5, Jul, 2019, 2000001
6, Oct, 2018, 2000002
9, Nov, 2018, 2000002
4, Dec, 2018, 2000002
4, Jan, 2019, 2000002
4, Feb, 2019, 2000002
4, Mar, 2019, 2000002
7, Apr, 2019, 2000002
7, May, 2019, 2000002
2, Jun, 2019, 2000002
2, Jul, 2019, 2000002
];
the Value of the Previous Month should be displayed in my next month value if only the Value is '0' by using For Loop Function..
Thanks and Regards,
Try this
Main:
LOAD *,
Date(MakeDate(Year, Month(Date#(Month, 'MMM'))), 'MMM-YYYY') as MonthYear;
LOAD * INLINE [
Values, Month, Year, Material_code
1, Oct, 2018, 2000001
2, Nov, 2018, 2000001
1, Dec, 2018, 2000001
0, Jan, 2019, 2000001
0, Feb, 2019, 2000001
0, Mar, 2019, 2000001
0, Apr, 2019, 2000001
5, May, 2019, 2000001
0, Jun, 2019, 2000001
0, Jul, 2019, 2000001
6, Oct, 2018, 2000002
9, Nov, 2018, 2000002
4, Dec, 2018, 2000002
0, Jan, 2019, 2000002
0, Feb, 2019, 2000002
0, Mar, 2019, 2000002
7, Apr, 2019, 2000002
0, May, 2019, 2000002
2, Jun, 2019, 2000002
0, Jul, 2019, 2000002
];
FinalTable:
NoConcatenate
LOAD Material_code,
MonthYear,
Month,
Year,
If(Material_code = Previous(Material_code), If(Values = 0, Peek('Values'), Values), Values) as Values
Resident Main
Order By Material_code, MonthYear;
DROP Table Main;
Anto, did Sunny's post help you resolve your use case? If so, please consider using the Accept as Solution button on his post to let others know this worked for you. If you still need help, provide an update on things, so others can see if they can help.
Regards,
Brett