Only last record in data source loaded via TI process
Posted: Tue Aug 23, 2011 5:36 pm
My issue is that only the last row of the selected data range is loaded in the TM1 cube. For example if the source SQL table has 10 rows of data, only the 10th row is loaded.
Below is an example, SQL where the date range is 1/1/11 thru 7/31/11. The last data value is recorded on 7/26/11. All records prior to 7/26/11 are skipped and not loaded.
I have checked the TI settings several times. I believe the issue is with either the SQL Server table or the SQL Script that I am using. Any suggestions or advice that can be provided will be helpful.
I have written a simple SQL script to load data via TI using an ODBC SQL Server data source. Below is the SQL script:
SELECT UnitCd, CurDT,
sum (LaborCostChng) Labor,
sum (MaterialCostChng) Material,
sum (SubcontCostChng) Subcontract,
Sum (POCommitChng) POCommitChng
FROM dbo.MaintWoData
where CurDT >= ‘2011-01-01’
and CurDT <= ‘2011-07-31’
and PlantCD in ('295', '296')
and UnitCd = ‘04’
and WoClass <> '3'
group by UnitCd, CurDT
order by UnitCd, CurDT
The result of the query in the TI preview window is below:
UnitCD CurDT Labor Material Subcontract POCommitChng
04 2011-01-01 00:00.0 -778867.47 -57770.62 -26760.47 0
04 2011-01-02 00:00.0 0 0 0 0
04 2011-01-03 00:00.0 0 0 0 0
04 2011-01-04 00:00.0 20149.98 10591.26 667.5 45126.18
04 2011-01-05 00:00.0 32664.28 42626.26 36998.67 8331.89
04 2011-01-06 00:00.0 30621.05 44221.77 2800.35 26199.54
04 2011-01-07 00:00.0 0 5019.17 19631.9 -15568.88
04 2011-01-08 00:00.0 0 0 0 0
04 2011-01-09 00:00.0 0 0 0 0
04 2011-01-10 00:00.0 54987.33 48258.76 2212.69 15122.71
The variables settings are below:
UnitCd String 00 Element
CurDT String 2011-01-01 00:00:00.000 Other
Labor Numeric -487069.570000 Data
Material 0.000000 Data
Subcontract Numeric 0.000000 Data
POCommitChng Numeric 0.000000 Data
vDate String 01-01 Element Formula
vVersion String Actual Element Formula
vYear String 2011 Element Formula
Dimension maps
UnitCd 00 Units As Is String By Input
vDate 01-01 Days As Is String By Input
vVersion Actual Versions As Is String By Input
vYear 2011 Years As Is Numeric By Input
(Data Variables) Daily Cost Accounts As Is By Input
Data Maps
Labor Labor Numeric -487069.570000
Material Material Numeric 0.000000
Subcontract Sub-contract Numeric 0.000000
POCommitChng Committed Numeric 0.000000
Advanced data tab:
#****Begin: Generated Statements***
CellPutN(Labor,'Summary Data_v3',vVersion,vYear,UnitCd,vDate,'Labor');
CellPutN(Material,'Summary Data_v3',vVersion,vYear,UnitCd,vDate,'Material');
CellPutN(Subcontract,'Summary Data_v3',vVersion,vYear,UnitCd,vDate,'Sub-contract');
CellPutN(POCommitChng,'Summary Data_v3',vVersion,vYear,UnitCd,vDate,'Committed');
#****End: Generated Statements****
Below is an example, SQL where the date range is 1/1/11 thru 7/31/11. The last data value is recorded on 7/26/11. All records prior to 7/26/11 are skipped and not loaded.
I have checked the TI settings several times. I believe the issue is with either the SQL Server table or the SQL Script that I am using. Any suggestions or advice that can be provided will be helpful.
I have written a simple SQL script to load data via TI using an ODBC SQL Server data source. Below is the SQL script:
SELECT UnitCd, CurDT,
sum (LaborCostChng) Labor,
sum (MaterialCostChng) Material,
sum (SubcontCostChng) Subcontract,
Sum (POCommitChng) POCommitChng
FROM dbo.MaintWoData
where CurDT >= ‘2011-01-01’
and CurDT <= ‘2011-07-31’
and PlantCD in ('295', '296')
and UnitCd = ‘04’
and WoClass <> '3'
group by UnitCd, CurDT
order by UnitCd, CurDT
The result of the query in the TI preview window is below:
UnitCD CurDT Labor Material Subcontract POCommitChng
04 2011-01-01 00:00.0 -778867.47 -57770.62 -26760.47 0
04 2011-01-02 00:00.0 0 0 0 0
04 2011-01-03 00:00.0 0 0 0 0
04 2011-01-04 00:00.0 20149.98 10591.26 667.5 45126.18
04 2011-01-05 00:00.0 32664.28 42626.26 36998.67 8331.89
04 2011-01-06 00:00.0 30621.05 44221.77 2800.35 26199.54
04 2011-01-07 00:00.0 0 5019.17 19631.9 -15568.88
04 2011-01-08 00:00.0 0 0 0 0
04 2011-01-09 00:00.0 0 0 0 0
04 2011-01-10 00:00.0 54987.33 48258.76 2212.69 15122.71
The variables settings are below:
UnitCd String 00 Element
CurDT String 2011-01-01 00:00:00.000 Other
Labor Numeric -487069.570000 Data
Material 0.000000 Data
Subcontract Numeric 0.000000 Data
POCommitChng Numeric 0.000000 Data
vDate String 01-01 Element Formula
vVersion String Actual Element Formula
vYear String 2011 Element Formula
Dimension maps
UnitCd 00 Units As Is String By Input
vDate 01-01 Days As Is String By Input
vVersion Actual Versions As Is String By Input
vYear 2011 Years As Is Numeric By Input
(Data Variables) Daily Cost Accounts As Is By Input
Data Maps
Labor Labor Numeric -487069.570000
Material Material Numeric 0.000000
Subcontract Sub-contract Numeric 0.000000
POCommitChng Committed Numeric 0.000000
Advanced data tab:
#****Begin: Generated Statements***
CellPutN(Labor,'Summary Data_v3',vVersion,vYear,UnitCd,vDate,'Labor');
CellPutN(Material,'Summary Data_v3',vVersion,vYear,UnitCd,vDate,'Material');
CellPutN(Subcontract,'Summary Data_v3',vVersion,vYear,UnitCd,vDate,'Sub-contract');
CellPutN(POCommitChng,'Summary Data_v3',vVersion,vYear,UnitCd,vDate,'Committed');
#****End: Generated Statements****