If you are unable to create a new account, please email support@bspsoftware.com

Author Topic: TurboIntegrator Process to import same monthly data into each day of month  (Read 3443 times)

Offline e260956

  • Associate
  • **
  • Join Date: Apr 2020
  • Posts: 1
  • Forum Citizenship: +0/-0
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:

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;
sTarget_Date=vMonth|'-0'|STR (vDayCount,1,0);
sTarget_Date=vMonth|'-'|STR (vDayCount,2,0);                     

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;

Offline OliverS

  • Full Member
  • ***
  • Join Date: Oct 2019
  • Posts: 11
  • Forum Citizenship: +0/-0
What does the log file say if you add this

Code: [Select]
ASCIIOutput( 'C:\test.txt', vMonth, sTarget_Date, str(vDayCount) );
i think your vMonth or sTarget_Date is wrong.

Offline AJAYC

  • Senior Member
  • ****
  • Join Date: Apr 2012
  • Posts: 66
  • Forum Citizenship: +2/-0
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