Using a Sql Result in Default Value of Dashboard Prompt

Hi,
I Create a Dashboard Prompt, this have two dates, the initial and the last for a period to filter. I need to set the default value in the fist and last date of the previous month, for example, if today is 20th of november the default value of initial date has been 1th of October and the last date has been 31th of october.
I used in default the option 'SQL Results' and use the next sentences:
SELECT TRUNC(add_months(sysdate, -1), 'MM') FROM dual;
SELECT TRUNC(last_day(add_months(sysdate, -1))) from dual;
But when I try to use the dashboard prompt the result is:
State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 27002] Near <(>: Syntax error [nQSError: 26012] . (HY000)
SQL Issued: SELECT TRUNC(add_months(sysdate,-1),'MM') FROM dual
When I try to use only select sysdate from dual; the result is:
State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 27004] Unresolved table: "dual". (HY000)
Thanks for your help.

Thanks for your help. Finally I solve this issue of
this form:
1. I Create a Initialization Block with the next
sentences:
SELECT TRUNC(add_months(sysdate, -1), 'MM')
INITIAL_DATE ,TRUNC(last_day(add_months(sysdate,
-1))) END_DATE, To_char(TRUNC(add_months(sysdate,
-1), 'MM'), 'YYYYMM') PERIOD FROM dual;
2. Then I Create three Repository Variables and
assign the Initialization Block to this
3. In the Dashboard Prompt I use the "Server
Variable" Option in the default and call the three
variables.
Thanks again
EdwinHi: How u access server variable with two fields of date. Actually, I am doing the same work. But I can not do this work. Because this is ok when the date is greater than or less than. When i use between, in default server variable button did not show any text area for reoository variable. I also made initailization block with 2 fields.
My Task is, I have to initialize the one date coloumn. From Date: and To Date. Pluzz help me in section
Ali Haroon Nawaz

