Page 1 of 1

Transfer data

Posted: Tue Aug 31, 2021 8:07 pm
by Houps
Hello, i need to transfer data in measure from 02->03->04 cubes.
Could someone help me with rule?
Form{Flat are in Measure{ST{CopyDataDetail.
I try do
IF ( !Form{Flat @= DB('ST{02.02.CopyDataDetail',!Orgstructure,!Scenario,!Version,!Rows,'4') );
['Measure{ST{CopyDataDetail':'4']=S:DB('ST{02.02.CopyDataDetail',!Orgstructure,!Scenario,!Version,!Rows,'4');
ENDIF;
but it doesn't work

Re: Transfer data

Posted: Wed Sep 01, 2021 1:24 am
by Adam
Hi Houps,

I saw you registered earlier today, welcome to TM1 Forum!

I’m going to use the code-tag to make your script and mine easier to read.

If I understand right, you're trying to write the following rule:

Code: Select all

IF ( !Form{Flat @= DB('ST{02.02.CopyDataDetail',!Orgstructure,!Scenario,!Version,!Rows,'4') );
['Measure{ST{CopyDataDetail':'4']=S:DB('ST{02.02.CopyDataDetail',!Orgstructure,!Scenario,!Version,!Rows,'4');
ENDIF;
Appreciate what you're trying to do; You inadvertently created a hybrid of a rule and a turbo integrator script. This is evident by mixing of ['area statements'] - a hallmark of rules, and ENDIF; which is part of turbo integrator. TM1 doesn't quite work this way.
  • Rules are applied to cubes.
  • Turbo Integrator scripts are applied to processes.
  • You cannot mix the two.
Try this rule in cube ST{02.03.CopyDataDetail -- newlines and tabs are added for readability.

Code: Select all

['Measure{ST{CopyDataDetail':'4'] = S: IF(
	!Form{Flat @= DB('ST{02.02.CopyDataDetail',!Orgstructure,!Scenario,!Version,!Rows,'4'),
		DB('ST{02.02.CopyDataDetail',!Orgstructure,!Scenario,!Version,!Rows,'4'),
		STET);
The if statement works just like an Excel IF(cond,true,false) statement.

Don't forget, you'll need a feeder in cube ST{02.02.CopyDataDetail:

Code: Select all

SKIPCHECK;

# ... rules go here ...

FEEDERS;

# ... other feeders go here ...

# You need to substitute a value for XXXXX and YYYYY immediately below. You need to tell TM1 which Year{Month and Form{Flat to feed.
['Measure{ST{CopyDataDetail':'4'] => DB('ST{02.03.CopyDataDetail', !Orgstructure, !Scenario, !Version, 'XXXXX', 'YYYYY', !Rows, '4');
Also, in case you'd like more general pointers on TM1 rules, I posted on this not too long ago.

Let us know how you make out.

Re: Transfer data

Posted: Wed Sep 01, 2021 4:21 pm
by Houps
Big thank. It's help.
My code is:

Code: Select all

['Measure{ST{CopyDataDetail':'4'] = S: IF(
	!Form{Flat @= DIMNM('Form{Flat',  DIMIX('Form{Flat', DB('ST{02.02.CopyDataDetail',!Orgstructure,!Scenario,!Version,!Rows,'4'))),
		DB('ST{02.02.CopyDataDetail',!Orgstructure,!Scenario,!Version,!Rows,'4'),
		STET

And feeders:

Code: Select all

['Measure{ST{CopyDataDetail':'5'] => DB('ST{02.03.CopyDataDetailRow', !Orgstructure, !Scenario, !Version, DB('ST{02.02.CopyDataDetail',!Orgstructure,!Scenario,!Version,!Rows,'3'), DB('ST{02.02.CopyDataDetail',!Orgstructure,!Scenario,!Version,!Rows,'4'), !Rows, '5');
it's work
But a have a question. How i can load data from 02.03 to 02.04? "Rows" dimension make me :cry:

Re: Transfer data

Posted: Wed Sep 01, 2021 4:33 pm
by Steve Rowe
Assuming we are talking about numeric data then you would need to have a consolidation of all elements in the rows dimension and then rule or TI the data at that level.

Re: Transfer data

Posted: Wed Sep 01, 2021 4:35 pm
by Houps
I can add consolidate element in the Rows dimension.
Something like this.


How it can help me?

Re: Transfer data

Posted: Wed Sep 01, 2021 4:43 pm
by Steve Rowe
When you reference 02.03 from 02.04 you need to replace !Rows with '0'.

Maybe I am missing something...