ORACLENERD twitter/oraclenerd view chet justice's profile on LinkedIn feed oraclenerd t-shirts Unemployment Clock:

  OBIEE: Variable Rendering
I was fighting with this one particular issue for a few days when I finally called in the big gun. Of course it took him about 5 minutes to figure out.

The Scenario
One of the report developers was trying to set some presentation variables based on the values from an init block.

I created a report referencing those values like VALUEOF(VARIABLE_NAME) so that he could easily reference those variables and see what their values were.

However, the report returned the value in the Default Initializer, and not the value from the SELECT statement.

The SELECT statement was using the built-in USER variable to find a record specific to that user, it looked something like this:
SELECT
group,
user_display_name
FROM user_table
WHERE user = UPPER( 'VALUEOF(NQ_SESSION.USER)' )
I assumed it wasn't firing but couldn't find any indication of it in the NQServer.log.

I then removed the single quotes around VALUEOF(NQ_SESSION.USER). Logged out and logged back in. In the log there was an error, invalid identifier. OK, so it is firing...so why aren't the values being populated?

I tried hardcoding the username in the query, tested it, logged out, logged in. No error in the log file. The report was still showing the Default Initializer though. WTF?

Have you found the error yet?

Here's some pretty pictures to better illustrate.

First, the init block.

init block

Variable

variable

Answers definition

answers definition

Answers rendered

answers rendered

Do you see it now?

So it was silly...very silly.

Solution
VALUEOF(TEST) should have been VALUEOF(NQ_SESSION.TEST)

new definition

Don't forget to logout. Session Initialization Blocks are fired upon login, otherwise, you'll get this lovely error:

error

And finally, it works

it works!

The part that I don't understand is why it showed me anything. If it knew (evidenced by the fact that it rendered as 'BEFORE INITIALIZATION'), why didn't it just work? Why didn't it just throw an error or something at runtime?

Debugging this particular problem was difficult. A syntax error that wasn't really a syntax error. There should be a some sort of warning...especially if it is aware.

Labels:

 
Comments:
If you want to know what is the value of your server variable (and not presentation variable, it's two different things). You can go in the session manager.

Check here:
http://gerardnico.com/wiki/dat/obiee/obi_server_variable_find_value

Cheers
Nico
 
Nico,

Thanks for that. Very helpful. And thanks for all your other posts...you have tons of great stuff.

The thing I don't understand is how OBI knew what the Default Initializer was but didn't know what the value should be. I understand I got the syntax wrong for it...just not sure what the underlying mechanism that knows one but not the other (without throwing an error).

chet
 
Becareful with the syntax. Check this good blog of Alex on the naming convention for the variables:
http://siebel-essentials.blogspot.com/2008/09/oracle-bi-ee-variables.html

It seems that OBIEE save the default initializer value in the same space than for a repository variable.

The call for a session variable is:
VALUEOF("NQ_SESSION.Variable Name")

But the call for a repository variable is:
VALUEOF("Variable Name")

Very strange for sure.

Good day
Nico
 
Thanks for that, I was using that exact document. It's nice to finally have the source of it...

I'm going to have to say that was not a great decision by the original creators. :)
 
Post a Comment

Subscribe to Post Comments [Atom]



Links to this post:

Create a Link



<<Home


Guest Authors

How To

Popular

Previous Posts

Code Projects

Archives
August 2007 / September 2007 / October 2007 / November 2007 / December 2007 / January 2008 / February 2008 / March 2008 / April 2008 / May 2008 / June 2008 / July 2008 / August 2008 / September 2008 / October 2008 / November 2008 / December 2008 / January 2009 / February 2009 / March 2009 / April 2009 / May 2009 / June 2009 / July 2009 / August 2009 / September 2009 / October 2009 / November 2009 / December 2009 / January 2010 / February 2010 / March 2010 / April 2010 / May 2010 / June 2010 / July 2010 /


Aggregated by OraNA