Similar Messages

  • How to set the default value in dashboard prompt?

    Hi there,
    In my Dashboard prompt I'm getting values like:
    Mar 2010
    Apr 2010
    May 2010
    Jun 2010
    How to set the default value to the current month (Jun 2010). I don't want to use "specific value". I want to use the "SQL Result" for populating the default value.
    Appreciate your help

    hi,
    you can create a Repository variable current_month with the expression as
    select to_char(trunc(sysdate),'Mon')from dual
    and use this in the prompt "Default to" Server variable and use this repository variable.
    hope this helps.
    cheers,
    vineeth

  • Default value in dashboard prompt

    Hi,
    I have created 2 dashboard prompt one is projectnumber another one is date which is in 'MON-YYYY' format.
    My requirement is date prompt default value one month before a current month.
    Example if it is February 2012 it must displayed as JAN-2012
    Thanks in advance.

    Hi RR,
    Edit the Prompt.
    Under Default Selection select SQL Result and place the following query:
    SELECT concat(upper(CAST (MONTHname( TIMESTAMPADD(SQL_TSI_MONTH,-1, CURRENT_DATE)) AS CHAR(3))),concat('-',cast( YEAR( TIMESTAMPADD(SQL_TSI_MONTH,-1, CURRENT_DATE)) as char)))
    FROM "OBIA"
    Try this.. I think it will solve your issue.

  • Sorting a column does not result in distinct values on Dashboard prompts

    Hi,
    We have a period column, the records of which are 'JAN-02' , "FEB-02"...."DEC-09". We need sort this column in descending order in Dashboard Prompts. We have another column "Date", which has been used to sort the period column. To achieve this in descending order, we have converted Show Results from “All Values” to “SQL Results” in dashboard prmpts, then entered the below sql.
    SELECT "CODE COMBINATIONS"."LINE AC PERIOD" FROM INVOICE_PAYMENTS
    order by "CODE COMBINATIONS"."LINE AC DATE" desc
    The above sql resulted in non-distinct values as below. Using distinct in the above sql throws syntax error.
    Period
    JAN-09
    JAN-09
    JAN-09
    FEB-09
    FEB-09
    How do we get distinct values and in descending order??
    Thanks and appreciate any ideas
    Surya

    Go to advanced tab and check "Use distinct clause" that will fire a distinct to the query.
    In the rpd month logical column , there is an option called sort order in the general properties and you need to specify the date column if you need to sort it based on the date column and in the Answers you can simply enable Descending sort order on the same column. That should take care of it
    Hope it helps
    Thanks
    Prash

  • Pl/sql expression for default value

    I'm trying to run this simple script as a default value using pl/sql expression, but I keep getting this error. THe select statement itself works fine as a sql statement source value, but will not work as a pl/sql exression as a default value. This (:P33_SYSUSERID_CREATED_BY ) is the field name on the form. Any ideas?
    begin
    select a.id || ', ' || A.NAME_LAST into :P33_SYSUSERID_CREATED_BY from S_USERSV a where a.name_last = 'HAMMAKER';
    end;
    Error ERR-9132 Error in PLSQL expression for item default code, item=P33_SYSUSERID_CREATED_BY
    OK
    ORA-06550: line 1, column 27: PLS-00103: Encountered the symbol "BEGIN" when expecting one of the following: ( - + case mod new not null avg count current exists max min prior sql stddev sum variance execute forall merge time timestamp interval date pipe

    Sudha,
    For a default value type of PL/SQL Expression, you could create a function that accepts an input and returns a value. If the function (not a procedure) is named GET_REFNO, you would call it using an expression in the default value field like:
    get_refno(:P3_REFTYPE)
    For a default value type of PL/SQL Function Body, you could call your existing procedure with a default value like:declare
        l_value varchar2(32767);
    begin
        get_refno(:P3_REFTYPE, l_value);
        return l_value;
    end;Scott

  • How to use one variable as a default value for another variable?

    Hi Experts,
    Is it possible to use one variable as a default value for another variable?
    For example:
    Variable 1 = current calendar year month
    Variable 2 = mandatory input ready variable for calendar year month
    I want to use variable 1 as default value for variable 2, but also have the ability to change the month if required.
    Thanks!
    Kathryn

    u can use replacement path variable
    in that case u can replace the values of 1 variable with the another variable...
    but  u cannot do this setting
    u cannot make variable 2 as mandatory
    u cannot enter value for variable 2
    because by default it will take the value of variable 1
    u have to make follow settings
    variable 2
    name , technical name
    processing by = replacement path
    infoobject = ocalmonth
    next tab
    replaced by another variable
    variable name
    offset start , offset lenght
    save and hit okey

  • How to pass current month as the default value in the prompt

    Hi,
    Could you please tell me how to pass the current month as the default value in the prompt.
    I have a report where month is a prompt. By Default it should ahve current month as the default value along with other months.
    Please let me know the syntax for the same.
    Thanks in advance!!
    Regards
    Sindhu

    Hi,
    what datasource do you have? Is it SAP BW or something else?

  • How to pass values to dashboard prompts from external applications

    Any idea is well appreciated.
    How can I pass values of dashboard prompts from external applications to the dashboard prompts so that the dashboard is prefiltered based on values sent by external applications.
    Thanks in Advance!
    Kris

    Kris,
    i am able to change the session variable and able to call the dashboard from external app, but i identified prompt value not changing. but Finally i am able to found a workaround for you.
    Use the following URL and it explained here
    http://localhost:9704/analytics/saw.dll?Dashboard&nquser=Administrator&nqpassword=Administrator&PortalPath=/shared/abcd/_portal/dash1&Options=rmf&DSN=madan
    PortalPath is your dashboard location. /shared/abcd is folder where i saved dashboards. dash1 is my dashboard name.
    internally this dashboard includes many reports that uses the session variable. after doing above this i am able to update the session variable to the value i have given in URL, DSN=value.
    You may observer here that calls the dashboard and passes the value but its not updating the prompt value. so workaround for this is edit your prompt,
    change the Default to - SQL Results and place the sql
    SELECT CASE WHEN 1=0 THEN Markets.Region ELSE VALUEOF(NQ_SESSION.DSN) END saw_0 FROM Paint
    again here Market.Region is column from presentation layer and Paint is subject area. After doing this step, your prompt always shows value in the session varible as default.
    Now include reports and dashboard prompt in the dashboard and run this url from external applicaitons.
    http://localhost:9704/analytics/saw.dll?Dashboard&nquser=Administrator&nqpassword=Administrator&PortalPath=/shared/abcd/_portal/dash1&Options=rmf&DSN=madan
    it worked for me and blog this soon. if it works for you mark the question as answered and mark my replies as correct.
    thanks
    - Madan

  • Passing Values to Dashboard Prompt

    Hi Gurus,
    I have a summary Dashboard page with summary report and prompt build on Summary table , and i have a detail dashboard page contains Detail report and prompt same as Summary but these prompts are from Dimension tables and report from fact and Dimension.
    The requirement is Once i click some value in Summary dashboard it has to pass the values to Detail dashboard ( Means Passing the values to Dashboard prompt) and show the result in detail.
    As i cant use the OBIEE navigation logic to pass the values as prompts columns are not from same table. So i thought to use the GO URL this also i cant use as i am using Pivot table in Summary report. I thought to use Summary prompt in the detail Dashboard and create a dummy reports based on the prompt and resultant value pass to the Detail reports. I am able get the values but i am not getting proper answer. I dont no why .
    Is i am doing correct ? i know its not elegant way. If some one give me tip or direction that will be great help.
    Thanks in advance.
    Regards
    Ali

    If you are attempting to pass a value from one table1.column1 to another table2.column2 where the two do not match then you will need to use a presentation variable to hold the value. You can populate the variable using a hidden dashboard prompt that has the table1.table2 and read the value into a variable. You can then use this variable to filter the table2.column2

  • How to Get Default Dates in Dashboard Prompts

    i just want to select two dates by default on the Dashboard prompts.
    Those two dates would be last day of the last quarter and last day of this quarter.
    Any body please give me the select statement to pick those two dates(last day of last quarter and last day of current quarter)by default on the dashboard prompts?
    Thanks in Advance

    If you just want it once, then in the dashboard prompt "Default to" window, select "SQL Results" and enter this:
    SELECT CASE WHEN 1=0 THEN table.column ELSE TIMESTAMPADD(SQL_TSI_QUARTER,0, TIMESTAMPADD(SQL_TSI_DAY, DAYOFMONTH(CURRENT_DATE)*-1,CURRENT_DATE)) END FROM "subject area"
    UNION
    SELECT CASE WHEN 1=0 THEN table.column ELSE TIMESTAMPADD(SQL_TSI_QUARTER,1,TIMESTAMPADD(SQL_TSI_DAY, DAYOFMONTH(CURRENT_DATE)*-1,CURRENT_DATE)) END FROM "subject area" This will give as the default, the last day of the last quarter and the last day of the current quarter in your multi-select prompt.
    Edited by: David_T on Apr 26, 2011 12:12 PM

  • Constraining Values in Dashboard Prompts

    Hi,
    I have a question about constraining values in dashboard prompts. Do all fields need to come from the same table as I am finding constraining values is not working where I am selecting some values from different tables:
    For example
    Start Date - Fact Table
    End Date - Fact Table
    Salesperson - Org Dim
    Market - Org Dim
    Introducer - Org Dim
    Customer - Org Dim
    I am trying to constrain values beginning from Salesperson and so on but this does not work.
    Is this the expected behaviour? should all values be retrieved from the same table in order for this to work?
    Thanks

    Hi,
    Below is the filter I am applying in the report:
    "Agreement Fact"."Prop Creation Date" >= Evaluate('to_date(%1,%2)','@{startdate}','YYYY-MM-DD HH24:MI:SS')
    and "Agreement Fact"."Prop Creation Date2" <= Evaluate('to_date(%1,%2)','@{enddate}','YYYY-MM-DD HH24:MI:SS')
    and Organisation.Market = '@{market}'
    and Organisation."Sales Person Name" = '@{salesperson}'
    and Organisation."Introducer Name" = '@{introducer}'
    and Organisation."Customer Name" = '@{customer}'
    I have selected constrain in the report from salesperson onwards but instead when I run the dashboard report the values beginning with salesperson do not show.
    I definitely know that data exists for the date parameters(startdate and enddate) and market parameter. I have run a report in answers using the same parameters as in dashboard and do see data.
    Can anyone help?
    Thanks
    Edited by: sliderrules on 14-Mar-2011 05:57

  • Default width for dashboard prompts

    Hi:
    Does anyone know how to set the default width for dashboard prompts? Is there an XML file that contains this value?
    Thanks.

    During creation of prompts you can set additional format just check available icon on that layout. If it is 10g just look at above the heading 'Dashboard Prompt'.
    Pls mark correct/helpful if helps

  • 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

  • Using a Table as a Default Value in a Custom List

    Hi,
    I am trying to create a list for users to fill out that utilizes multiple tables for data entry. I would like to set the table to be the default value for the field in order to have consistency across submissions and for ease of use. I have tried using HTML
    code for the table as well as copying the HTML markup from inserted tables in the field but I have been unable to generate a table in the field by default. I have tried this in both the web based editor and Sharepoint Designer 2010.
    Thanks!

    Hi aelawler,
    Which type field did you use for storing the table? Please try to create a site column using Publishing HTML type or Enhanced rich text, and add the column to the list, use it to store the table. Test it using your method, compare the result.
    Here is a post about setting default value for enhanced rich text, please pay attention to Amit's reply:
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/a6b5614d-ae45-4e2f-af0e-7e1887b05f60/set-default-value-to-enhanced-rich-text-box?forum=sharepointcustomizationprevious
    If it doesn’t work, I think, you need to create a custom field type to store the table, and set default value for it. You can try to create it based on the Publishing HTML or Enhanced rich text type.
    Create a custom field type in SharePoint 2010
    http://www.bing.com/videos/watch/video/creating-custom-field-types-for-sharepoint-2010/10t33r1uw
    I hope this helps.
    Thanks,
    Wendy
    Wendy Li
    TechNet Community Support

  • Filter report based sql result by default and then after by choice in promp

    Hi Every one,
    I got scenario where a report in my dashboard should show the values for previous month by default when a user opens it.
    After that he can select the month of his choice through prompts.
    But initiallly how can i set the report show the values of previous month.
    I am using the sql SELECT to_char(add_months(to_date(sysdate),-1),'MON-RR') FROM DUAL;
    But idont know how to use this and where to set it.
    And one main thing is we should not use any repository variables. we can use presentation variables.
    Anyone help me how to solve this issue.

    One way
    change
    and ACTIVITY_DATE between :P95_START_DATE and :P95_END_DATEto
    AND ACTIVITY_DATE between NVL(:P95_START_DATE,ACTIVITY_DATE) and NVL(:P95_END_DATE,ACTIVITY_DATE)

Maybe you are looking for