Loading MTD data as YTD data
Posted: Wed Apr 17, 2019 1:52 pm
Hi,
I'm newbie in developing TM1. I have such issue - in ODBC Source (SAP) I have transactional data from General Ledger with some dimensions (Line of Business, Distribution Channel...).
I would like to load aggregated data (not transactional) into TM1 cube but into dimension 'Interval' = YTD
I wrote sql in query field to gather only data which I wanted:
SELECT
[GJAHR] as Rok
,[MONAT] as Miesiac
,[LDGRP] as Ledger
,[HKONT] as Account
,[ZZPRODUCT] as Product
,[ZZDISTCHAN] as Distchan
,sum([DMBTR]) as Amount
FROM [SAP_Eksport].[dbo].[VE_Z_XTRACT_DOCUMENTS]
where [LDGRP] not in ('S2')
group by
[GJAHR]
,[MONAT]
,[LDGRP]
,[HKONT]
,[ZZPRODUCT]
,[ZZDISTCHAN];
Then I specified:
Variables on Variables tab
CubeName, ZeroOutPortion, Dimensions on Maps tab
In Advanced tab I specified:
Parameters for
Year - P_Year
Month- P_Month
In Prolog I prepared views:
And the problem is that all data are in every Month <= P_Miesiac.
My intension was to store aggregated YTD data in Month=P_Miesiac and then to create rules calculating MTD data.
Where is problem? Pls help.
If you want more details/prt screens, pls tell me.
I'm newbie in developing TM1. I have such issue - in ODBC Source (SAP) I have transactional data from General Ledger with some dimensions (Line of Business, Distribution Channel...).
I would like to load aggregated data (not transactional) into TM1 cube but into dimension 'Interval' = YTD
I wrote sql in query field to gather only data which I wanted:
SELECT
[GJAHR] as Rok
,[MONAT] as Miesiac
,[LDGRP] as Ledger
,[HKONT] as Account
,[ZZPRODUCT] as Product
,[ZZDISTCHAN] as Distchan
,sum([DMBTR]) as Amount
FROM [SAP_Eksport].[dbo].[VE_Z_XTRACT_DOCUMENTS]
where [LDGRP] not in ('S2')
group by
[GJAHR]
,[MONAT]
,[LDGRP]
,[HKONT]
,[ZZPRODUCT]
,[ZZDISTCHAN];
Then I specified:
Variables on Variables tab
CubeName, ZeroOutPortion, Dimensions on Maps tab
In Advanced tab I specified:
Parameters for
Year - P_Year
Month- P_Month
In Prolog I prepared views:
P_Miesiac = DimensionElementPrincipalName( 'B.MIESIAC', P_Month );
SubsetDeleteAllElements('B.SCENARIUSZ', 'TechParametr');
SubsetDeleteAllElements('B.MIESIAC', 'TechParametr');
SubsetElementInsert('B.SCENARIUSZ', 'TechParametr', P_Year | ' Actual', 1);
SubsetElementInsert('B.MIESIAC', 'TechParametr', P_Month, 1);
#****Begin: Generated Statements***
OldCubeLogChanges = CUBEGETLOGCHANGES('A.SAP');
CUBESETLOGCHANGES('A.SAP', 0);
VIEWZEROOUT('A.SAP','ZERO_Dane_SAP');
#****End: Generated Statements****
DatasourceQuery= 'SELECT
[GJAHR] as Rok
,[MONAT] as Miesiac
,[LDGRP] as Ledger
,[HKONT] as Account
,[ZZPRODUCT] as Product
,[ZZDISTCHAN] as Distchan
,[ZZSOURCE] as Source
,[ZZACTIVITY] as Activity
,[ZZREINSCON] as REINSCON
,[ZZIP] as IP
,sum([DMBTR]) as Amount
FROM [SAP_Eksport].[dbo].[VE_Z_XTRACT_DOCUMENTS]
where [LDGRP] not in (S2)
and Rok = ' | P_Year | '
and Miesiac <= ' | P_Miesiac | '
group by
[GJAHR]
,[MONAT]
,[LDGRP]
,[HKONT]
,[ZZPRODUCT]
,[ZZDISTCHAN]';
And the problem is that all data are in every Month <= P_Miesiac.
My intension was to store aggregated YTD data in Month=P_Miesiac and then to create rules calculating MTD data.
Where is problem? Pls help.
If you want more details/prt screens, pls tell me.