Attribute create thru TI is only working on last element
Posted: Tue Sep 18, 2012 4:02 pm
Dear all,
I am currently working wwith version 10.1.
I'm trying to create a dimension thru a TI, and based on a csv file (list of store, represented with an ID, with a hierarchy by region and by country - attribut should be concatenation of the store ID and the store name).
Everything is perfectly working, except the attribute. After running the TI, the dimension shows all the hierarchy, well organized as required...but when I show attribut, the ID of the store has been stored as attribut in place of the store name, as requested, except for the last element of my csv file.
To ensure that there is no "hidden" issue with my csv file, I have created another TI built with the Map tab of the TI, and there it works (except that I need an attribute concatenating ID - Name). I have thus compared the Advance tabs ot the TI I've wrote with the TI built with the Map tab...and I do not see any differences.
Here is the code I've wrote:
Thank you for your help
I am currently working wwith version 10.1.
I'm trying to create a dimension thru a TI, and based on a csv file (list of store, represented with an ID, with a hierarchy by region and by country - attribut should be concatenation of the store ID and the store name).
Everything is perfectly working, except the attribute. After running the TI, the dimension shows all the hierarchy, well organized as required...but when I show attribut, the ID of the store has been stored as attribut in place of the store name, as requested, except for the last element of my csv file.
To ensure that there is no "hidden" issue with my csv file, I have created another TI built with the Map tab of the TI, and there it works (except that I need an attribute concatenating ID - Name). I have thus compared the Advance tabs ot the TI I've wrote with the TI built with the Map tab...and I do not see any differences.
Here is the code I've wrote:
Code: Select all
PROLOGUE:
DimName = 'Store';
IF (DimensionExists(DimName) = 0);
DimensionCreate(DimName);
ENDIF;
AttrInsert(DimName, '', 'FullName', 'A');
DimensionSortOrder(DimName, 'ByInput', 'Ascending', 'ByHierarchy', 'Ascending');
METADATA:
vElem = vCode;
L1 = Country;
L2 = Region;
vTotal = 'TOTAL STORE';
DimensionElementInsert(DimName, '', vElem,'N');
DimensionElementInsert(DimName, '', L1,'C');
DimensionElementInsert(DimName, '', L1,'C');
DimensionElementInsert(DimName, '', vTotal,'C');
DimensionElementComponentAdd(DimName, vTotal,L1, 1);
DimensionElementComponentAdd(DimName,L1,L2,1);
DimensionElementComponentAdd(DimName, L2,vElem, 1);
DATA:
vAttr = vCode | ' - ' | Store;
AttrPutS(Store, DimName, vElem, 'Full Name');