A Functional approach for Two Way Dimension Reduction in Time Series