How to get Parameter value based on contributor node access
Posted: Thu Aug 06, 2015 7:05 pm
Hello all!
I would like to know how one can get parameter value based on user access to a node in the contributor. Purpose: I want to assign action button to a user where they can zero out the data or upload the data based on their access. Please let me know if you think so there could be another best practice. I have provided details below:
================================
#==Parameter
#===============================
pMetro='';
pVersion='Actual';
############################
## Logging Off
############################
OldCubeLogChanges = CUBEGETLOGCHANGES('InputData');
CUBESETLOGCHANGES('Inputdata', 0);
#############################
## Define Variable
#############################
Vcube='InputData';
Vtgt='Extract';
cDim1='3h_MetroHierarchy';
cDim2='3v_Version';
#############################
### View Create
#############################
If(viewexists(Vcube,vtgt)=1);
viewdestroy(vcube,vtgt);
Endif;
Viewcreate(Vcube,Vtgt);
#############################################
### Subset Create
#############################################
IF(SubsetExists(cDim1, sSub)=1);
SubsetDestroy(cDim1, sSub);
ENDIF;
Subsetcreate (cDim1, sSub);
SubsetElementInsert (cDim1 , sSub,pMetro, 1);
#############################################
### Subset Create
#############################################
IF(SubsetExists(cDim2, sSub)=1);
SubsetDestroy(cDim2, sSub);
ENDIF;
Subsetcreate (cDim2, sSub);
SubsetElementInsert (cDim2 , sSub,pVersion, 1);
#################################################################################
#### Assigning Subset to view
#################################################################################
Viewsubsetassign(VCube,Vtgt,cDim1,sSub);
Viewsubsetassign(VCube,Vtgt,cDim2,sSub);
ViewZeroOut(vCube,vTgt);
#======================================================================================================
# I want to achieve following results
#======================================================================================================
#pMetro='Should get value from node access';
Suppose
vElement='Value from node access' (? How to bring the node value based on user access to it)
IF (ELLEV(cDim1,vElement)=0);
v10= ELPAR (cDim1,vElement,1);
ELSEIF (ELLEV(cDim1,vElement)=1);
V10 = vElement;
Endif;
vMetro=v10
pMetro =vMetro;
Suppose, my approval hierarchy consists of
Total (Level 2)
=> NY (Level 1)
*NY1 (Level 0)
*NY2 (Level 0)
*NY3 (Level 0)
=> NJ (Level 1)
*NJ1 (Level 0)
*NJ2 (Level 0)
*NJ3 (Level 0)
IF any user select node NJ2 in the contributor than my pMetro should get value 'NJ' (the parent element value)
IF any user select node NJ in the contributor than my pMetro should get value 'NJ'
Is it possible? IF so, how could we achieve it? Is there any alternative way?
Purpose: Suppose, i assigned this process to user through action button.
Now when i write same process for zero-out than it would throw an error as user does not have access to all metro.
#================================================================================================================
Please feel free if further information required.
Thank You
Dharav Patel
I would like to know how one can get parameter value based on user access to a node in the contributor. Purpose: I want to assign action button to a user where they can zero out the data or upload the data based on their access. Please let me know if you think so there could be another best practice. I have provided details below:
================================
#==Parameter
#===============================
pMetro='';
pVersion='Actual';
############################
## Logging Off
############################
OldCubeLogChanges = CUBEGETLOGCHANGES('InputData');
CUBESETLOGCHANGES('Inputdata', 0);
#############################
## Define Variable
#############################
Vcube='InputData';
Vtgt='Extract';
cDim1='3h_MetroHierarchy';
cDim2='3v_Version';
#############################
### View Create
#############################
If(viewexists(Vcube,vtgt)=1);
viewdestroy(vcube,vtgt);
Endif;
Viewcreate(Vcube,Vtgt);
#############################################
### Subset Create
#############################################
IF(SubsetExists(cDim1, sSub)=1);
SubsetDestroy(cDim1, sSub);
ENDIF;
Subsetcreate (cDim1, sSub);
SubsetElementInsert (cDim1 , sSub,pMetro, 1);
#############################################
### Subset Create
#############################################
IF(SubsetExists(cDim2, sSub)=1);
SubsetDestroy(cDim2, sSub);
ENDIF;
Subsetcreate (cDim2, sSub);
SubsetElementInsert (cDim2 , sSub,pVersion, 1);
#################################################################################
#### Assigning Subset to view
#################################################################################
Viewsubsetassign(VCube,Vtgt,cDim1,sSub);
Viewsubsetassign(VCube,Vtgt,cDim2,sSub);
ViewZeroOut(vCube,vTgt);
#======================================================================================================
# I want to achieve following results
#======================================================================================================
#pMetro='Should get value from node access';
Suppose
vElement='Value from node access' (? How to bring the node value based on user access to it)
IF (ELLEV(cDim1,vElement)=0);
v10= ELPAR (cDim1,vElement,1);
ELSEIF (ELLEV(cDim1,vElement)=1);
V10 = vElement;
Endif;
vMetro=v10
pMetro =vMetro;
Suppose, my approval hierarchy consists of
Total (Level 2)
=> NY (Level 1)
*NY1 (Level 0)
*NY2 (Level 0)
*NY3 (Level 0)
=> NJ (Level 1)
*NJ1 (Level 0)
*NJ2 (Level 0)
*NJ3 (Level 0)
IF any user select node NJ2 in the contributor than my pMetro should get value 'NJ' (the parent element value)
IF any user select node NJ in the contributor than my pMetro should get value 'NJ'
Is it possible? IF so, how could we achieve it? Is there any alternative way?
Purpose: Suppose, i assigned this process to user through action button.
Now when i write same process for zero-out than it would throw an error as user does not have access to all metro.
#================================================================================================================
Please feel free if further information required.
Thank You
Dharav Patel