Skip to Content
0
Apr 01, 2014 at 04:28 AM

Derivation of new records with new dates from existing records

14 Views

Hi All,

We have a requirement where we are migrating data from Oracle database to sap Hana.In the original table, we have fields Service Dt,project_id,volumes

Service_dt project_id Volumes Jan 15,2013 2354 10000 Feb15,2014 2378 30000 Aug 24,2011 1234 5000

But, now i need to derive new set of records as below:

Service_dt Project_id volumes Derived_DT JAN 15,2013 2354 10000 JAN15,2013 JAN 15,2013 2354 10000 FEB15,2013 JAN15,2013 2354 10000 MAR15,2013 JAN 15,2013 2354 10000 APR15,2013 JAN 15,2013 2354 10000 MAY 15,2013

'

'

'

'

'

JAN 15,2013

'

'

'

'

'

2354

'

'

'

'

'

10000

'

'

'

'

'

DEC 15,2013

FEB15,2014 2378 30000 FEB15,2014 FEB 15, 2014 2378 30000

MAR 15,2014

FEB15,2014 2378 30000 APR 15,2014

'

'

'

'

FEB15,2014

'

'

'

'

2378

'

'

'

'

30000

'

'

'

'

MAR15,2014

AUG24,2011 1234 50000 AUG 24,2011 AUG24,2011 1234 50000 SEP 24,2011 AUG 24,2011 1234 50000 OCT 24,2011

'

'

'

AUG 24,2011

1234

5000

JUL24,2011

For each date in the hana table ,i should generate 12 rows for each month and the volume remains same for all 12 months.

In source table they have generated single record that has a date that represents whole year.And for reporting we require that volumes has to be represented for each month belonging to the year.so, when the user requires to see volumes based on the month ,then my model must fetch the volumes with newly assigned date for that respective month.

for ex:if the user wants to see volumes for sep 24,2011 with project id:1234.

My output should be: