2 Replies Latest reply on Sep 15, 2016 5:06 PM by BenS

    Initialization Session Variable from User Roles OBIEE 12C


      I have a situation where I want to initialize a session variable based upon the Role a user has assigned. 


      (1) I have user setup with many Role but specifically the "Eport Analytics" role in OBIEE 12C

      (2) The user logs into Answers

      (3) Writes a query (below) that searches for a specific User Role ("Eport Analytics") within the list of ROLES the user has assigned.



      LOCATE('Eport Analytics', VALUEOF(NQ_SESSION.ROLES))

      FROM "Security Analytics"


      (4) The query returns a value of 46 (indicating the string value has been found within the Roles (if the string value was not found then a 0 would have been returned)

      (5) In Variable Manager I define a Session Variable (EPORT_ACCESS) with a default value of 0.

      (6) I create an initialization block called "Eport Access" to fill the session variable (EPORT_ACCESS)

      (7) I pasted the query (from above) in the Edit Data Source and set the Data Source Type = Database and the Use OBIEE EE Server toggle selected.


      Note:  When I select the"Execution Precedence" the Add button does not work (all buttons are disabled).


      (8) I log on as the User, select the value of the session variable (EPORT_ACCESS) and I get the default value of 0.  I test the values of the ROLES variable and I see the defined role (which returns a 46). 


      Any suggestions for how to capture in the session variable if a User has a specific role would be appreciated.  In addition, if you can explain why my EPORT_ACCESS session variable is not returning a 46 would be appreciated.