Using Presentation variables in Prompt Default using SQL Results.

I have set a presentation variable in a prompt(say 1st prompt). In the 2nd prompt, using default option, when I try to reference this variable in SQL Results, I get this error.
State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 27002] Near <@>: Syntax error [nQSError: 26012] . (HY000)
The syntax used for SQL is:
SELECT <tab>.<col1> FROM <subject area> WHERE <tab>.<col2> = @{variables.myvar}
Note: However the same SQL works fine in SHOW option.
Thanks in advance..
Edited by: user457687 on Feb 27, 2009 3:13 PM
Edited by: user457687 on Feb 27, 2009 4:49 PM

- OK. In the second prompt, instead of setting Default to SQL Results, set it to Specific Value.
- Then insert '{pres_var}' in the window. I got it to work this way.
- It supplied the PV as the default in the second prompt after hitting "Go" on the first prompt.
Hi, thanks for your suggestion but I don't need to have the value of the presentation variable itself as the prompt default. The variable is a filter for a specific SQL clause and the default is the result of this SQL.
Cheers
DrPlexi

Similar Messages

  • Unable to set presentation variable to prompt default.

    i am tying to apply prompt default value as some presentation variable.
    as i want to set depending on the value selected by Same prompt.please help me.
    or else help me to write sql statement with presentation variable(of other prompt) to set default.
    Edited by: user12078402 on Oct 28, 2009 5:21 PM

    Okay, I just tried something that works, but it's a workaround that may or may not work for you depending on the number of values in the column.
    Anyway, try this:
    1) Create your first prompt and save it to a presentation variable (PV), say prompt1
    2) Use the same column and create another dashboard prompt. In this one however, change the "Show" to "SQL Results."
    3) Now after the SQL in the window, add WHERE tablename.columnname IN ('@{prompt1}', 'value1','value2', etc...)
    Here is the drawback, you have to list the values explicitly (unless someone knows a better way), but this will default the second prompt to the first prompt's selected value while allowing the user the choices of the rest of the column.
    Not the prettiest solution, but it does work...

  • Using Sql Result and Limit Value in Prompt OBIEE 11.1.1.5

    Dear Gurus,
    I have prompt hierarchy like this:
    Year
    Quarter
    Month
    Which are using limit value (Quarter depend on Year, Month depend on Quarter), but I have issue because appear null also in those prompt
    I have checked my database, view, repository there are not null.
    My questions is, how to remove null in prompt when sql result can't use together with limit value, I don't know how to remove it using column filter.
    NB:I already using presentation variable in sql result in order to remove null and using constraint, but it show nothing in prompt view unless we press apply button.
    So I don't use this
    Please help, kindly appreciated
    JOE
    Edited by: JoeSSI on Mar 27, 2012 2:03 AM

    Hi,
    Can you edit your prompt here you can find show option then select SQL Result please modify statement like below.
    SELECT your column name FROM subject area where your column name is not null
    Go--> Edit your prompt--> Show--> Select Sql result---> change statement like above.
    Second way.
    Go to physical layer then double click your column name here you can find *"nullable"* option please check that.
    Go--> Physical Layer--> Extract table --> select your column name-->double click your column name--> here you can find option like Nullable please check it.
    Award points it is useful.
    Thanks,
    Satya

  • Presentation variable is not supported in "SQL Issued"

    hi, there is a presentation variable called @{ps_var} from a prompt
    and I have written a custom sql and typed in "SQL Issued"
    !http://img31.imageshack.us/img31/8673/customsql.jpg!
    I found that the presentation variable is not supported in "SQL Issued" (exception flows when I clicked the "Set SQL" button.)
    (in the captured screen, it is hardcoded as 'REPLACED_BY_PRESENTATION_VARIABLE', no error occurs when I clicked the "Set SQL" button. the result is correct.
    however, when 'REPLACED_BY_PRESENTATION_VARIABLE' is replaced by @{ps_var}, exception flows when I clicked the "Set SQL" button.
    is there an alternatives to avoid the error ? or any ways to assign the selected value from the prompt to this sql ?
    thank you very much!

    Just set your presentation variable with an other method.
    Check here you will find how you can set a presentation variable for a filter
    http://gerardnico.com/wiki/dat/obiee/presentation_service/obiee_presentation_variable_area

  • Presentation Variable in prompt, then BIN

    Hello,
    I have a 4 presentation variables, related to date which will be entered by the user (prompted). Can I use the presentation variables to setup the BINS? I have tried it and it just doesn't quite like it.
    Example,
    We a field called Issue Date
    Now, I want to check and compare 2 different Incident Date ranges.
    Therefore I have 4 presentations variables which hold the start and end date for each set. So, if I put Start date -01-05-2010 end date 10-05-2010 it will look into issue dates between this 2 dates. The issue is that the start and end date are entered by the user. So when I am creating a Bin I get a couple of errors:
    1. filter Editor Template not found on page
    2. nQSError: 10058] A general error has occurred. [nQSError: 46048] Datetime Month value 0 from 0000-00-00 is out of range. (HY000)
    If anyone can shet some light into how can I resolve this. I will highly appreciate it .
    Thanks.

    Hi,
    Yes you can use the presentation variable in the prompts.
    But first check if the presentation variable is getting assigned where you have called in the physical query generated. In Manage session-->view log.
    Try using a single quotes in the beginning and ending of the variable otherwise.
    And for the default selection, try building a dynamic variable in the rpd and call it in the prompt and check.
    Hope this helped/ answered.
    Regards
    MuRam

  • Issue with presentation variables, dashboard prompt and filter

    Dear Guru's,
    I have a question about constraining a request with presentation variable set by a dashboard prompt. I have a dashboard prompt, that stores its value in a presentation variable . The prompt is about region. When the dashboard opens, the default of the prompt is all choices and it needs to show my reports with "All Choices". I've created the following filter on my two reports on the dashboard:
    "Dim Student"."Region" = '@{variables.GILLES}'
    or '@{variables.GILLES}' IS NULL
    One report is just the column "Dim Student"."Region" (to see if it works) and with this report the above filter works just fine. When nothing is prompted it shows "All Choices" when a choice is made the report responds accordingly.
    BUT
    The second report on my dash with the same region column, but extended with some time dimension columns and a measure gives an error which I'm not able to solve.
    +State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 14023] None of the fact sources for ToDate(# Feitelijke Instroom:[DAggr(Feit Instroom en Uitstroom Opleidingen.# Feitelijke Instroom by [ Dim Tijd.Maand Omschrijving, Dim Tijd.Maand Nummer, Dim Tijd.Jaar, Dim Kwalificatie.Kwalificatie Niveau, Dim Leerling.RCBREGIO Regio] )], [Level JAAR]) are compatible with the detail filter [Dim Tijd.Maand Nummer = 3, Dim Tijd.Jaar = 2010].+
    +(HY000)SQL Issued: SELECT "Dim Tijd".Jaar saw_0, "Dim Tijd"."Maand Nummer" saw_1, "Dim Tijd"."Maand Omschrijving" saw_2, "Dim Kwalificatie"."Kwalificatie Niveau" saw_3, "Dim Leerling"."RCBREGIO Regio" saw_4, "Feit Instroom en Uitstroom Opleidingen"."# Feitelijke Instroom Cumulatief" saw_5, REPORT_SUM(saw_5 BY saw_0, saw_1, saw_2) FROM repos_x WHERE ("Dim Tijd".Jaar = 2010) AND ("Dim Tijd"."Maand Nummer" = 3) AND (("Dim Leerling"."RCBREGIO Regio" = 'Noord-Oost') OR ('Noord-Oost' IS NULL)) ORDER BY saw_0, saw_1, saw_2, saw_3, saw_4+
    While the exact same report but without the "or '@{variables.GILLES}' IS NULL" doesn't throw any errors but doesn't show the "all choices" by default.
    The ultimate goal to achieve is to build a dashboard with several reports from several subject areas with one single prompt that opens default with "all choices" and constrains the reports accordingly.
    Any help is highly appreciated.
    Kind Regards,
    Gilles

    Phani,
    I know "All Choices" is a special value and that it doesn't represent NULL. My filter construction seems to work fine.
    My filter condition:
    "Dim Student"."Region" = '@{variables.GILLES}'
    or '@{variables.GILLES}' IS NULL
    When it's set by the prompt it filters the request accordingly (first condition evaluates to true), when it's not set the second condition evaluates to true and shows all the results (or it's not filtered).
    The problem is that it doesn't work when time dimensions are combined with this filter. Then it throws the error mentioned in the first post.
    By the way: your suggested solution doesn't work.

  • Prompt using SQL Results with row-wise session variable comparison

    I have a prompt on Department and I only want the departments to show that have been authorized via a session variable for that user. The session variable can return can return multiple values and is set as row-wise. The session variable is returning results and have been used successfully in an application filter.
    I'm trying to put the correct SQL statement and this syntax doesn't work:
    SELECT "Department"."Department Code" 
    FROM "UBC Financials - YTD Table"
    WHERE  "Department"."Department Code" = '@{DEPT_LIMITS}'
    Can someone give me an example that does work?
    Thanks,

    Try something like WHERE  "Department"."Department Code" = VALUEOF(NQ_SESSION."DEPT_LIMITS")
    or else filter on department and then hit on add then Session variable
    ~ http://cool-bi.com

  • Error using presentation variable in SQL Expression

    Hi all,
    I'm receiving an error - '...Error getting drill information...' due to a presentation variable being used in a SQL Expression. It probably has something to do with a data type issue. I've narrowed the error to the use of the presentation variable.
    I'm setting a presentation variable, pres_mth_nme_to, from a dashboard prompt. The prompt contains a month name.
    I'm using the presentation variable as part of a SQL Expression in a filter. The gist of the SQL Expression is to use the
    presentation variable in a CASE and set a value accordingly. For example:
    Column: Month Sort Value
    Operator: Between
    Value: *10*
    SQL Expression: *Case  @{pres_mth_nme_to}{some default} WHEN 'NOV' THEN '10' WHEN 'DEC' THEN '11' WHEN 'JAN' THEN '12' WHEN 'FEB' THEN '13' WHEN...END*
    The month name is character. If I were to hard code this, I don't recieve the error. For example:
    CASE 'SEP' WHEN 'NOV' THEN '10' WHEN 'DEC' ...END
    There something going on with the data type from the prompt and it being used in the comparison. If I use a CAST, the problem still exists.
    CASE CAST(@{pres_mth_nme_to} as char(3)) WHEN 'NOV' THEN ... END
    If I'm in Answers, the problem doesn't exist, I'm assuming because of the default values. If I'm on the dashboard, it does exist, I'm assuming because of recieving the prompt value.
    I don't know what I'm missing. Any suggestions?
    Thanks.

    DJ,
    if the formula presented by you is exactly true, i mean it was not fabricated to present as an example in the forum, you should include the presentation variable in single quotes.
    i.e. your formula must look somthing like
    Case '@{pres_mth_nme_to}{some default}' WHEN 'NOV' THEN '10' WHEN 'DEC' THEN '11' WHEN 'JAN' THEN '12' WHEN 'FEB' THEN '13' WHEN...END
    let me know if it did solve the issue...
    -bifacts
    http://www.obinotes.com
    Edited by: bifacts on Oct 25, 2010 1:50 PM

  • Using presentation variables selected in dashboard prompt in query builder

    In dashboard prompt I have made four dropdowns(have four presentation variables) and based on these values selected,can the Query Builder generate dynamic reports based on the presentation variables selected?
    I will provide the link(i.e Link of BI publisher where I stored the report) displayed to the user based on Four presentation variables.
    If we click on that link can we use the presentation variables in where clause of Query Builder in BI Publisher?
    Please help me out
    Thanks in Advance

    - OK. In the second prompt, instead of setting Default to SQL Results, set it to Specific Value.
    - Then insert '{pres_var}' in the window. I got it to work this way.
    - It supplied the PV as the default in the second prompt after hitting "Go" on the first prompt.
    Hi, thanks for your suggestion but I don't need to have the value of the presentation variable itself as the prompt default. The variable is a filter for a specific SQL clause and the default is the result of this SQL.
    Cheers
    DrPlexi

  • Using presentation variable in a dashboard prompt

    Hi All,
    Can we use a presentation variable set in 1 dashboard prompt in another dashboard prompt to filter the values shown in the prompt based on the value selected in the first prompt?
    I am using SQL results in the second prompt.So, Iam not able to constrain the results. Any ideas?
    Thanks.

    Steps:
    1. 1st Dashboard prompt set Presentation Variable name say pdashboardprompt1
    2. In 2nd Dashboard prompt set Presentation Variable name say pdashboardprompt2
    In SHOW SQL results for 2nd Dashboard prompt. Select constraint
    SELECT Table1.Column1 FROM "SA" WHERE Table1.Column2 = '@{pdashboardprompt1}'

  • How to set Default to in Dashboard Prompt from presentation variable value

    Hi all BI Gurus,
    I am trying to come out from my problem from last two days and I am not able to find the solution.
    Here is my problem.
    I am having two dashboard pages in one dashboard. Both pages contains dashboard prompt. Now from the first page’s prompt I had set a presentation variable and I want to use that presentation variable’s value in to prompt’ s default value which is used in my second dashboard page.
    I am hoping I can do that with Server variable or variable expression, but don’t know the proper way. I tried a lot with both but not able to find the solution.
    Could any help me please?
    Regards,

    Hi David,
    Thanks for replying. I really appreciate it.
    Yes I am using the same column.
    Let me provide you more details regarding my problem,
    I am having one dashboard prompt for gender and it's default value is 'Female' so I am assigning that value in to presentation variable PV_GENDER with set variable option in prompt.
    Now in my second prompt which I am using on second page of same dashboard, I am trying to assign that value 'Female' ( or the one that user had selected ) with the help or that presentation variable PV_GENDER in Default to. I tried all options (e.g. Variable Expression, Server Variable, SQL Result ) but I am not able to get that value.
    If you need more detail just let me know.
    Once again thanks for replying.

  • Unable to pass the values to stored proc using presentation variable in OBI

    Hi All,
    Need your help regarding in resolving an issue in OBIEE 10.1.3.4.1
    There is an OBIEE requirement whereby two prompts need to be defined.
    1.     Textbox prompt
    2.     Drop-down prompt
    The dropdown values should be populated using textbox prompt. So, we have used presentation variable in textbox prompt and passing the same to select query of drop-down.
    Until this step, the report works just fine.
    Now, the value in both textbox and drop-down needs to be passed to stored proc.
    While trying to pass the values by using the presentation variable, the following error comes-up saying
    Session variable has no value definition.
    Note:Although the corresponding session variable has been set to default value,still the error appears.
    Please advise.
    Regards,
    Prasad

    "Session variable has no value definition" I'm assuming typo error and it should be presentation variable.
    Set default value for presentation variable that may work

  • Using a presentation variable to control which measures appear in a report?

    BI Experts -
    I have a custom report using the Supporting Reference Balances OTBI Subject Area in Fusion.
    I created a presentation variable dashboard prompt that has two values: Debit and Credit. I want to use this to allow the user to select which measure columns appear in the report.
    For example, if the user selects Debit, then the report should display all the debit measures, i.e. Beginning Balance DR, Period Balance DR etc. If the user selects Credit then the report should display Beginning Balance CR, Period Balance CR etc.
    Can you offer any suggestions and/or syntax to control which measure columns appear based on the value of the presentation variable?
    thanks in advance...

    If you can divide up the measures into 2 different analysis, you can do something like this: http://obiee101.blogspot.com/2010/07/obiee-using-prompt-as-report-selector.html
    OR
    http://shahin-obiee.blogspot.com/2012/04/switching-between-multiple-reports-in.html

  • Presentation variable in dashboard prompt

    Hi All
    I have a report on a dashboard page which navigates to another report on a different dashboard page (on the same dashboard). The
    first dashboard page has a prompt which needs to be passed as a filter to the navigated report i.e. Report1 on dashpage1 has Level1 prompt
    whose value must be passed to Report2 on dashpage2 which has Level2 (hence Report2 must show Level2 values for the passed Level1).
    1) I tried setting prompt1 on first page scope to Dashboard but it didn't help.
    2) I am trying to set a presentation variable 'level1_val' in the prompt1 and then in report2 say Level2 = @{level1_val} in Answers (filter->add presentation variable, I did not provide a default value). But when I navigate, Report2 shows no results. On adding the filter value, I noticed that the condition in Report2 is Level1=level1_val (Its taking level1_val presentation variable as a string and matching it to the Level1 prompt value). Level1 prompt value is a string. Is there a format say '@{level1_val}' that I should use in the column filter (I've tried this too)?
    Thanks
    Ananth

    You are using dashboard url option in the code from the report 1 to call dashboard page 2 (with report 2).
    You have only dashboard prompt for level 2 in the dashboard page 2?
    1. If you put in the filter of the second report column is equal to presentation variable that you set in the first dashboard prompt this will not work, you'll get COLUMN is equal to pres_var. When you are using DASHBOARD URL you need to pass presentation variable to the filter of the target (dashboard page prompt). If the target page prompt does't exist the parameter is parsed to the filter of all reports (or just one) that has this COLUMN set to is prompted.
    2. Go to the report 2 and set level 1 is prompted.
    3. Go to the report 1 and write dashboard url correctly with passing presentation variable like:
    '<--a href=http://.../saw.dll?Dashboard&PortalPath=/shared/.../_portal/Yourdashboard/&Page=Yourdashboardpage
    &Action=Navigate&col1=TABLE.COLUMN&val1='||REPLACE(REPLACE('@{pres_var}', ' ', '+'), '+', '%2B')||'>Link
    <--/a>'
    TABLE.COLUMN is a target column to which you want to pass parameter (presentation variable), it can be on the prompt or just set to is prompted in the report 2.
    But if you want to pass presentation variable to the filter of the dashboard page 2 prompt which is level 2 this could be a problem (if you are using SQL result option in the dashboard prompt in the second page to show level 2 and want to filter it by pres_var that you set in the first page prompt with level 1 this is not possible, because you can only pass parameter to the page prompt field, but you can set dummy hidden prompt in the second page and pass level 1 to it and then set new presentation variable that is available only for the second page and then use this presentation variable as the filter in the second page prompt for level 2 in the filter to show only level 2 values for the level 1 value, this method is explained in the link below).
    Try to fix it now.
    You may want to read this:
    http://108obiee.blogspot.com/search/label/DASHBOARD%20URL
    Regards
    Goran
    http://108obiee.blogspot.com
    Edited by: Goran O on 2009.11.29 10:23

  • Formula on presentation variable name

    Is possible to get this?
    I would like to create a presentation variable depends on a formula...like: @{'pv_'||'CASE WHEN SUBSTRING....'}
    Is possible to do this?
    Thanks!

    Hi,
    While passing the presentation variable from prompt you need to pass only with the presentaation variable name.
    You can create an intermediate report with getting the presentation variable and case statement and then pass this to the main report column(filter based on another request)
    Hope this helped/ answered
    Regards
    MuRam

Maybe you are looking for

  • Apple Mini DVI to S-Video Adapter

    i was planning to buy a new Apple Mini DVI to S_Video Adapter can some one tell me if I need an extra audio cable for sound or if s video can do this thanks for your help

  • ODI ERROR: While Executing the interface

    Hi I have a scenario to send the table data to the excel file.configurations and able to importing the tables using RKM for source and target is successful done. after executing the interface i am getting the below error's Can some one please help me

  • Why is the 256 Color Option 'ghosted' in Leopard?

    I've recently 'upgraded' my Mac Pro to Leopard and in the process have killed a major piece of cross platform software that I use in my work. Apparently, Leopard has disabled 256 color compatibility, while simultaneously leaving the option as ghosted

  • Payment proposal program

    Hi sapgurus, Could you please tell me where do we assign the payment proposal program to a particular payment method. As suppose for international transfer the payment proposal program is F110_D_Z1_01. And I want to change it to F110_D_UEBERWEIS. Ple

  • Usage of cursor in sql select stmt

    HI how can i use cursor in SELECT statement for fetching the multiple records at a time. thanx.