copying children from 1 parent to another
Posted: Thu Oct 15, 2009 10:44 am
Hi guys,
I am trying to write a process to copy children from 1 parent to another.
I am using a subset of the n level elements as a a start and parameters for the from and to parents.
I have 2 attributes project no and task no. My dimension looks like:
All projects project no task no
1 1
1.1 1 1
1.2 1 2
1.3 1 3
2
2.1 2 1
2.2 2 2
3
4
5
So I would like to copy the children of 1 to 5 and end up with
All projects
1
1.1
1.2
1.3
2
2.1
2.2
3
4
5
5.1
5.2
5.3
My current code looks as such:
DimName='Project_Tasks';
Project=ATTRS(DimName,Project_Tasks,'Project');
TaskNo=ATTRS(DimName,Project_Tasks,'Task No');
IF (ATTRS(DimName,Project_Tasks,'Project') @= CopyFrom);
DimensionElementInsert(Project_Tasks,'',CopyTo|'.'|TaskNo,'N');
ELSE;
Itemskip;
ENDIF;
Any suggestions?
Thanks
Steve
I am trying to write a process to copy children from 1 parent to another.
I am using a subset of the n level elements as a a start and parameters for the from and to parents.
I have 2 attributes project no and task no. My dimension looks like:
All projects project no task no
1 1
1.1 1 1
1.2 1 2
1.3 1 3
2
2.1 2 1
2.2 2 2
3
4
5
So I would like to copy the children of 1 to 5 and end up with
All projects
1
1.1
1.2
1.3
2
2.1
2.2
3
4
5
5.1
5.2
5.3
My current code looks as such:
DimName='Project_Tasks';
Project=ATTRS(DimName,Project_Tasks,'Project');
TaskNo=ATTRS(DimName,Project_Tasks,'Task No');
IF (ATTRS(DimName,Project_Tasks,'Project') @= CopyFrom);
DimensionElementInsert(Project_Tasks,'',CopyTo|'.'|TaskNo,'N');
ELSE;
Itemskip;
ENDIF;
Any suggestions?
Thanks
Steve