Technical data
Using Built-in Functio ns in Analytic Models Chapter 11
Description
The OPRID funct
ion returns the userID of the user who currently has the analytic instance checked out.
Use the OPRID function within a filter user function whose purpose is to limit userID access to only certain
rows of data.
Example
IF(AT(USERID, TXT2MBR(USERID, OPERID()), DEPT_CUBE) = MEMBER(DEPT_DIM),RETURN(1),⇒
RETURN(0))
This filter user function restricts user access to bonus amount data. Each userID has access to only the bonus
amount that pertains to them. The filter user function contains these data cubes and dimensions:
• USERID dimension, which is mapped to the USERID field.
TheUSERIDfieldcontainstheuserIDsoftheusersthat currently have the analytic instance loaded.
• DEPT_CUBE data cube, which is mapped to the DEPT_CUBE field.
This data cube is formatted as a member of the DEPT_DIM dimension.
• DEPT_DIM dimension, which is mapped to the DEPT_DIM field.
Note. The filter user function is applied to this dimension.
• BONUS_AMT data cube, which is mapped to the BONUS_AMT field.
These are the values of the fields that are mapped to the USERID dimension and DEPT_CUBE data cube:
USERID DEPT_CUBE
Juan Doc
Albert
Dev
Nigel
PM
These are the values of the fields that are mapped to the DEPT_DIM dimension and BONUS_AMT data cube:
DEPT_DIM BONUS_AMT
Dev
5000
Doc
4000
PM
7000
The analytic calculation engine performs these steps to calculate the filter user function:
1. The OPRID function returns the userID of the current user in text format.
2. The TXT2MBR function compares the userID with the member in the USERID dimension to
determine if they match.
178 Copyright © 1988-2007, Oracl e. All rights reserved.