Using parameter to specify CellPutN/S
Posted: Mon Feb 15, 2021 10:35 pm
Hi Everyone,
I am attempting to load data from CSV file into the cube Sales in the following way:
-cube has 3 dimensions: Version (1-12), Months (1-12) and metric dimension Sales (Total_Sales, A_Sales, B_Sales, Comment)
-the goal is to load the data only into the version specified by the parameter and corresponding month. January (1) corresponds to Version 1, Ferbuary to version 2 and so on.
Here is what I attempted:
insert attributes into Version dimension (viz img): Then in a process with CSV file as datasource I would specify the appropriate month with CellGetN command, which I would afterwards use in CellPutN/S commands. The problem is, taht no matter what parameter I use, I always insert data corresponding to the December. I have no idea why.
Variables: Prolog:
Data:
Wrong Result after spicifying the parameter pVersion to be 9:
I know I dont have defined Source and Target Views which is a mistake, but in this case i presume it should not be the cause of the problem. I would appreciate any help or pointers to what might be wrong.
I am attempting to load data from CSV file into the cube Sales in the following way:
-cube has 3 dimensions: Version (1-12), Months (1-12) and metric dimension Sales (Total_Sales, A_Sales, B_Sales, Comment)
-the goal is to load the data only into the version specified by the parameter and corresponding month. January (1) corresponds to Version 1, Ferbuary to version 2 and so on.
Here is what I attempted:
insert attributes into Version dimension (viz img): Then in a process with CSV file as datasource I would specify the appropriate month with CellGetN command, which I would afterwards use in CellPutN/S commands. The problem is, taht no matter what parameter I use, I always insert data corresponding to the December. I have no idea why.
Variables: Prolog:
Code: Select all
sSourceCube = '}ElementAttributes_V_Version2';
sTargetCube = 'Sales';
sElA_Sales = 'A_Sales';
aElB_Sales = 'B_Sales';
aElComment = 'Comment';
aMonth = 'aMonth';
Code: Select all
nElVersion = NumberToString(CellGetN(sSourceCube, pVersion, aMonth));
CellPutN(vnA_Sales, sTargetCube, pVersion, nElVersion, sElA_Sales);
CellPutN(vnB_Sales, sTargetCube, pVersion, nElVersion, aElB_Sales);
CellPutS(vsComment, sTargetCube, pVersion, nElVersion, aElComment);