Is it possible to pass Presentation Variable into SQL code?

Is it possible to create a Prompts that can pass data inputted in the Prompt to a SQL statement?
Example
User inputs
Dashboard Prompt: Date Between today date AND yesterday's date
Which pass information to a measure and labels the the information:
CASE WHEN "Date.Datetable" = {@}DATE1 THEN 'Today' Else 'Yesterday' END FROM "TABLE_Example"

You can pass a selected value from prompt to filter a measure or display it as a dynamic label/column header.
To set the label like a dynamic column header:
http://total-bi.com/2011/03/obiee-dynamic-column-headings/
If that is for the measure value then use presentation variable and use them in the formula of the column.
If that is to pass value to the physical layer or bmm layer then use session variable, set it using request variable in prompt and use the session variable in bmm or physical layer view.
Let me know if this helped.
Regards,
Jay

Similar Messages

  • Passing Unix variable into sql

    Hi,
    I have a shell script with embedded SQL.
    In the script I have a Unix variable that has a char value
    id="P_test".
    I need to pass this variable to a select in a where condition like
    select * from table where camp1=$id.
    The problem is $id returns P_test rather than 'P_test' so that the select can work.
    Any ideea how to change the clause where to make the select work?
    I could also change the variable id as to have id=" 'P_test' " , but this variable comes from a file parsed and I don't know how to get 'P_test' instead of P_test.
    Thanks

    another option may be like this example -
    $OH10/bin/sqlplus -s > $CIGDEM_LOG_DIR/step1_$CIGDEM_DATE.log 2> $CIGDEM_LOG_DIR/step1_$CIGDEM_DATE.err <<EOF
    $CIGDEM_USERNAME1/$CIGDEM_PASSWORD1@$OTNS10
    @$CIGDEM_DIR/step1.sql $CIGDEM_EXP_DIR $CIGDEM_USERNAME3 $CIGDEM_PASSWORD3 $PERMANANT_TABLESPACE $TEMPORARY_TABLESPACE
    exit ;
    EOF
    "@$CIGDEM_DIR/step1.sql $CIGDEM_EXP_DIR $CIGDEM_USERNAME3 $CIGDEM_PASSWORD3 $PERMANANT_TABLESPACE $TEMPORARY_TABLESPACE" here we call step1.sql with arguments, they will be used with &n symbol inside sql statement -
    .. CREATE USER &2 IDENTIFIED by &3 TEMPORARY TABLESPACE &5 DEFAULT TABLESPACE &4 ; ..http://tonguc.wordpress.com/2007/11/29/linux-and-shell-scripting-part-2/

  • Passing Presentation Variables to Guided Navigation

    I'm having trouble passing Presentation Variables (and Session Variables) to analyses called via a Guided Navigation link in 11.1.1.5.
    1. Created a dashboard prompt to select from a list of months. The prompt populates a Presentation Variable called pMo.
    2. Created an analysis that displays two columns: Month and '{pMo}'
    3. That analysis has this filter: Month is equal to / is in {pMo}
    4. Put the dashboard prompt and the analysis onto a dashboard page.
    5. Put an Action Link onto the dashboard page, calling that same analysis in a new window.
    6. View the dashboard page
    7. Initial analysis displays an error, which is expected since pMo has no value.
    8. Select a month, which populates pMo. Analysis displays properly. Month and pMo both show correctly.
    9. Click the Action Link.
    10. The new window shows the correct value of Month, but NOTHING in the pMo column.
    This is not logical. If the correct value of Month is shown in the new window, that means that Month MUST have been filtered using pMo. But the pMo column shows blank.
    I see the exact same behavior with Session Variables. The value of the variable is correctly used to filter the analysis, but that variable's value doesn't show up in the analysis column.
    In fact, if I assign a default value for the variable, the Month column shows the "correct" (i.e. selected) value, but the column containing the formula for the variable shows the variable's default value, not the value that was obviously used by the filter.
    The problem only occurs in the new window that appears with the Guided Navigation link. The original dashbord page shows correctly.
    Here's the error when using a Session variable. Similar error when using Presentation variable.
    Error getting drill information: SELECT "Channels"."Total Channel" saw_0, "Times"."Month" saw_1, VALUEOF(NQ_SESSION.Mo) saw_2 FROM "Retrospectives" WHERE "Times"."Month" = 'Mar-2005'
    Error Details
    Error Codes: YQCO4T56:OPR4ONWY:U9IM8TAC:OI2DL65P
    Location: saw.views.evc.activate, saw.subsystem.portal, saw.httpserver.processrequest, saw.rpc.server.responder, saw.rpc.server, saw.rpc.server.handleConnection, saw.rpc.server.dispatch, saw.threadpool, saw.threadpool, saw.threads
    Odbc driver returned an error (SQLExecDirectW).
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 43113] Message returned from OBIS. *[nQSError: 23006] The session variable, NQ_SESSION.Mo, has no value definition. (HY000)*
    So, if NQ_SESSION.Mo has no value, how did the Filter know that Mar-2005 should be used? NQ_SESSION.Mo DOES have a value. Why won't the column display it?
    By the way, in case you're wondering 'what's the big deal', it's this: I want to be able to type a Commission Percent into a text box, store it in a variable, and then use that variable in a calculation within a Guided Nav link. That's what I was originally testing. The description above is what I finally figured out is happening. The variable has a value that can be used as a filter condition, but that value is ignored when used in the columns of that filtered analysis.
    Edited by: Mark T. on Jan 7, 2012 7:15 AM

    Mark T. wrote:
    I'm having trouble passing Presentation Variables (and Session Variables) to analyses called via a Guided Navigation link in 11.1.1.5.
    1. Created a dashboard prompt to select from a list of months. The prompt populates a Presentation Variable called pMo.
    2. Created an analysis that displays two columns: Month and '{pMo}'
    3. That analysis has this filter: Month is equal to / is in {pMo}
    4. Put the dashboard prompt and the analysis onto a dashboard page.
    5. Put an Action Link onto the dashboard page, calling that same analysis in a new window.
    6. View the dashboard page
    7. Initial analysis displays an error, which is expected since pMo has no value.
    8. Select a month, which populates pMo. Analysis displays properly. Month and pMo both show correctly.
    9. Click the Action Link.
    10. The new window shows the correct value of Month, but NOTHING in the pMo column.
    This is not logical. If the correct value of Month is shown in the new window, that means that Month MUST have been filtered using pMo. But the pMo column shows blank.
    I see the exact same behavior with Session Variables. The value of the variable is correctly used to filter the analysis, but that variable's value doesn't show up in the analysis column.
    In fact, if I assign a default value for the variable, the Month column shows the "correct" (i.e. selected) value, but the column containing the formula for the variable shows the variable's default value, not the value that was obviously used by the filter.
    The problem only occurs in the new window that appears with the Guided Navigation link. The original dashbord page shows correctly.
    Here's the error when using a Session variable. Similar error when using Presentation variable.
    Error getting drill information: SELECT "Channels"."Total Channel" saw_0, "Times"."Month" saw_1, VALUEOF(NQ_SESSION.Mo) saw_2 FROM "Retrospectives" WHERE "Times"."Month" = 'Mar-2005'
    Error Details
    Error Codes: YQCO4T56:OPR4ONWY:U9IM8TAC:OI2DL65P
    Location: saw.views.evc.activate, saw.subsystem.portal, saw.httpserver.processrequest, saw.rpc.server.responder, saw.rpc.server, saw.rpc.server.handleConnection, saw.rpc.server.dispatch, saw.threadpool, saw.threadpool, saw.threads
    Odbc driver returned an error (SQLExecDirectW).
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 43113] Message returned from OBIS. *[nQSError: 23006] The session variable, NQ_SESSION.Mo, has no value definition. (HY000)*
    So, if NQ_SESSION.Mo has no value, how did the Filter know that Mar-2005 should be used? NQ_SESSION.Mo DOES have a value. Why won't the column display it?
    By the way, in case you're wondering 'what's the big deal', it's this: I want to be able to type a Commission Percent into a text box, store it in a variable, and then use that variable in a calculation within a Guided Nav link. That's what I was originally testing. The description above is what I finally figured out is happening. The variable has a value that can be used as a filter condition, but that value is ignored when used in the columns of that filtered analysis.
    Edited by: Mark T. on Jan 7, 2012 7:15 AMI don't have 11g so what I say may not apply to you at all. That being said, it appears that what you are describing is similar to how the Link or Image and Guided Nav. objects work in 10g. Bear with me for a sescond while I explain. In the Link or Image object, you can open a destination report in a new window, but PVs don't pass through. In the Guid. Nav. object, PVs pass through to the destination, but you don't have the option to open the report in a new window. The filtering works, which is why your destination report is properly filtered; it's just that the PV is not passed and therefor the pMo column is blank.
    Since you said your destination report opens in a new window, it is acting like the Link or Image object in 10g. So try doing this:
    1) Ensure that your dashboard prompt is set to "dashboard" scope. This being that the PVs with the same name will be set for all dashboard pages, once set in the parent page.
    2) Create a new dashboard page and include the same prompt as in the parent page, and your destination report. Hide the prompt on this page.
    3) Now in your Action Link of the parent report, instead of pointing to the report itself, point it to the dashboard page created in step 2).
    My theory is this: With the dashboard prompt set to dashboard scope, the PV of the prompt in the destination page will be set as soon as you hit the "Go" button. This will allow the report in the destination page to be set by the same variable, even though the value is not passed on directly through the Action Link.

  • How to pass bind variable into oracle reports 6i - Parameter form

    Hello All,
    I want to pass bind variable into Oracle Reports 6I - Parameters.
    I have tried out that but got the below error :-
    rep-0781 : Bind variables are not allowed in the select statement
    Kindly help me is there any option which allow me to pass bind variables into Oracle reports 6I.
    Thanks
    HARSH SHAH

    Hi,
    may be its not possible to use :P_PARAM1 in user parameter of oracle 6i reports
    but u can full fill user requirement using oracle forms
    create a form as like as report parameter window
    then create parameter list and run report
    PROCEDURE Run_Emp_Report IS
      pl_id ParamList;
    BEGIN
      pl_id := Get_Parameter_List('tmpdata');
      IF NOT Id_Null(pl_id) THEN
        Destroy_Parameter_List( pl_id );
      END IF;
      pl_id := Create_Parameter_List('tmpdata');
      Add_Parameter(pl_id, 'PARAMFORM', TEXT_PARAMETER, 'NO');
      Run_Product(REPORTS, 'empreport', SYNCHRONOUS, RUNTIME, FILESYSTEM, pl_id, NULL);
    END;
    thanks
    mostafiz mitul
    Dhaka Bangladesh

  • How to pass a variable into a cfc?

    prior to calling the cfinvoke, I have coding that determins a
    variable "X"
    I need to pass X into a cfc so it can complete the query held
    there.
    So I tried
    <cfinvoke component="A"
    method="AList"
    returnvariable="AResults">
    <cfinvokeargument name="x" value="#X#"
    /></cfinvoke>
    correct so far?
    Now over on the cfc page is where I'm getting stuck
    Inside my cffunction I'm adding <cfargument name="X" />
    But how do I get the value in?

    I don't quite understand your question. Can you rephrase?
    But before all that, bear in mind that one doesn't pass a
    variables into a
    *CFC*, one passes it into a function within the CFC. And as
    with all
    functions, one passes values into the function by passing it
    as an
    argument. But - of course - the function has to be coded to
    expect the
    argument.
    Your own sample code demonstrates this in action:
    <cfinvokeargument name="abbrCode"
    value="#companyAbbrCode#" />
    (NB: lose the trailing slash: this is CFML, not XML).
    So you know how to do that.
    Hence me not quite understanding what you're actually asking.
    Adam

  • How to pass presentation variable in column Fx using GO URL

    Hi All,
    I want to show a download link directly using go url .
    In my dashboard prompt i am using some presentation variable .
    those variables i am using in the report's column formula .
    When i am applyning the prompt that it is not applying in the column Fx. so when i download the excell it shows same data for all the option choosen.
    If anybody knows the syntax please help.
    Thanks ...

    Hi,
    Like this you can pass presentation variables to the columns using Go URL
    '<a href=saw.dll?Dashboard&PortalPath=/shared/Test/_portal/Test%20KPIs&Page=Page1&Action=Navigate&col1="Dim%20Country"."Country%20Name"&val1='||'@{PV_Contry'||'>'||'Country'||'<\a>'
    Please use backslash in anchor tag end. Since here it is not accepting I am using forward slash.
    Thanks
    Vino

  • Is it possible to pass a variable from a shell script back to an Automator action?

    Is it possible to pass a variable from a shell script back to an Automator action?
    For instance, if I assign a value of foo to $var1 in my shell script how would I retrieve/pass that value in the next Automator action. I see that there is a variable called "Shell Script" but I can't any information on how to use it. 

    red_menace,
    Thanks but I still don't understand how to pass a single value that was set in the UNIX scipt back to Automator has a variable. Take the example below, I write 4 varables to STDOUT and all 4 are stored in a variable named "storage".  How do I assign 1 of these values to the Automator "storage" variable? For instance if I wanted to assign the value of $var2 to "storage" , how would I do that?

  • OBIEE 10 - Is Possible change the Presentation Variable without GO BUTTON ?

    OBIEE 10:
    Is Possible change the Presentation Variable only changing the Value on the prompt ??
    Or the presentation variable only change if click on "GO BUTTON" ????
    Thanks.

    You need to click the "Go" button. That is what sets the variable.

  • Passing Global Variable in Sql Object

    Hi
    How can i pass my global variable into SQL object? I tried to pass it but then I tried to update the schema it giving me the error at varble
    Please advise me

    The Update schema is used only to get the structure for the Output.
    Once you have a valid structure and the SQL Parses without any variables use the syntax for applying variables as in any Script within DI.
    $GV_MyVar enclosed within square brackets will be replaced by Value of the variable.
    $GV_MyVar enclosed within curly brackets will be replaced by Value of the variable enclosed in single quotes.
    When the job runs, the variables will be replaced with values OR values with quotes. It is at this time, the SQL send to the database is validated for syntax.
    Therefore, you will not know the validity of your SQL with Global Variables until you run the job.
    Hope this helps!
    Thanks & Regards
    Tiji
    Edited by: Tiji Mathew on May 8, 2009 3:40 PM
    The actual syntax was being posted as a link. edited to make the text descriptive.

  • Passing a variable into workflow

    I know u can pass variables from a form into a workflow using processInputs.....but let's say I have a update workflow and there's some attribute that has changed on the user that requires the update workflow to trigger the disable workflow.....let's say I use the disableUser workflow service does anyone know if it's possible for to pass a variable from the update workflow to the disable workflow??

    you do it the same way you would in any other workflow. but if. In fact, I THINK that you dont even need to pass it. The external workflow should be available to all internal workflows.
    otherwise define it in the disable and pass it in. We do this all the time. should work fine.
    Dana Reed
    AegisUSA
    Denver, Co
    773.412.3728

  • Unable to pass  presentation variable value to Go url with narrative view

    I am trying to use navigate option of Go URL. I have Dashboard prompt with presentation variable (pv)defined. I am able to see the pv value in compund view but unable to see in Narrative view. Any thoughts?

    Check my blog entry here http://oraclebizint.wordpress.com/2007/11/26/oracle-bi-ee-101332-same-page-navigation-drills-and-passing-parameters/. It has an example.
    Thanks,
    Venkat
    http://oraclebizint.wordpress.com

  • Is it possible to pass a variable from one animation to another?

    I have multiple animations on the same page. I need to pass a variable from one to the other.
    Animation One has this:
    sym.setVariable("myVarOne", 1);
    Animation Two has this:
    var myVarOneInTwo=Edge.getComposition("EDGE-12345678").getVariable("myVarOne");
    Seems like it should work, but kinda hard to tell. I put in:
    console.log("myVarOneInTwo = " + myVarOneInTwo);
    But I get: Javascript error in event handler! Event Type = timeline
    So it seems that it doesn't like getting a variable from another animation.
    Is there a way to pull a variable from one animation into another?

    Sorry also had to fix this:
    var myVarOneInTwo=Edge.getComposition("EDGE-12345678").getVariable("myVar One");
    To this:
    var myVarOneInTwo=Edge.getComposition("EDGE-12345678").getStage().getVariable("myVar One");

  • Error while Passing shell variable into exec UTL_MAIL.SEND

    Hello,
    I am new in shell scripting, please help me to rectify, whats wrong in my code.
    login='system/manager'
    code=`
    sqlplus -s $login <<EOF
    set heading off
    SELECT tablespace_name,(SUM(bytes/1024/1024)) FROM dba_free_space WHERE tablespace_name IN ('PIN00','PINX00','SYSTEM','SYSAUX','UNDOTBS1','STATSPACK') GROUP BY tablespace_name;
    EOF`
    exec UTL_MAIL.SEND(sender=>'[email protected]', recipients=>'[email protected]', cc =>'[email protected]' , subject=>'$ORACLE_SID BACKUP', message =>'$code')
    exit;
    EOF
    echo "sqlplus exited"
    ERROR:
    ORA-01756: quoted string not properly terminated
    SP2-0734: unknown command beginning "SYSTEM ..." - rest of line ignored.
    SP2-0734: unknown command beginning "PIN00 ..." - rest of line ignored.
    SP2-0734: unknown command beginning "PINX00 ..." - rest of line ignored.
    SP2-0734: unknown command beginning "SYSAUX ..." - rest of line ignored.
    SP2-0044: For a list of known commands enter HELP
    and to leave enter EXIT.
    Edited by: 929236 on Apr 21, 2012 12:46 AM
    Edited by: 929236 on Apr 21, 2012 12:48 AM

    Hello,
    Thanks for your review.
    But please look into below output i am getting after running below code
    ORACLE_BASE=/oracle; export ORACLE_BASE
    ORACLE_HOME=$ORACLE_BASE/product/10.2.0.4/db_1; export ORACLE_HOME
    ORACLE_SID=pindb; export ORACLE_SID
    PATH=/usr/sbin:$PATH; export PATH
    PATH=$ORACLE_HOME/bin:$PATH; export PATH
    LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
    CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH
    login='system/manager'
    code=`
    sqlplus -s $login <<EOF
    set heading off
    set feedback off
    SELECT tablespace_name,(SUM(bytes/1024/1024)) FROM dba_free_space WHERE tablespace_name IN ('PIN00','PINX00','SYSTEM','SYSAUX','UNDOTBS1','STATSPACK') GROUP BY tablespace_name;
    exit`
    output:
    PIN00 28287.1172 PINX00 93813.1367 STATSPACK 54.1875 SYSAUX 215.125 SYSTEM .1015625 UNDOTBS1 745.8125 6 rows selected.
    Here its working very fine but when i am passing code variable to utl_mail.send procedure, its giving error same as i mentioned previous. I have put all the environment variable as well. But when i put utl_mail.send and pass CODE variable into it it gives error.
    ORACLE_BASE=/oracle; export ORACLE_BASE
    ORACLE_HOME=$ORACLE_BASE/product/10.2.0.4/db_1; export ORACLE_HOME
    ORACLE_SID=pindb; export ORACLE_SID
    PATH=/usr/sbin:$PATH; export PATH
    PATH=$ORACLE_HOME/bin:$PATH; export PATH
    LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
    CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH
    login='system/manager'
    code=`
    sqlplus -s $login <<EOF
    set heading off
    set feedback off
    SELECT tablespace_name,(SUM(bytes/1024/1024)) FROM dba_free_space WHERE tablespace_name IN ('PIN00','PINX00','SYSTEM','SYSAUX','UNDOTBS1','STATSPACK') GROUP BY tablespace_name;
    exit`
    $ORACLE_HOME/bin/sqlplus -s /nolog << EOF
    connect / as sysdba
    exec UTL_MAIL.SEND(sender=>'[email protected]', recipients=>'[email protected]', cc =>'[email protected]' , subject=>'$ORACLE_SID BACKUP', message =>'$code')
    exit;
    EOF
    echo "sqlplus exited"
    ERROR:
    ORA-01756: quoted string not properly terminated
    SP2-0734: unknown command beginning "PIN00 ..." - rest of line ignored.
    SP2-0734: unknown command beginning "PINX00 ..." - rest of line ignored.
    SP2-0734: unknown command beginning "STATSPACK ..." - rest of line ignored.
    SP2-0734: unknown command beginning "SYSAUX ..." - rest of line ignored.
    SP2-0044: For a list of known commands enter HELP
    and to leave enter EXIT.
    SP2-0734: unknown command beginning "SYSTEM ..." - rest of line ignored.
    SP2-0734: unknown command beginning "UNDOTBS1 ..." - rest of line ignored.
    sqlplus exited
    Thanks,
    Ashish
    Edited by: user13271251 on Apr 22, 2012 11:49 PM

  • How to pass Presentation Variable Value from Main Report to Detail Report

    Hello,
    I've 2 reports that is attached to each other. In my main report i've several report prompts and i am using i"s prompted" on my detail report to attach them.
    But 2 of my report prompts are presentation variables(Names : FIRST, SECOND). Both are in date format. I've a filter in my main report like;
    "ASSIGNMENTS_F"."EFFECTIVE_START_DATE" BETWEEN @{FIRST} AND {SECOND}
    It works fine when i run the main report. But when i click on the numbers, i see that i can not filter my detail report with the chosen values for 2 presentation variables. It just shows all the dates.
    I've tried adding both presentation variables in both reports as columns and adding 'is prompted' filter to them. But did not work either.
    I just cant pass the written values for presentation variable prompts to detail report..
    Please help :)

    Hi,
    What you can try is refer the filte condition in the main report to the detailed report with the option--> Filter based on another request.
    Or you try creating another intermediate report which will refer the main report filters and pass the filters to the detailed report.
    Hope this helps.
    Regards
    MuRam

  • How to pass presentation variable with enclosing single quotes

    HI All,
    As all of you know in 11g, Presentation variable can hold more than one value.So we can pass multiple values to the report through presentation variable.
    If we select x,y,z values from prompt drop down,then those values will be stored like x,y,z in the presentation variable.
    but I would like to store these values with enclosing single quotes like 'x,y,z'
    The reason is I need to pass this variable value as input to BI Publisher sql dataset query where clause.
    Please share your Ideas.
    Thanks,
    Aravind

    Aravind,
    Check this
    Predefined Presentation Variables in OBIEE 11G | Praveen&amp;#039;s Blog

Maybe you are looking for

  • Problem with recompose in PSE 11 trial version

    I am trying to determine whether to purchase PSE 11. I currently solely use Lightroom 4. I have attempted to use the recompose tool several times on several different pictures marking different things and generally have failed results. On the odd occ

  • Sales Employee wise Profitability in COPA

    Experts, Below mentioned are COPA characteristics in current structure. Mentioned in RED are characteristics based on Derivation Logic. Company Code Plant Sales Org. Distr. Channel Division Customer Product Sales employee Supervisor Manager Segment I

  • Insert , Update & Delete Not working in BDB Berkley Database

    Hi, Anybody has used Oracle ADF & BDB ,to insert/ update & delete? imported db.jar,dbexample.jar,sqlite.jar ,derby.jar. still not working (Only Query working) Pls lets us know

  • FXX HD is all pixelated almost unwatchable.

    This was the same probem that I had when it was Fox Sports Soccer.  The images are pixelated and skips.  It is increasingly hard to watch the channel, and now that it is FXX and there are shows that I actually want to watch this is a problem I would

  • Script foR PO

    hi people , i creted zmedruck same as medruck, for that i want to write Print program..(do n't tell Check SAPFM06P), this is request, if any one have own print program ,please send to my mail id [email protected].thank you