Copy data from one element to all other elements with TI

Post Reply
karthik.g
Posts: 21
Joined: Sat Apr 26, 2014 12:09 pm
OLAP Product: TM1
Version: 10.1
Excel Version: 2010

Copy data from one element to all other elements with TI

Post by karthik.g »

Hi Experts,

Could anyone please let me know the solution to copy the data from one element to all the elements in the same cube using TI process?

(my req is i have data for one combination in Jan month and i need to copy the same data to rest of the months from feb to dec.) the TI process should do the same process for all the elements in all the dimensions.

Thanks in Advance!!
Karths
BariAbdul
Regular Participant
Posts: 424
Joined: Sat Mar 10, 2012 1:03 pm
OLAP Product: IBM TM1, Planning Analytics, P
Version: PAW 2.0.8
Excel Version: 2019

Re: Copy data from one element to all other elements with TI

Post by BariAbdul »

"You Never Fail Until You Stop Trying......"
karthik.g
Posts: 21
Joined: Sat Apr 26, 2014 12:09 pm
OLAP Product: TM1
Version: 10.1
Excel Version: 2010

Re: Copy data from one element to all other elements with TI

Post by karthik.g »

BariAbdul wrote:This might help:
http://www.tm1forum.com/viewtopic.php?f ... her#p35230 Thanks
Hi Abdul,

I'm getting Variable undefined and syntax errors while saving the code. just FYI i have a space in my measure dimension name and all my dimensions names are starting with numbers, the procedure i followed is taken the source view and string as variable type and other for contents tab. i didn't map the variables to my dimensions and i directly written the below code in data tab.

IF(CELLISUPDATEABLE(vCubeName,5Versions,2Divisions,3Employees,2Projects,2CostCenters,4Periods36,mEmployee Info)=1);
IF(VALUE_IS_STRING=0);
CELLPUTN(NValue,vCubeName,5Versions,2Divisions,3Employees,2Projects,2CostCenters,4Periods36,mEmployee Info);
ELSE;
CELLPUTS(SValue,vCubeName,5Versions,2Divisions,3Employees,2Projects,2CostCenters,4Periods36,mEmployee Info);
ENDIF;
ENDIF;


Could any one please advise?

Thanks,
Karthik
Wim Gielis
MVP
Posts: 3241
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.1.5
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: Copy data from one element to all other elements with TI

Post by Wim Gielis »

Give your variables good names, without spaces and do not use reserved functions/words.
Then you can use the variables in the Data tab without any issue.
Best regards,

Wim Gielis

IBM Champion 2024-2025
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
karthik.g
Posts: 21
Joined: Sat Apr 26, 2014 12:09 pm
OLAP Product: TM1
Version: 10.1
Excel Version: 2010

Re: Copy data from one element to all other elements with TI

Post by karthik.g »

Wim Gielis wrote:Give your variables good names, without spaces and do not use reserved functions/words.
Then you can use the variables in the Data tab without any issue.
Hi Wim,

Thanks for the advise. i have renamed the variables and changed the data code accordingly. Now the process is executing without any errors but data is not getting copied. I would like to highlight on preview tab. When i select my source view i could see the periods dimension is showing consolidated element CY Total instead of Jan-2014 which contains data and memployee info which is my measure dimensionis showing first element inside it rather showing the data and finally Value column is displaying empty :(

Data tab code:

IF(CELLISUPDATEABLE(vCubeName,vVersions,vDivisions,vEmployees,vProjects,vCostCenters,vPeriods,vmEmployeeinfo)=1);
IF(VALUE_IS_STRING=0);
CELLPUTN(NValue,vCubeName,vVersions,vDivisions,vEmployees,vProjects,vCostCenters,vPeriods,vmEmployeeinfo);
ELSE;
CELLPUTS(SValue,vCubeName,vVersions,vDivisions,vEmployees,vProjects,vCostCenters,vPeriods,vmEmployeeinfo);
ENDIF;
ENDIF;

Thanks,
Karthik
Wim Gielis
MVP
Posts: 3241
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.1.5
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: Copy data from one element to all other elements with TI

Post by Wim Gielis »

Do you script the creation of the view in the Prolog tab (coding), or do you select the view from the cube (the view physically exists)?
Make sure your data source contains the correct data, i.e. all lowest-level data (most probably).
Best regards,

Wim Gielis

IBM Champion 2024-2025
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
karthik.g
Posts: 21
Joined: Sat Apr 26, 2014 12:09 pm
OLAP Product: TM1
Version: 10.1
Excel Version: 2010

Re: Copy data from one element to all other elements with TI

Post by karthik.g »

Wim Gielis wrote:Do you script the creation of the view in the Prolog tab (coding), or do you select the view from the cube (the view physically exists)?
Make sure your data source contains the correct data, i.e. all lowest-level data (most probably).
Thanks Wim. It worked now.
Wim Gielis
MVP
Posts: 3241
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.1.5
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: Copy data from one element to all other elements with TI

Post by Wim Gielis »

karthik.g wrote:
Wim Gielis wrote:Do you script the creation of the view in the Prolog tab (coding), or do you select the view from the cube (the view physically exists)?
Make sure your data source contains the correct data, i.e. all lowest-level data (most probably).
Thanks Wim. It worked now.
What was the issue / what did you change to make it work?
Best regards,

Wim Gielis

IBM Champion 2024-2025
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
karthik.g
Posts: 21
Joined: Sat Apr 26, 2014 12:09 pm
OLAP Product: TM1
Version: 10.1
Excel Version: 2010

Re: Copy data from one element to all other elements with TI

Post by karthik.g »

Wim Gielis wrote:
karthik.g wrote:
Wim Gielis wrote:Do you script the creation of the view in the Prolog tab (coding), or do you select the view from the cube (the view physically exists)?
Make sure your data source contains the correct data, i.e. all lowest-level data (most probably).
Thanks Wim. It worked now.
What was the issue / what did you change to make it work?
Hi,

Requirement is, there is data for one month and I need to copy the same data to remaining months. So, here is the approach I followed.

1) created a view contains the data with all the leaf level elements and taken the view as source.

