Session variable using :GROUP variable in init block

I'd like to filter using session variable.
This session variaible should be build using :GROUP special session variable
I'd like do something like this (init block):
select  case when instr(upper(':GROUP'), 'ADMINISTRATOR')>0 then 'Yes' else 'No' end from dual
but it seems to doesn't work properly (It means I have always 'No' value)
After investigation i did some simple test
initialization block like this:
select  upper(':USER'),upper(':GROUP') from dual
set variables using above init block: UPP_USER and UPP_GROUP
next i did simple reques with 4 columns:
*1. VALUEOF(NQ_SESSION.USER)*
*2. VALUEOF(NQ_SESSION.GROUP)*
*3. VALUEOF(NQ_SESSION.UPP_USER)*
*4. VALUEOF(NQ_SESSION.UPP_GROUP)*
and my result is:
1. Administrator
2. Administrators;IT_Deparment ....
3. ADMINISTRATOR
4. _:GROUP_
Why in 4th column I didn't get: ADMINISTRATOR;IT_DEPARTMENTS ....
Can I use special variable GROUP in initialization block?
Could someone explain it?

Hi,
Only :USER and :PASSWORD are available
try (select 'VALUEOF(NQ_SESSION.USER)', 'VALUEOF(NQ_SESSION.GROUP)' from dual instead.
(You migth have to force a fill of the group variable first)
Regards
John
http://obiee101.blogspot.com/

Similar Messages

  • OBIEE 11g, BI Apps EBS: What are default security variables and Init Block

    Hi,
    We are implementing BI Apps 7.9.6.3 [OBIEE 11.1.1.1.5 with EBS modules]. Out of the box RPD and mappings.
    There are many VARIABLES and INIT BLOCKS in the RPD. Some of them are mainly for Siebel, Jd Edwards etc.
    I need to know what are the default variables and Init Block configures in RPD. Also it will be highly appreciated if anyone can point out what segments we should configure if we need to implement security with simple database table authentication with SSO?
    Thanks in advance.

    You should review this doc for the options for EBS/OBIA security:
    http://docs.oracle.com/cd/E20490_01/bia.7963/e19042.pdf
    If helpful, pls mark as correct or helpful.

  • 11.1.1.6.11  /  Essbase Substitution Variables / RPD Init Block / Dynamic Variables

    11.1.1.6.11  /  Essbase Substitution Variables / RPD Init Block / Dynamic Variables
    How do I update the Init Block which is populated with the Essbase Substitution variables.   This is dynamically created the first time I import an Essbase cube and is populated with the Substitution variables when it is first imported into the RPD.   If later on new Substitution variables are added, they are not being reflected in the Init Block or its dynamic variables.  I have done the re-import of the data source with no change to the Init Block Dynamic Variables.   How do I get these new Substitution variables imported?
    It appears that the only way is to delete it from the Physical Layer, however this deletes any changes I have made to Cube in the physical layer.

    So delete it from the Physical Layer, change the Substitution Variables associated with the cube.   Import it back into the physical layer.   It does NOT delete existing Init Block Dynamic variables that no longer exist as Substitution variables.  

  • Using session variable in init. string of session variable init. block

    hi, experts,
    is it allowed to use a loaded session variable (A) in the initialization string in the initialization block of another session variable (B).
    for example,
    in the execution precedence of initialization block of B, added the initialization block of A
    then in the initialization string in the initialization block of B,
    the sql likes:
    select yyy from a where a.xxx = 'valueof(nq_session.A)'
    what is the correct syntax?
    thank you very mucH!

    That's the correct format. If it is not working for you then you need to give more information as what's happening, how you populate your Init Blocks etc.

  • How to use session variables in initialization blocks

    Hello,
    I want to use a session variable in a initialization block. Here is what I was doing to see this working
    I created a init block called name_parameter and associated with a variable target named name_parameter_v. The init string for this block is "select 'Hello' from dual".
    i created another init block name_parameter2 and associated with a variable target named name_parameter2_v. The init string is "select :name_parameter_v from dual".
    I have selected name_parameter in the edit execution precedence for name_parameter2.
    The result set is empty. Could you please explain why I am not able to see Hello when i test name_parameter2.
    Thanks.

    to obtain the value contained in a session variable this is the syntax.
    select 'VALUEOF(NQ_SESSION.VARIABLE_NAME)' from dual
    mind the single quotes, they are necessary

  • Session variable and initialization block issues

    We are using OBIEE 10.1.3.3 and utilizes built in security features. (No LDAP or other single sign on). The user or group names are not stored in any external table. I have a need to supplement Group info of the user to the usage tracking we implemented recently as the NQ_LOGIN_GROUP.RESP column contains username instead of group name. So I created a session variable and associated with a new initialization block and also had a junk default value set to the variable. In the initialization block, I wrote the following query and as a result it inserted correct values into the table when the TEST button was clicked from the initialization block form.
    insert into stra_login_data (username, groupname, login_time) values ('VALUEOF(NQ_SESSION.USER)', 'VALUEOF(NQ_SESSION.GROUP)', SYSDATE)
    My intention is to make this execute whenever any user logs on. The nqserver.log reports the following error and it doesn?t insert values into the table.
    [nQSError: 13011] Query for Initialization Block 'SET_USER_LOGIN_BLOCK' has failed.
    [nQSError: 23006] The session variable, NQ_SESSION.USER, has no value definition.
    [nQSError: 13011] Query for Initialization Block 'SET_USER_LOGIN_BLOCK' has failed.
    [nQSError: 23006] The session variable, NQ_SESSION.GROUP, has no value definition.
    When I changed the insert statement as below, this does get populated whenever someone logs in. But I need the values of GROUP associated with the user as defined in the repository.
    insert into stra_login_data (username, groupname, login_time) values ('TEST_USER', TEST_GROUP', SYSDATE)
    Could someone help me out! As I mentioned above, I need the GROUP info into the usage tracking. So, if there is another successful approach, could you please share?
    Thank you
    Amin

    Hi Amin,
    See [this thread|http://forums.oracle.com/forums/thread.jspa?messageID=3376946&#3376946]. You can't use the GROUP session variable in an Init Block unless it has been seeded from an Init Block first. There isn't an easy solution for what you want, but here are some options:
    1) Create a copy of your User => Groups assignments in your RPD in an table so you can use it in your Usage Tracking Subject Area. But this means you will have to replicate the changes in two places so it's not a good solution.
    2) As the GROUP session variable is populated when you login you could theoretically use it a Dashboard and pass it a parameter to write the value to the database. But as I am not sure how can you make fire only once when the user logins it sounds like a bad idea.
    3) Move your User => Groups assignments from your RPD to a DB table. Use OBIEE Write Back or something like Oracle APEX to maintain them.
    I think 3) is the best solution to be honest.

  • Repository variable and Init block

    I created an Init block that is based off of a sql command in which the command is designed to give me the max date a table was updated after a data load.  Well the variable I created based off of this has a timestamp of today's date.  I want to create a report on the front end (actually just a column) that updates when a load has been completed.  I use this (TIMESTAMPDIFF ( SQL_TSI_MINUTE, VALUEOF(“LAST_UPDATE_DATE”)), CURRENT_TIMESTAMP)) for the column formula but I'm either running into errors or getting nothing at all.
    OBIEE 11.1.1.5
    Please Advise

    Hey......long time but here it is.   So I created an init block called Last_update_date and had it query a db table that automatically updates when a data load is complete.  I set a variable with the current timestamp.  Well When the table loads the variable locks in that time of the load.   On the front end I referenced the table in an expression and created a report around it.  I did a timestamp diff b/t current time and the time the init block locked in for the load, and called it ETL update column.  I created an agent that starts a purging/caching cascade with the ETL update report as the condition.
    Thanks

  • Load more than one user groups to system session variable GROUP from table

    hi, I found that the value of the system session variable GROUP can be assigned by setting a sql in initialization blocks.
    however, if there are some users with more than one user group.
    can this be done by table driven (using sql in initialization blocks) ?
    thanks !!

    Referencing GROUP session variable in initialization blocks for different types of authentication
    http://108obiee.blogspot.com/2009/10/referencing-group-session-variable-in.html
    Users are assigned to multiple groups from external table with semicolons, see example two and three from the post.
    Regards
    Goran
    http://108obiee.blogspot.com

  • System session variable USER

    Hi,
    i have setup-ed the action links and used the USER variable for the EBS secuirty context init block as this
    EBS_RESP_ID
    EBS_RESP_APPL_ID
    EBS_SEC_GROUP_ID
    EBS_RESP_NAME
    EBS_USER_ID
    EBS_EMPLOYEE_ID
    USER
    Now for the sso configuration in the RPD i need to use the USER variable again as per the document (section A.1.1 )http://docs.oracle.com/cd/E14571_01/bi.1111/e10543/legacy.htm#BABFJEJF
    "To set up LDAP authentication:
    Create an LDAP Server as follows:
    Select Manage then Identity in the Oracle BI Administration Tool to launch the Security Manager.
    Select Directory Servers from the left pane in Security Manager.
    Right-click in the right pane in Security Manager and select New LDAP Server. The LDAP Server dialog is displayed.
    Create the LDAP server by completing the fields.
    Create an LDAP initialization block and associate it with an LDAP server. For more information. see "Creating Initialization Blocks" in Oracle Fusion Middleware Metadata Repository Builder's Guide for Oracle Business Intelligence Enterprise Edition.
    Define a system variable named *USER* and map the USER variable to an LDAP attribute (uid or sAMAccountName)."
    So how can i use the same user variable and assign it to LDAP init block as well the EBS security context init block.
    can you provide your valuable inputs here.

    Referencing GROUP session variable in initialization blocks for different types of authentication
    http://108obiee.blogspot.com/2009/10/referencing-group-session-variable-in.html
    Users are assigned to multiple groups from external table with semicolons, see example two and three from the post.
    Regards
    Goran
    http://108obiee.blogspot.com

  • How does one access custom function in OBIEE RPD for Session Init Block SQL

    Hello:
    We are using SSO for authentication and authorization for OBIEE, using Init Blocks in the RPD and httpHeader as the source of variables in the Instanceconfig.xml file. (As long as the user is member of one group, the results are fine. However, as soon as the user is assigned to multiple groups, group values become URI-encoded.)
    To solve the problem of URI-encoding, we have deployed a function to the DB (ora 10gr2).
    The problem I am running into is that when I call the function from an Init Block (Security), OBIEE Presentation Services (OPS) acts as though the function does not exist or is not called.
    Initialization String: select group_OBIEE(WEBGROUPS) from dual
    ("group_OBIEE" is the function that was deployed.)
    Testing: Successfully tested the function in PL/SQL as well as using the Test button in RPD.
    Reason for the fuction: The function decodes the extra characters using a substr function. SSO uses Shibboleth for Authentication and Authorization.
    For example, for our group name, we expect to obtain the following value:
    edw:hrdir;edw:findir (2 groups separated by a semi-colon)
    However, we are obtaining the following: (Determined via the narrative view in Answers: @{biServer.variables['NQ_SESSION.GROUP']} )
    URI-ENCODED<edw%3ahrdir%3bedw%3bfindir>
    Please note: There are no such problems when we are passing only a single group value (i.e. edw:hrdir). So, in cases when we pass only for Group for the user, we are able to authenticate and authorize w/o a problem.
    Any suggestion on how to call the function or a better way to approach this problem?
    Thanks in advance for your help.

    You don't need a function to assign the groups in your Init Block. In fact you should not use it. You need to use a standard select and define the Init Block as Row-Wise. This means the BI Server knows the Init Block will return more than one row. You select statement should look like this:
    SELECT 'GROUP', YOUR_GROUP_NAME FROM YOUR GROUP_USERS_TABLE WHERE YOUR_USER_ID_COLUMN = ':USER'

  • Row level security with session variables, not a best practice?

    Hello,
    We are about to implement row level security in our BI project using OBIEE, and the solution we found most convenient for our requirement was to use session variables with initalization blocks.
    The problem is that this method is listed as a "non best practice" in the Oracle documentation.
    Alternative Security Administration Options - 11g Release 1 (11.1.1)
    (This appendix describes alternative security administration options included for backward compatibility with upgraded systems and are not considered a best practice.)
    Managing Session Variables
    System session variables obtain their values from initialization blocks and are used to authenticate Oracle Business Intelligence users against external sources such as LDAP servers or database tables. Every active BI Server session generates session variables and initializes them. Each session variable instance can be initialized to a different value. For more information about how session variable and initialization blocks are used by Oracle Business Intelligence, see "Using Variables in the Oracle BI Repository" in Oracle Fusion Middleware Metadata Repository Builder's Guide for Oracle Business Intelligence Enterprise Edition.
    How confusing... what is the best practice then?
    Thank you for your help.
    Joao Moreira

    authenticating / authorizing part is take care by weblogic and then USER variable initialized and you may use it for any initblocks for security.
    Init block for authenticating / authorizing and session variables are different, i guess you are mixing both.

  • OBIEE Session Variable Problem

    Hi:
    OBIEE 11.1.1.5
    I created a new session variable and initialization block. The default value of the variable is 1. The query for the initialization block is SELECT 123456 FROM DUAL. The query in the initialization block tested fine. I bounced the OBIEE instance.
    When I use the Administration Tool to view the Session Manager, I see that the value of the variable is 123456.
    The problem is in an Answers report the value of the variable is 1.
    Can anyone offer a suggestion as to why the value in Answers is the default value of the variable?
    Thanks.

    Thanks for your reply. I agree that the expression NQ_SESSION. <<variable name>> will display the variable. And it is with this command, in Answers, that I see the default value. Only in the Admin Tool do I see the correct value assigned with the Initialization Block.
    Again, my problem is I cannot display the correct assigned value in an Answer report, only the default value.

  • Need help on how to find unused variables and intialization blocks in rpd

    Hi ,
    I have to remove used initialization blocks and variables.
    Could suggest me the wayt to find the unused variables and intialization blocks.
    Thnx

    1.For the ones used in the RPD, you can right click on the presentation catalog and say Display related variable, init blocks etc.
    2. The ones used in Presentation layer only could be identified when they get fired. refresh your dashboards and from the admin tool in online mode you can find which init blocks and variables are fired... eliminate by that way.
    3. to know all the variables and init blocks present create the Metadata dictionary of the RPD and you will get a folder named Init blocks... identify and explore there....

  • Row-Wise GROUP init block isn't creating the variable

    Hi,
    I have an Init Block to set the GROUP variable using row-wise initialization. When I log into Answers with a user, and then check the session variables from Admin Tool, I don't see the GROUP variable anywhere. It seems like the init block is not creating it.
    I have execution precendence set up the way it should be. I have the groups created in both RPD and Presentation Services. Below is my simple query to try to get it to work:
    SELECT 'GROUP', 'OFFICER' FROM DUAL
    UNION ALL
    SELECT 'GROUP', 'SUPERVISOR' FROM DUAL
    Any ideas?
    Thanks
    Edited by: oroborus on Mar 24, 2010 1:25 PM

    Yes I saw the query in the log, it was successful. I added a simple request to a dashboard to display the value of GROUP, and it seems to be working correctly from there. Do the row-wise variables not show up in Admin tool session monitor?

  • Using row-wise multi-value GROUP system session variable in report filter

    The title says it all except I am using 10g OBIEE.
    What I want to do is filter on the dynamic system session variable GROUP created in a row-wise initialization block.
    The GROUP vriable is being set up correctly and it shows the user dynamically put into the correct groups in Answers.
    (Using the admin tool and looking at the user session, only the initial authentication block variables show up.)
    But if I want to filter using the value of GROUP it doesn't work.
    The obvious way is to choose the filter icon, then choose Add -> Variable -> Session, enter GROUP, and then display results.
    It comes back with no rows.
    Any idea how to do this? I've tried lots of things but none of them work either producing no rows or an error.
    This is the kind of Answers SQL this report is resulting in, which makes sense to me, but produces no rows.
    SELECT "Package Virtual Group (Dim)"."Package Virtual Group" saw_0, "Contact (Fact)"."Contacts All Count" saw_1 FROM "Case/Transaction/ABC" WHERE "Package Virtual Group (Dim)"."Package Virtual Group" = VALUEOF(NQ_SESSION."GROUP") ORDER BY saw_0

    866038 wrote:
    Errors come from trying things that don't work.
    For example, instead of =, using IN VALUEOF(NQ_SESSION.GROUP) or @{session.GROUP} or lots of other things.
    The question is this:
    how can I filter a column in Answers using the GROUP session variable which had been initialized in a row-wise initialization block?
    I can find no way to do it. Mostly it returns no rows.Hi,
    we had a similar requirement, where we have an external name that has project number values. We used row wise initialization to capture all the projects that a user belongs to. Then, we applied the filters at the RPD level, instead of doing it at the report level. From you requirement I see that you are trying to filter the groups based on user login. When a user logs in, he will see the information about the groups that he only belongs to. Correct me if I am wrong here.
    Assuming I am right about your requirement, providing the filter that you need apply in RPD.
    On all the fact tables are joined to the Package Virtual Group dimension, apply the below filter.
    case when 1=1 then (Dim)"."Package Virtual Group" END = VALUEOF(NQ_SESSION."GROUP");
    The reason for use of case statement here is, it converts the logical sql to IN Clause, helping us acheive the exact query that we would want.
    Please Award points if this helps.
    Thanks,
    -Amith.

Maybe you are looking for