Oracle Analytics Cloud and Server

Welcome to the Oracle Analytics Community: Please complete your User Profile and upload your Profile Picture

[nQSError: 23006] The session variable has no value definition

Received Response
94
Views
5
Comments
user4839281
user4839281 Rank 1 - Community Starter

Hi All,

I am facing issues when referencing a session variable from a session variable. Let me explain.

My requirement is to find the minimum transaction time for the latest date. The user has ability to change the date thru a prompt.

So, I created a session variable to be used as a request variable to find the Max date. I then created another initblock to find the Min time using this request variable. Both the Init blocks are working fine and returning correct results when doing a Test.

My request variable is working as expected. However, I am getting the mentioned error when using the Min Time session variable in the report.

Init Block 1 (for request variable) - select max(TRANSACTION_DATE) from TRANSACTIONS

Request Variable name - MAX_TRANS_DT

Init Block 2 -

select to_char(min(TXN_TIME), 'mm/dd/yyyy hh24:mi:ss') from TRANSACTIONS where TRANSACTION_DATE = to_date('VALUEOF(NQ_SESSION.MAX_TRANS_DT)', 'yyyy-mm-dd hh24:mi:ss')

Any help is greatly appreciated.

Answers

  • Hi,

    Why don't you just merge the 2 queries together and return both variables from a single init block?

    It's pure SQL, so you can perfectly do it ...

  • user4839281
    user4839281 Rank 1 - Community Starter

    Gianni,

    Thanks for your reply. I have now combined the query like below into one init block:

    select to_char(min(TXN_TIME), 'mm/dd/yyyy hh24:mi:ss'), max(TRANSACTION_DATE)

    from TRANSACTIONS

    where TRANSACTION_DATE = (select max(TRANSACTION_DATE) from TRANSACTIONS)

    I have made all two variables as request variable. The weird thing is MAX_TRANS_DT is working fine, but MIN_TRANS_TIME is still giving me the same error. Any ideas?

    Thank you!

    Ravi

  • You maybe still have the second init bloc defined? (you forgot to delete it...)

  • user4839281
    user4839281 Rank 1 - Community Starter

    Hi Gianni, I had it deleted but was using the wrong variable name . Thanks for your help. Works perfectly.

  • Good that you have you 2 variables and no error anymore

    So you can maybe close the thread? For now it's still This question is Not Answered.