Hierarchies Failing in PAW 2.077.1 On Premise
Posted: Wed May 21, 2025 7:23 pm
Hello All -
Context - I am doing a deep dive into Hierarchies. I'm using a test date range in a dimension (9/1/2024 - 9/14/2024) to create two alternative hierarchies. The Parent dimension are the dates in sequential order with a total of all dates at the top. The alternative hierarchies ("Alt Hier") are a Week and ITD hierarchy. I created the basic dimension for the two Alt Hier to test the build code. It worked perfectly. Next I converted the Week dimension TI process to create an alternative hierarchy.
Problem - The empty Hierarchy is created; however, the "week" consolidation elements are not created nor are the attributes added to the dimension.
Research - I searched to confirm that the versions that I am using in fact support Alt Hierarchies. From the posts that I could where version and hierarchies were mentioned, it seems that this is NOT a version issue. However, I may be wrong.
I am using a on Premise PAW 2.0.77.1 and TM1-AW64-ML-RTM-11.0.0.28-0.
I have attached word Below a word document with the code and images of the Output.
Thank you in advance for any guidance.
TI Process 1
DimName = '_zzMasterTime';
HierName = 'Week';
cAttr1 = 'DayNumber';
cAttr2 = 'Week';
IF(DimensionExists(DimName)=1);
DimensionDestroy(DimName);
DimensionCreate(DimName);
ELSE;
DimensionCreate(DimName);
ENDIF;
sHier = HIERARCHYCREATE(DimName,HierName);
AttrInsert(DimName, '', cAttr1, 'N');
AttrInsert(DimName, '', cAttr2, 'S');
cDayStart = '2024-09-01';
cDayEnd = '2024-09-14';
nEle = DAYNO(cDayStart);
WHILE(1 = 1);
sEle = TIMST(nEle, '\Y-\m-\d');
HIERARCHYELEMENTINSERT(DimName,HierName, '', sEle, 'N');
IF(sEle @= cDayEnd);
BREAK;
ELSE;
nEle = nEle + 1;
ENDIF;
END;
##################################################################
TI Process 2
DimName = '_zzMasterTime';
HierName = 'Week';
ElCnt = DimSiz(DimName);
nAttr1 = 'DayNumber';
sAttr1 = 'Week';
sElm = 1;
While(sElm <= ElCnt);
ElNm = ELEMENTNAME(DimName,HierName,sElm);
WkDt = TIMST(DAYNO(ElNm),'\Y-\m-\d');
DayNum = DAYNO(WkDt);
nOut = MOD(DayNum,7);
IF(nOut = 2);
Con = WkDt | '-Wk';
HierarchyElementInsert(DimName,HierName,'',Con,'S');
ENDIF;
sDim = EXPAND('%DimName%:%HierName%');
ATTRPUTN(DayNum,sDim,ElNm,nAttr1);
ATTRPUTS(Con,sDim,ElNm,sAttr1);
sElm = sElm +1 ;
END;
Context - I am doing a deep dive into Hierarchies. I'm using a test date range in a dimension (9/1/2024 - 9/14/2024) to create two alternative hierarchies. The Parent dimension are the dates in sequential order with a total of all dates at the top. The alternative hierarchies ("Alt Hier") are a Week and ITD hierarchy. I created the basic dimension for the two Alt Hier to test the build code. It worked perfectly. Next I converted the Week dimension TI process to create an alternative hierarchy.
Problem - The empty Hierarchy is created; however, the "week" consolidation elements are not created nor are the attributes added to the dimension.
Research - I searched to confirm that the versions that I am using in fact support Alt Hierarchies. From the posts that I could where version and hierarchies were mentioned, it seems that this is NOT a version issue. However, I may be wrong.
I am using a on Premise PAW 2.0.77.1 and TM1-AW64-ML-RTM-11.0.0.28-0.
I have attached word Below a word document with the code and images of the Output.
Thank you in advance for any guidance.
TI Process 1
DimName = '_zzMasterTime';
HierName = 'Week';
cAttr1 = 'DayNumber';
cAttr2 = 'Week';
IF(DimensionExists(DimName)=1);
DimensionDestroy(DimName);
DimensionCreate(DimName);
ELSE;
DimensionCreate(DimName);
ENDIF;
sHier = HIERARCHYCREATE(DimName,HierName);
AttrInsert(DimName, '', cAttr1, 'N');
AttrInsert(DimName, '', cAttr2, 'S');
cDayStart = '2024-09-01';
cDayEnd = '2024-09-14';
nEle = DAYNO(cDayStart);
WHILE(1 = 1);
sEle = TIMST(nEle, '\Y-\m-\d');
HIERARCHYELEMENTINSERT(DimName,HierName, '', sEle, 'N');
IF(sEle @= cDayEnd);
BREAK;
ELSE;
nEle = nEle + 1;
ENDIF;
END;
##################################################################
TI Process 2
DimName = '_zzMasterTime';
HierName = 'Week';
ElCnt = DimSiz(DimName);
nAttr1 = 'DayNumber';
sAttr1 = 'Week';
sElm = 1;
While(sElm <= ElCnt);
ElNm = ELEMENTNAME(DimName,HierName,sElm);
WkDt = TIMST(DAYNO(ElNm),'\Y-\m-\d');
DayNum = DAYNO(WkDt);
nOut = MOD(DayNum,7);
IF(nOut = 2);
Con = WkDt | '-Wk';
HierarchyElementInsert(DimName,HierName,'',Con,'S');
ENDIF;
sDim = EXPAND('%DimName%:%HierName%');
ATTRPUTN(DayNum,sDim,ElNm,nAttr1);
ATTRPUTS(Con,sDim,ElNm,sAttr1);
sElm = sElm +1 ;
END;