COGNOiSe.com - The IBM Cognos Community

Planning & Consolidation => TM1 => Topic started by: e260956 on 19 Apr 2020 08:13:08 AM

Title: TurboIntegrator Process to import same monthly data into each day of month
Post by: e260956 on 19 Apr 2020 08:13:08 AM
Hi
I am having difficulty writing the script to import a monthly budget hourly rate into each day of the month.

The data i have is:
Division,CostCentre,JobType,Month,Value
010,1103,RN,2019-07,72.89
010,1103,RN,2019-08,68.86

I need the 72.89 for July to be posted against each day of july in another cube the 68.86 into each day of august and so on.

I have written the below but no data is being imported?

sTarget_Version = pTargetVersion;
sTarget_Division = vDivision;
sTarget_Cost_Centre = vCostCentre;
sTarget_Division_CostCentre = vDivision_CostCentre;
sTarget_JobType = vJobType;
sTarget_HourType = 'NA';
sTarget_Month = vMonth;
vDayCountMax = ElementComponentCount('gbl.Date',' ', vMonth);
vDayCount = 1;
IF(vDayCount<10);
sTarget_Date=vMonth|'-0'|STR (vDayCount,1,0);
ELSE;
sTarget_Date=vMonth|'-'|STR (vDayCount,2,0);                     
ENDIF; 

While (vDayCount <= vDayCountMax);
CellPutN(Value, sTargetCube, sTarget_Version, sTarget_Division, sTarget_Cost_Centre,  sTarget_Division_CostCentre, sTarget_JobType, sTarget_HourType, sTarget_Date, 'LabourRate');
vDayCount = vDayCount + 1;
END;
Title: Re: TurboIntegrator Process to import same monthly data into each day of month
Post by: OliverS on 23 Apr 2020 06:00:33 AM
What does the log file say if you add this

ASCIIOutput( 'C:\test.txt', vMonth, sTarget_Date, str(vDayCount) );

i think your vMonth or sTarget_Date is wrong.
Title: Re: TurboIntegrator Process to import same monthly data into each day of month
Post by: AJAYC on 04 Jul 2020 03:09:35 AM
In the dimension, in the second cube which contains the days of each month, insert a consolidation called "2019-07" and place each day under it.

Then in your TI when you read the "2019-07" column, you can call out and retrieve each child from the new consolidation node and load the data to each within a WHILE loop

Use the ELCOMPN('Dimension_Name','2019-07') to tell you how many children there are, and this will be the maximum count through the loop

Ajay