Oracle Analytics Cloud and Server

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

How can I access the Subject Area Name in a session variable

Received Response
21
Views
2
Comments
glen
glen Rank 1 - Community Starter

I want to be able to access the PRESENTATION NAME or SUBJECT AREA Name via a session variable and use this session variable in the “Execute before Query” Connection Scripts on the Connection Pool. The connection serves multiple Subject Areas and the requirement is to know which Subject Area is making the request.

I can access the dashboard name using VALUEOF(NQ_SESSION.SAW_DASHBOARD) and was wondering if there was something similar for the Subject Area. 

Answers

  • I would say there isn't a simple way because the subject area isn't unique for a query.

    If you build an union query, you can have 2 different (or more) subject areas involved in the same query. You can set the variable in the analysis itself, to a manual value, allowing you to cover the multiple subject areas cases, but you probably don't want that (because you have to edit every analysis to add the variable definition).

    There is a system variable containing the analysis, if you then join with the usage tracking, you will get the info. Wouldn't this work?

  • glen
    glen Rank 1 - Community Starter
    edited Jul 28, 2023 10:06PM

    Thank you for taking the time to reply.

    This is required in the “Execute before Query” Connection Scripts so that I can set a context for use in a VPD. So this has to be set before the query executes. This needs to work on an unsaved analysis as well - so for report authors who are developing analyses.

    I understand your point about multiple subject areas but I was trying to keep the requirement simple and get it to work with one subject area.