OBIEE-Presentation Variable in SQL expression in a Column Filter

Hi,
I have the following:
(1) A dashboard prompt having Month names like eg. October,July etc
(2) I have declared a Presentation Variable by name @{Month}
(3) A report is there where i have a column called 'Scenario' which has values like 'Actual','Budget','LE_Jul','LE_Oct' etc
(4) In 'Scenario' column , i have given in the column filter-->SQL Expression as below:
('LE_'||SUBSTRING(CAST('@{month}{July}'AS CHAR(40))FROM 3))
My end result should be like whatever month name(ex. July) is selected in the Dashboard Prompt, my scenario should be equal to 'LE_Jul'.
I am getting Error like :
State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 43113] Message returned from OBIS. [nQSError: 43119] Query Failed: [nQSError: 16001] ODBC error state: 37000 code: 8180 message: [Microsoft][ODBC SQL Server Driver][SQL Server]Statement(s) could not be prepared.. [nQSError: 16001] ODBC error state: S0002 code: 208 message: [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name 'DIM_SCENARIO'.. [nQSError: 16002] Cannot obtain number of columns for the query result. (HY000)
Pls give ur inputs if anyone has faced such an issue.
Thanks.

Hi,
I checked that box in Connection Pool Settings.
But now , though i have data for Scenario "LE_Jul", i still get No Results.
Kindly let me know what else i am missing out in this regard.
Thanks.

Similar Messages

  • 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

  • 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

  • How to make use of the presentation variable in SQL result query

    I have 2 prompts in my dashboard.
    Prompt1 decides the values of Prompt2.
    I have set a presentation Variable (selected_comp) in prompt1 which holds the value selected.
    To populate the values for Prompt2, I need to execute a query using the presenation variable set by Prompt1.
    SELECT "List Of Values".RID from rocketv2_3 WHERE "List Of Values".NAME='COMPONENT' AND "List Of Values".VAL=@{selected_comp}
    the query is resulting into
    SQL Issued: SELECT "List Of Values".RID from rocketv2_3 WHERE "List Of Values".NAME='COMPONENT' AND "List Of Values".VAL=0
    but the value in selected_comp is "ABC".
    Can anybody help in how to make use of the presentation variable in query to get the correct value
    thanks
    Shubha

    Just use constrain check box to filter your 2nd prompt values based on the 1st prompt.
    Thanks,
    Venkat
    http://oraclebizint.wordpress.com

  • Error using Filter with SQL Expression

    Hey all -
    New to Oracle BI, and getting a problem with Filters that use SQL Expressions.
    The column I'm filtering on is a 4 digit year, expressed as a VARCHAR2(4 byte) in the physical database. My SQL Expression in the filter is:
    Column: CAL YEAR 4 DIGIT
    Operator: Is equal to/in
    SQL Expression: TO_CHAR(ADD_MONTHS(SYSDATE, -24), 'YYYY'))
    when I click on the "Results" Tab I get the following error message:
    Error Codes: YQCO4T56:OPR4ONWY:U9IM8TAC:OI2DL65P
    Odbc driver returned an error (SQLExecDirectW).
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 27002] Near <(>: Syntax error [nQSError: 26012] . (HY000)
    I've isolated the issue to the expression above. If I put in a literal value and supply a four digit year like below it works:
    Column: CAL YEAR 4 DIGIT
    Operator: Is equal to/in
    SQL Expression: *2008*
    Any ideas on what's causing my problem?
    Thanks!
    Mac

    macearl wrote:
    SQL View does not display unless data is returned by the query. Is that normal?
    Also, none of these options shows the literal result of the expression we built, i.e.:
    expression: CAST(YEAR(TIMESTAMPADD(SQL_TSI_MONTH, -24, CURRENT_DATE)) as CHAR)
    result: *2008*
    Having the ability to test expressions and see their results would be very helpful in debugging. If anyone knows how to do that please share!
    Thanks!
    MacOk, Probably shoud have figured this out before, but in response to my own question, the way to view the result of an expression is to add the expression as a column and include it in the Table Presentation.
    - Mac (he can be taught)

  • Re:presentation variable

    hi,
    i am using below case function to dynamically change the filter depending on other column in the sql filter.Both pv1 and pv2 are presentation variables having multiple values in it.
    CASE when "Region"='USA' THEN
    customer in (@{pv1})
    ELSE
    customer in (@{pv2})
    END
    Values are being populated in the presentation variables.But i get error saying "syntax error near <in>".Is there any way that i can do this without using "in" and "=" .how can i say that customer values should be equal to values in presentation variables in sql filter.
    thanks

    872296 wrote:
    hi,
    i am using below case function to dynamically change the filter depending on other column in the sql filter.Both pv1 and pv2 are presentation variables having multiple values in it.
    CASE when "Region"='USA' THEN
    customer in (@{pv1})
    ELSE
    customer in (@{pv2})
    END
    Values are being populated in the presentation variables.But i get error saying "syntax error near <in>".Is there any way that i can do this without using "in" and "=" .how can i say that customer values should be equal to values in presentation variables in sql filter.
    thanksBased on your CASE statement that you say you are using for a filter, I am confused. You say you want one set of customers to filter your report when Region = 'USA' and another set of customers for all other regions. Is Region another filter selection? It would have to be unless I'm missing something. So why don't you design your report like this?
    1) Create two reports with the same columns.
    2) On one report, hard-code a filter on Region = 'USA' and on the other report, hard-code a filter on Region <> 'USA'
    3) Put a column prompt, multi-select on the customer column.
    4) On the Dashboard, put 2 links, one called "USA Customers" and the other "All other Customers."
    5) Make the first link go to the "USA" report and the other link go to the "Other than USA" Report.
    Here are the advantages: 1) Less real estate is taken up on your dashboard. 2) One prompt to select from, not 2. 3) Simple desgin of reports; therefore, simple maintenance.

  • Reference in SQL Expression to a group key

    Hello to everybody, i am working with a report in Crystal Report 11 and i need some help.
    In the design of my report i have two groups corresponding to a table which has two keys. The first one belongs to an Id and the second to a datetime.
    The fact is that i have to filter second group with a specific date that i have to obtain with a sql query. So i was thinking in using SQL Expression but i cant make it the right way because i cant filter in the where condition with the id of the superior group. I dont know how to write the where condition.
    If anyone can help me i will be grateful.
    Thanks.

    Thank you Sastry for responding so quickly.
    I think you dont understand me. I have this:
    -Group 1: id
             -Grupo 2: datetime
    the field datetime i need to filter with a specific date. In order to be clear the SQL Expression i made to filter this datetime is:
    (select max(datetime) from Table1)
    That maximum datetime i need it be for each id in the Group 1 (so the sql expression is not a single value, its a single value for each id of Group1), but i can't put this in the sql expression:
    (select max(datetime) from Table1 where Table1.id = Group1.id)
    and then the other problem is how to filter the datetime in group 2 with the value of the SQL Expression
    PD: Where is the option add command in crystal report?

  • Hide entire column based on presentation variable?

    Has anyone ever tried to do this? If user selects all records from prompt i want to display analysts assigned to those records. If user selects specific analyst i don't want to display analyst column. I know i can null out or show analyst based on presentation variable but what about hide entire column?
    If this is not possible has anyone tried to use conditional formatting to hide entire column?

    Try this:
    0) Create a dashboard prompt on "analysts" and check the "All Choices" checkbox. Set the prompt to a presentation variable.
    1) Create a small report with two columns, one column will be your analyst column, the other will be a column which houses MAX(RCOUNT(1)) in the Edit Column formula window (what you get when you press the fx button). Put another filter on the analyst column set to the presentation variable with one of the analysts as the default.
    2) Put a filter on the the MAX(RCOUNT(1)) column "greater than 1"
    3) Create two copies of your actual report, one which has the analyst column, one without.
    4) Now in your dashboard you will need three sections, one for your prompt, one for the "with column" report and one for the "without column" report.
    5) In the Section Properties of the "with column" report, click on "Guided Navigation" and navigate to the small report you created in step one. Set this section to display "if request returns rows." Don't forget the filter on this report set to the presentation variable.
    6) In the Section Properties of the "without column" report, click on "Guided Navigation" and navigate to the small report you created in step one. Set this section to display "if request returns nothing." This report will not need a filter on the analyst prompt, because by definition it will display all analysts.
    Now when "all choices" is selected on the prompt, the second report displays in the dashboard, and when a single analyst is selected, then the first report will display with the analyst column.

  • Resetting presentation variable set by prompt

    Say I have 2 prompts, State and City, driven by a single go button. The State prompt sets a presentation variable called STATE_VAR and the City column prompt filters its choice list values based on the STATE_VAR and sets its own presentation variable CITY_VAR when the user selects a choice from the list. Both prompts have defaults - the STATE_VAR prompt defaults to a specific state on initial page load and the CITY_VAR defaults to nothing (None option in the prompt dialogue).
    This issue I want to solve is resetting the CITY_VAR presentation variable to nothing (as per the default None option in the prompt dialogue) when the user selects a different state in the State prompt. The sequence I want to achieve is listed below.
    1) On page load STATE_VAR and State prompt choice are set to Michigan and both the CITY_VAR and City prompt are set to nothing (blank option)
    2) User selects Detroit as one of the cities in the City prompt and clicks the GO button.
    3) On page load, the STATE_VAR presentation variable and corresponding State prompt are set to Michigan, but now the CITY_VAR and City prompt are now set to Detroit
    4) User selects a different option in the State prompt, say Nebraska, and clicks on the GO button
    5) On page load, the STATE_VAR presentation variable and corresponding State prompt are now set to Nebraska, however, the default selected option in the City prompt and corresponding CITY_VAR presentation variable are still Detroit though the choice list now contains different values.
    Is there anyway to reset both the CITY_VAR and City prompt to the default nothing (None) selected state, essentially resetting the presentation variable?
    Thanks.

    i am afraid .. you wont be able to achieve this...
    The best thing that you can do is to check the constrain checkbox in the city prompt..
    Thanks
    Ashish

  • OBIEE 11g Prompt's default value doesn't work with a presentation variable

    Hi, I'm using OBIEE 11g and I have two dashboard prompts (Product Name and Product Number). Theses prompts are hierarquical, so the values that are displayed in the Product Number prompt have dependency with the values chosen on the Product Name prompt. This I was able to do, but now I want to put a default value on the Product Number prompt. The steps are:
    1 - The user chooses the value for the Product Name Prompt and by doing that the Product Number prompt is automatically filled with the correspondent value.
    But unfortunatelly this is not working, after choosing the value for the Product Name the default value for Product Number is not displayed (when you open the prompt the values displayed are correct and already filtered considering the Product Name but the prompt is not automatically filled with the default value).
    What I did is:
    On the Product Name Prompt I've created a Presentation Variable called PROD.
    On the Product Number Prompt I've selected:
    1 - For the "Choice List Values" field I've checked the option "Limit Values by All Prompts"
    2 - For the "Default Selection" field I've chosen the SQL Results option and enter the following SQL:
    SELECT "Products"."Product Number" FROM "Sample Sales Lite"."Products" WHERE "Products"."Product"='@{variables.PROD}
    What am I doing wrong?
    Thank you,
    Carla

    Sorry I was wrong in my previous thread.
    Actually your approach is not correct, Product Number choose constraint that will show as per the selection of Product Name.
    Coming to default value for Product Number you are going for sql override that is okay but not work with variable, instead of setting default values for product number set that to product name.
    if not you need to go for 2 different prompts
    Prompt 1 Product Name hit GO
    Prompt 2 will work based on as you defined earlier with variables
    Hope this helps

  • Presentation Variable in the SQL default section in the dashboard prompt

    Hi Gurus,
    I have two prompts and two go buttons. First Go button is used to populate pv_category1 presentation variable.
    category_column --> pv_category1--> 1st Prompt
    Product_Column --> pv_product2 --> 2nd Prompt
    I want to set the default for the 2nd Prompt depending on the 1st Prompt ( Category) chosen by the user.
    In the SQL default --> i have typed in the below Query.
    *Select TableName.Product_Column from Subject_Area where category_column = '@{pv_category1}'*
    The Problem is that i dont get any default value for 2nd Prompt after choosing the First prompt and hitting the GO Button.
    If i hardcode the value in @{pv_category1} ...
    for eg
    Select TableName.Product_Column from Subject_Area where category_column = 'Incidents' i get the corresponding value as default.
    But i want this 2nd prompt (product) to dyamically default depending on the 1st prompt (category) chosen by the user.
    I am using OBIEE 10.1.3.4 and i have googled a lot on this topic...
    can we not use Presentation variable in the SQL default section of the Dashboard Prompt?
    Any help in this regard would be highly appreciated.
    Thanks
    Ashish

    Thanks for the Quick Reply.
    But the functionality that i want to achieve is the default value in the 2nd column (out of many values for 2nd column) based on the 1st column chosen by the USER. for eg we have two columns in our database ie category and Product.. Data goes like this
    category ProductName
    Incidents --- A
    Incidents --- B
    Incidents --- C
    Changes --- D
    Changes --- E
    Projects --- M
    Projects --- N
    Projects --- O
    Projects --- P
    If the User chooses Incidents in the first prompt then the default in the 2nd prompt should be B ( out of A,B,C Values available in the 2nd prompt)....
    Checking the constraint checkbox doesnt solve the default problem...
    Thanks
    Ashish

  • Issue with SQL Query with Presentation Variable as Data Source in BI Publisher

    Hello All
    I have an issue with creating BIP report based on OBIEE reports which is done using direct SQL. There is this one report in OBIEE dashboard, which is written using direct SQL. To create the pixel perfect version of this report, I am creating BIP data model using SQL Query as data source. The physical query that is used to create OBIEE report has several presentation variables in its where clause.
    select TILE4,max(APPTS), 'Top Count' from
    SELECT c5 as division,nvl(DECODE (C2,0,0,(c1/c2)*100),0) AS APPTS,NTILE (4) OVER ( ORDER BY nvl(DECODE (C2,0,0,(c1/c2)*100),0))  AS TILE4,
    c4 as dept,c6 as month FROM 
    select sum(case  when T6736.TYPE = 'ATM' then T7608.COUNT end ) as c1,
         sum(case  when T6736.TYPE in ('Call Center', 'LSM') then T7608.CONFIRMED_COUNT end ) as c2,
         T802.NAME_LEVEL_6 as c3,
         T802.NAME_LEVEL_1 as c4,
         T6172.CALENDARMONTHNAMEANDYEAR as c5,
         T6172.CALENDARMONTHNUMBERINYEAR as c6,
         T802.DEPT_CODE as c7
    from
         DW_date_DIM T6736 /* z_dim_date */ ,
         DW_MONTH_DIM T6172 /* z_dim_month */ ,
         DW_GEOS_DIM T802 /* z_dim_dept_geo_hierarchy */ ,
         DW_Count_MONTH_AGG T7608 /* z_fact_Count_month_agg */
    where  ( T802.DEpt_CODE = T7608.DEPT_CODE and T802.NAME_LEVEL_1 =  '@{PV_D}{RSD}' 
    and T802.CALENDARMONTHNAMEANDYEAR = 'July 2013'
    and T6172.MONTH_KEY = T7608.MONTH_KEY and T6736.DATE_KEY = T7608.DATE_KEY
    and (T6172.CALENDARMONTHNUMBERINYEAR between substr('@{Month_Start}',0,6)  and substr('@{Month_END}',8,13))
    and (T6736.TYPE in ('Call Center', 'LSM')) )
    group by T802.DEPT_CODE, T802.NAME_LEVEL_6, T802.NAME_LEVEL_1, T6172.CALENDARMONTHNAMEANDYEAR, T6172.CALENDARMONTHNUMBERINYEAR
    order by c4, c3, c6, c7, c5
    ))where tile4=3 group by tile4
    When I try to view data after creating the data set, I get the following error:
    Failed to load XML
    XML Parsing Error: mismatched tag. Expected: . Location: http://172.20.17.142:9704/xmlpserver/servlet/xdo Line Number 2, Column 580:
    Now when I remove those Presention variables (@{PV1}, @{PV2}) in the query with some hard coded values, it is working fine.
    So I know it is the PV that's causing this error.
    How can I work around it?
    There is no way to create equivalent report without using the direct sql..
    Thanks in advance

    I have found a solution to this problem after some more investigation. PowerQuery does not support to use SQL statement as source for Teradata (possibly same for other sources as well). This is "by design" according to Microsoft. Hence the problem
    is not because different PowerQuery versions as mentioned above. When designing the query in PowerQuery in Excel make sure to use the interface/navigation to create the query/select tables and NOT a SQL statement. The SQL statement as source works fine on
    a client machine but not when scheduling it in Power BI in the cloud. I would like to see that the functionality within PowerQuery and Excel should be the same as in Power BI in the cloud. And at least when there is a difference it would be nice with documentation
    or more descriptive errors.
    //Jonas 

  • 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

  • Set filter (with presentation variables) for requests using "SQL Issued"

    if I have a "SQL issued":
    SELECT saw_0 saw_0, saw_1 saw_1, saw_2 saw_2, saw_3 saw_3, saw_4 saw_4 FROM (
    SELECT saw_0 saw_0, saw_1 saw_1, SUM(saw_2) saw_2, SUM(saw_3) saw_3, SUM(saw_4) saw_4
    FROM
    SELECT "Period"."YearMonth" saw_0, "Customer"."CustomerName" saw_1, COUNT("Sales"."SalesDate") saw_2, "Sales"."No.OfConsumer" saw_3, 0 saw_4
    FROM CRM
    WHERE ("Period"."YearMonth" >= 200904) AND ("Period"."YearMonth" <= 200910)
    UNION ALL
    SELECT "Period"."YearMonth" saw_0, "Customer"."CustomerName" saw_1, 0 saw_2, 0 saw_3, Count("SuperSales"."SuperSalesDate") saw_4
    FROM CRM
    WHERE ("Period"."YearMonth" >= 200904) AND ("Period"."YearMonth" <= 200910)
    ) t1
    GROUP BY saw_0, saw_1
    ORDER BY saw_0, saw_1
    ) t2 ORDER BY saw_0
    actually, in this request, I would like to set a filter for "Period"."YearMonth" using presentation variable.
    is it possible to do this ?
    Thanks !!

    Hi Forreging,
    You can use presentation variables, but not if you are directly setting the SQL via the Advanced tab.
    Instead, build up the first report just like the first part of the UNION statement. Then use the "Combine with Similar request" to build up the logic for the second part of the query.
    When you approach it this way, you have the ability to set filters on each "Sub-Request" via the Criteria tab. Otherwise, OBIEE only lets you add a filter at the outer level of the query when you go the route of setting the SQL in the Advanced tab.
    Good luck and if you find this post useful, please award points!
    Best regards,
    -Joe

  • How to pass the values to stored proc using presentation variable in OBIEE

    Need your help regarding in resolving an issue in OBIEE 10.1.3.4.1
    There are 6 reports say ‘A’,’B’,’C’,’D’,’E’,’F’ in the same subject area.
    The reports are being configured with prompts using either the repository/presentation variables.
    One of the reports say ‘A’ has been configured to pass the values using presentation variables from the prompt in Advanced Tab of the report request to the stored procedure defined in the Execute Before Query section of the connection pool.
    After running another report ‘B’ in the same subject area, upon visiting the report ‘A’ view display error is being seen ( Please have a look below screen shot for your reference) .
    Speculate the issue is around presentation variables of report ‘A’ getting initialized even before running the report.
    Appreciate your earliest advise as this is a prod issue.

    Hi Prasad,
    I got your note, you should not use Session variable syntax to call presentation variable.
    you should use like @{AIC_PROJ_PLAT_SEQ_NO}
    One more thing: first test the variable AIC_PROJ_PLAT_SEQ_NO value then try to pass to SP.
    Hope this helps

Maybe you are looking for

  • Can you use AirPrint to print to hard wired printer via your WiFi network?

    Recently I bought an Officejet 6700 Premium e-All-in-One to serve all my PCs in the house and to use the AirPrint functionality for all the iPhones & iPads. The printer is located in the basement office where there is poor wireless reception, and the

  • MacBook doesn't eject a disk

    How do I get my MacBook to eject a disk? I already did Command e. Under File the eject is gray.Ideas?

  • Added Record not in tablepage

    Hi (JHeadstart 9.0.4, Struts/JSP/Toplink) We have a tablepage with one empty row. We enter the details of a new record in the empty row and save. The transaction is completed successfully, the record is created in the database. However, the tablepage

  • Playlist for Apple TV

    Can you create a playlist for videos with a loop or random play? Mac Book Pro   Mac OS X (10.4.9)  

  • Domain Guessing not working

    I am having a problem with Domain Guessing working in Camino and Safari. In Camino I have checked about:config but everything shows OK. I am using Embarq DSL and everything was OK up till about 2 weeks ago. Any help is greatly appreciated. Nick