2) updated all the variable as strings types and in the contents selected as others but for the Value variable defined as data.

3) In the advanced, Prolog tab : vCubeName= mycubename;

4) Below is the code in Data tab:

#vMonth is my subset contains only months for 2014 year.

i=2;

While(i <= 13);

vMonth=SUBSETGETELEMENTNAME('4periods36','periodsubset',i);

IF(CELLISUPDATEABLE(vCubeName,V1,V2,V3,V4,V5,vMonth,V7)=1);
IF(VALUE_IS_STRING=0);
CELLPUTN(NValue,vCubeName,V1,V2,V3,V4,V5,vMonth,V7);
ELSE;
CELLPUTS(SValue,vCubeName,V1,V2,V3,V4,V5,vMonth,V7);
ENDIF;
ENDIF;

i=i+1;

end;

After executing this data from one month is copying to all the months in the 2014 year.

Wim, if you think if I can do the same in a better way, it would be more helpful for me.

Thanks,
Karthik
Wim Gielis
MVP
Posts: 3241
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.1.5
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: Copy data from one element to all other elements with TI

Post by Wim Gielis »

4periods36 is a strange name for a dimension. And why don't you choose good variable names instead of V1, V2, V3, ...

For the rest, the process is okay although I would avoid the TI wizard (with the variable marked as Other).

Please use

Code: Select all

 tags when you paste code over here. Thanks.
Best regards,

Wim Gielis

IBM Champion 2024-2025
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
karthik.g
Posts: 21
Joined: Sat Apr 26, 2014 12:09 pm
OLAP Product: TM1
Version: 10.1
Excel Version: 2010

Re: Copy data from one element to all other elements with TI

Post by karthik.g »

Wim Gielis wrote:4periods36 is a strange name for a dimension. And why don't you choose good variable names instead of V1, V2, V3, ...

For the rest, the process is okay although I would avoid the TI wizard (with the variable marked as Other).

Please use

Code: Select all

 tags when you paste code over here. Thanks.[/quote]

Ok. Actually periods dimension is for 3 years and 4 is for naming convention. that's why named so.
I think I need to change my TI code again. 

Wim, Do you have any idea like how to implement the same functionality that the data should copy to one month in an year and there after, it should copy the data from current month to rest all months except previous months.(It should not copy data to previous months)
Wim Gielis
MVP
Posts: 3241
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.1.5
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: Copy data from one element to all other elements with TI

Post by Wim Gielis »

karthik.g wrote:Wim, Do you have any idea like how to implement the same functionality that the data should copy to one month in an year and there after, it should copy the data from current month to rest all months except previous months.(It should not copy data to previous months)

That's what your process does, isn't it?
Best regards,

Wim Gielis

IBM Champion 2024-2025
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
declanr
MVP
Posts: 1831
Joined: Mon Dec 05, 2011 11:51 am
OLAP Product: Cognos TM1
Version: PA2.0 and most of the old ones
Excel Version: All of em
Location: Manchester, United Kingdom
Contact:

Re: Copy data from one element to all other elements with TI

Post by declanr »

Wim Gielis wrote:
karthik.g wrote:Wim, Do you have any idea like how to implement the same functionality that the data should copy to one month in an year and there after, it should copy the data from current month to rest all months except previous months.(It should not copy data to previous months)
That's what your process does, isn't it?
I think the op means it currently copies for the rest of the current year but not future years.

If that is the case you can just loop from current month using a "next month" attribute until the "next month" attribute is blank.
Declan Rodger
karthik.g
Posts: 21
Joined: Sat Apr 26, 2014 12:09 pm
OLAP Product: TM1
Version: 10.1
Excel Version: 2010

Re: Copy data from one element to all other elements with TI

Post by karthik.g »

Wim Gielis wrote:
That's what your process does, isn't it?
No Wim. I loaded the values to Jan and copying the values till dec for current year. If i increase the value in While(i <= 39) loop in above code then the values are copying to the rest of the years but i found that string values are copying to consolidated elements. which ideally it should not.
Wim Gielis
MVP
Posts: 3241
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.1.5
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: Copy data from one element to all other elements with TI

Post by Wim Gielis »

karthik.g wrote:
Wim Gielis wrote:
That's what your process does, isn't it?
No Wim. I loaded the values to Jan and copying the values till dec for current year. If i increase the value in While(i <= 39) loop in above code then the values are copying to the rest of the years but i found that string values are copying to consolidated elements. which ideally it should not.
Do you happen to know the DTYPE function? It can test for, for example, S type elements and C type elements.
Best regards,

Wim Gielis

IBM Champion 2024-2025
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
Post Reply