Page 1 of 1
Consolidation element not found
Posted: Wed Sep 03, 2014 2:29 pm
by Kazêh
Hi guys, a silly question about how to create a dimension with turbo integrator.
i have the follow data in csv file
Total
A Total
B Total
C Total
D Total
X
Y
Z
when you create the dimension with TI, you select the first colum as element and the second as consolidation, but it trhows you a warning that X, Y and Z can't find a consolidation element.
the dimension is created as i want, but i want the turbo integrator to execute perfectly, is there anyway to do it? without adding an Aux element that consolidate x,y,z? and of course , not adding elements manually
Thanks
Re: Consolidation element not found
Posted: Wed Sep 03, 2014 3:02 pm
by jim wood
Take the script generated, copy and paste somewhere else within the same tab, set all variables to other and then add an if statement to the part that creates the consolidation relationship to do a check for a consolidated element. Short I know but it's the way to do it.
Re: Consolidation element not found
Posted: Wed Sep 03, 2014 3:36 pm
by Kazêh
Jim, thanks for the reply.
here i have the codes generated
Code: Select all
Prolog
DIMENSIONDELETEALLELEMENTS('Ramo test prueba');
DIMENSIONSORTORDER('Ramo test prueba','BYINPUT','ASCENDING','BYINPUT','ASCENDING');
Code: Select all
DIMENSIONELEMENTINSERT('Ramo test prueba','',Ramo,'n');
DIMENSIONELEMENTINSERT('Ramo test prueba','',Padre,'c');
DIMENSIONELEMENTCOMPONENTADD('Ramo test prueba',Padre,Ramo,1.000000);
that's the code generate for the TI..and the validiation should be something like this?
Code: Select all
Metadata
dimname='Ramo Test prueba';
count=DIMSIZ(dinname);
x=count;
WHILE( x >= 1 );
element= DIMNM(dinname,x);
IF(DTYPE(dimname,element)@='C');
(whatshouldiputhere..)
ENDIF;
x = x - 1;
END;
i saw that code for eliminate the C elements from a dimension, i thogh this migh be something similar..but i dont know what should i put after the dtype.
if is it posible, can you show me the standard code for doind this kind of thing? it doesnt have to apply to my example, i just i dont normaly create scripts in TI.
Thanks for any tips.
Re: Consolidation element not found
Posted: Wed Sep 03, 2014 4:11 pm
by BariAbdul
Are you trying to create dimension or unwinding existing dimension hierarchy,Because the code you provide break parent child relationship.Thanks
Re: Consolidation element not found
Posted: Wed Sep 03, 2014 4:28 pm
by Kazêh
Creating dimension, as i said, i saw that code and i tho it migh help me to create the dimension without the warnings.
Re: Consolidation element not found
Posted: Wed Sep 03, 2014 4:40 pm
by jim wood
This is more what I was eluding to earlier (regardless of whether you recreating or not)
Code: Select all
DIMENSIONELEMENTINSERT('Ramo test prueba','',Ramo,'n');
IF(Padre@<>'');
DIMENSIONELEMENTINSERT('Ramo test prueba','',Padre,'c');
DIMENSIONELEMENTCOMPONENTADD('Ramo test prueba',Padre,Ramo,1.000000);
EndIF;
Re: Consolidation element not found
Posted: Wed Sep 03, 2014 5:17 pm
by Kazêh
thank you Jim, sorry to trouble you
Re: Consolidation element not found
Posted: Wed Sep 03, 2014 5:36 pm
by tomok
Your problem is due to shortcomings in the TI Wizard. When you have a two-column source, like the one you showed, the wizard will add the element in column A and then make it a parent of the element in column B. If the element in column B does not exist then you will get an error. Since the element "Total" is never in column A, it never get's created and trying to add a child to a non-existent element results in an error. Simple fix is to add this code to the Prolog tab:
Code: Select all
DimensionElementAdd('Ramo Test prueba','Total',1);
Re: Consolidation element not found
Posted: Wed Sep 03, 2014 6:40 pm
by jim wood
tomok wrote:Your problem is due to shortcomings in the TI Wizard. When you have a two-column source, like the one you showed, the wizard will add the element in column A and then make it a parent of the element in column B. If the element in column B does not exist then you will get an error.
Since the element "Total" is never in column A, it never get's created and trying to add a child to a non-existent element results in an error. Simple fix is to add this code to the Prolog tab:
Code: Select all
DimensionElementAdd('Ramo Test prueba','Total',1);
Tomok I think you'll find that Total is in column A in his quick example. It's the first line. Hence there was no need to go down this route. That's why I suggested keeping it simple.
Just to clarify:
Kazêh wrote:
Total
A Total
B Total
C Total
D Total
X
Y
Z
Re: Consolidation element not found
Posted: Wed Sep 03, 2014 6:44 pm
by jim wood
Kazêh wrote:thank you Jim, sorry to trouble you
No bother at all. I hope it works for you,
Jim.