Using a report value for a where clause in other report

Hi All,
i'm getting kinda nuts here. I created a page with three reports.
First report show the name of the user who logged in with his/her whole name. Second report shows the year, week, begin/end date of the week for the user in the first report. The third report show the hours the user worked in the week selected in the second report.
The link between first and second report is on column report. Somehow i managed it to work with second_report.mdw_code = :P3_ACRONIEM. I have no idea were this P3_ACRONIEM item is coming from, while i have no items in my page whatsoever. Now i need to link the second report to the third report. I have to use the second_report.mdw_code, second_report.year and second_report.week but i have no idea how to link these together. Any idea's? (Like making items, but then i have no idea how to link that item to the value in the second report). Please help.
Kind regards,
Dave
The link between the first and the second i could get it to work with :P3_ACRONIEM. I have no idea where this ITEM is coming from, because i have no items in my page (and it's the only page in the application). Then

Hi Dave,
If I understand you correctly, you have a one report that lists users, a second report that lists dates and a final report that shows hours worked?
If so, you may find it easiest to have hidden fields on your page and base the second and third reports on these using appropriate WHERE clauses. (I generally put hidden fields in a region in the "After Header" position)
So, if the first report contains a USER_ID field, have a hidden field called P1_USER_ID. The link on the first report will branch back to the same page and set the value of P1_USER_ID to #USER_ID# The second report can then use WHERE USER_ID = :P1_USER_ID. When the page reloads, the second report redisplays and is filtered to show only those records relating to the selected USER_ID in the first report.
To extend this, if the second report contains WEEK_NUMBER, it should have a link that branches back to the same page and sets a hidden P1_WEEK_NUMBER field with #WEEK_NUMBER#. The third report should when have WHERE WEEK_NUMBER = :P1_WEEK_NUMBER AND USER_ID = :P1_USER_ID. You can, if need be, have and set more than one hidden field during each link.
Regards
Andy

Similar Messages

  • Selecting values for query where clause

    hi guys, this is possibly a silly question but not sure if i am approaching the solution in the correct mannor.
    At the top of my form i have text box which the user fills in various values. These values are then used to refine the query results in the block below. I know i can go into the datablock being queried and set the where clause to equal the value of the text boxes above but i dont feel this is the right place to do it.
    If i do it that way when the text box above is blank it returns no reults when infact i want to query everything if the values are left blank. So should i put it in pre query? if so what way should it be done?
    Any help would be greatly appreciated.
    Thanks.

    Hello,
    If i do it that way when the text box above is blank it returns no reults when infact i want to query everything if the values are left blank. So should i put it in pre query? if so what way should it be done?Not really if you use like below in block's where clause...
    db_field_name1=NVL(:form_field_name1,db_field_name1) AND
    db_field_name2=NVL(:form_field_name2,db_field_name2)-Ammad

  • UPDATE using a second table for the Where Clause

    Hi There,
    Hoep someone can help me!
    I am attempting to update a field in Tbl.1 to a known value. However, i want to use another table to specify WHICH records to update.
    in this case i want to use table early_provider to obtain the value 'HCR' then pass that to the UPDATE clause in order to SET early_provisions.type_name = 'HOMC'
    I hope this makes sense.
    UPDATE EARLY_PROVISIONS eps
    SET TYPE_NAME = (SELECT *
    FROM EARLY_PROVIDER ep
    WHERE PROVIDER_TYPE = 'HCR'
    WHERE EP.PROVIDER_ID = EPS.PROVIDER_ID);
    I need to be able to include the field value 'HOMC in this statement but am not sure how, or if i am barking up the wrong tree.
    Much appreciated in advance
    PFG

    PFGMcAvoy wrote:
    Karthick_Arp
    Thanks. this seems to only update 15 rows of which already exist in the table early_provisions and filed type_name!
    I should be selecting about 200 recordsd from early_provider that have the provider_type = 'HCR'
    ??I don't know your data. So i cant answer that. But for what you asked i think thats the correct UPDATE statement. So i think you have to investigate your data to find what is going on.

  • Parsing an input parameter for the where clause or record select value

    In my limited CR experience, I've always used a command database connection so that I can write my own SQL.  However, now I have to parse a  pipe delimited parameter to get my value for the where clause, so I'm selecting several tables and joining them through the Database Expert Links tab.  All works fine, but after doing that and then parsing the parameter with the below formula in the Select Expert, I notice that there is no where clause in the SQL query, and although the report eventually displays the proper values, it runs through thousands of records first.  Here is my Select Expert - Record formula:
    StringVar array Parm1;
    Parm1 := Split({?DATA_AREA}, "|");
    {SO_ORDERS.CASE_ID} = Parm1[2]
    If I change "Parm1[2]" on the last line to a valid Case ID, then there is a where clause in the SQL and the report generates immediately. 
    It seems like the record select formula is applied AFTER all of the records (without a where clause) are searched when I use the parsed parameter value, but when I hard code a valid value, it places that into the where clause BEFORE the sql is executed.  Is there a way to get the parameter parsed first and then use that parsed value in the SQL where clause?
    Thanks.
    Bill

    Yes crystal will run the query first to get 100% data and then applies record selection condition. To increase the performance you need to pass the where condition at the command level instead of report level. So you need to create a report using add command like this
    select * from tablename where field={?Parameter}
    {?Parameter} is a command level parameter.
    Now insert this report as a subreport in another report which has no connection but has a parameter
    {?DATA_AREA} and create a formula like this in the main report
    Split({?DATA_AREA}, "|")[2]
    Now right click on the subreport and go to change subreport links and add this formula from main report and link this to sub report parameter {?Parameter} without linking any database field from the subreport.
    Now your subreport runs with the where clause to get the data.
    Regards,
    Raghavendra

  • Report name for services where used in task lists

    plz let me know report name for services  where used in task lists.

    Hello Sairam,
    I am abit confused. Are you looking for report to find where the task list is used ? You can find all the available reports in The menu path Logistics -> Production -> Master Data -> Routings -> Reporting.
    If you want a specific one then please provide more details
    Thanks
    Amber

  • Select multiple value in a where clause

    hello,
    im using developer 2000.
    suppose I have several values in a data grid. I want to use all of them in a where clause using IN operator or something. anybody knows how to do that. what I do is always insert all values in the grid into a temporary table and use that table in the where clause. is there any other easy, effective way of doing that?
    select *
    from table1
    where category in (-- I want to select multiple values form a data grid here--)
    thanks in advance.
    bonny.

    Hello Bonny,
    You might consider the use of PL/SQL Collection Types
    The first step in the process is to create a type and a table of that type.
    CREATE OR REPLACE TYPE DateType IS OBJECT ( Arg1 DATE );
    CREATE OR REPLACE TYPE TableList IS TABLE OF DateType;
    DECLARE
    list1 tablelist;
    BEGIN
    SELECT datetype (arg1)
    BULK COLLECT INTO list1
    FROM table1;
    FOR c1 IN (SELECT arg1
    FROM TABLE (CAST (list1 AS tablelist)))
    LOOP
    ---- Your code -----;
    END LOOP;
    END;
    For further insight please refer: http://download.oracle.com/docs/cd/B10501_01/appdev.920/a96624/05_colls.htm
    Regards.

  • Using a Dimension/ Measure in a Where clause of Another Dimension/ Measure in IDT

    Hi All
    I am building a Universe using Information Design Tool. In the Business Layer, I need to use a created Business Layer Dimension (not Tables) in a Where clause of another dimension as follow:
    Dimension: "Current Week No"
         SELECT
              budgets.dbo.Calenderweeks.WeekNo
         WHERE
              budgets.dbo.Calenderweeks.EndDate = convert(SMALLDATETIME, fn CURDATE()})  
    Dimension: "Last Week No"
         SELECT
              budgets.dbo.Calenderweeks.WeekNo
         WHERE
              budget.dbo.Calenderweeks  .WeekNo = @Select(Dimension\Current Week No) - 1
    The first dimension is working well. However, the "Last Week No" shows NOTHING (I do not get any value)
    Anyone can explain why I am not get any value from the second dimension, and how I can use a Dimension/ Measure in a Where clause of another Dimension/ Measure ?
    Thanks

    Short answer:
    Beware of object WHERE clauses. They are rarely (I'd almost say never) the solution to the problem you're trying to solve.
    Long answer:
    It doesn't work because you are inadvertently filtering the same value twice in two incompatible ways in the same SQL statement.  Both objects SELECT the same column in the database.  The first object uses a WHERE clause to set it to the current week.  The second object attempts to use a WHERE clause to set it to the previous week, but does so by selecting the first object, so you end up with both objects in your data provider.
    Remember that BO is going to place all the objects in your data provider in the same SQL (except of course where your context definition has ensured otherwise.), so you have two WHERE clauses in your generated SQL which attempt to find a line equal both the current week and the previous week... and returns, naturally, no results.
    Rewrite it with a derived table (as explained in the response above) and you'll get what you want.

  • Replace Where Clause in a Report?

    Is there any way to programmatically replace the Where clause on a report?

    Hi,
    You can use QBE reports. This way you can give the where clause in the customization form.
    Thanks,
    Sharmila

  • How to make a subscription use the default value for a parameter

    Hi everyone,
    I need to use the CreateSubscription method and have this new subscription use a default value for certain parameter. How can I do this?

    Hi Marianne,
    I have to create the subscription programatically, which is different from what you mention. To further clarify my challenge:
    I have three parameters in a report: date-interval (string), start-date (date), end-date (date). If the user selects for example "last week" as the date-interval, the DEFAULT values for the other two are as follows:
    Code Snippet
    start-date=DateSerial(Year(Today),Month(Today),Day(Today)-Weekday(Today)-6)
    end-date=DateSerial(Year(Today),Month(Today),Day(Today)-Weekday(Today)-1)
    The user can then select intervals like "today", "yestarday", "this month" etc, and the other two parameters are calculated based on that date-interval parameter. Now, If I programatically create a subscription to a report that contains these three parameters and set a value of "last week" for the date-interval parameter, the subscription stores the fixed days (say september 10 to september 16) producing a report of the same week every time the subscription is run and not updating the correct interval to LAST-WEEK!. What should I put as the value for start-date and end-date when I create the subscription to have these two params get the DEFAULT calculated value based on the third param date-interval?
    Hope to have been more clear now.

  • Using multiple values in a where clause, for values only known at runtime

    Dear all
    I am creating a PL/SQL program which returns multiple rows of data but only where it meets a set id values that a user has previously chosen. The id values are stored in an associative array and are chosen by a user in the preceding procedure at run time.
    I know all the table and column names in advance. The only things I don't know are the exact number of ids selected from the id column and what their values will be. This will only be known at runtime. When the procedure is run by the user it prints multiple rows of data to a web browser.
    I have been reading the following posting, which I understand to a large extent, Query for multiple value search But I cannot seem to figure out how I would apply it to my work as I am dealing with multiple rows and a cursor.
    The code as I have currently written it is wrong because I get an error not found message in my web browser. I think the var_user_chosen_map_list_ids in the for cursor loop could be the problem. I am using the variable_user_chosen_map_list_ids to store all the id values from my associatative array as a string. Which I modified from the code that vidyadhars posted in the other thread.
    Should I be creating a OPEN FOR ref cursor and if so where would I put my associative array into it? At the moment I take the value, turning it into a string and IN part in the WHERE clause holds the string, allowing the WHERE clause to read all the values from it. I would expect the where clause to read everything in the string as 1 complete string of VARCHAR2 data but this would not be the case if this part of the code at least was correct. The code is as follows:
    --Global variable section contains:
    var_user_chosen_map_list_ids VARCHAR2(32767);
    PROCEDURE PROCMAPSEARCH (par_user_chosen_map_list_ids PKG_ARR_MAPS.ARR_MAP_LIST)
    IS
    CURSOR cur_map_search (par_user_chosen_map_list_ids IN NUMBER)
    IS
    SELECT MI.map_date
           MT.map_title,
    FROM map_info MI,
         map_title MT,
    WHERE MI.map_title_id = MT.map_title_id
    AND MI.map_publication_id IN
    (var_user_chosen_map_list_ids);
    var_map_list_to_compare VARCHAR2(32767) := '';
    var_exe_imm_map VARCHAR2(32767);
    BEGIN
    FOR rec_user_chosen_map_list_ids IN 1 .. par_user_chosen_map_list_ids.count
    LOOP
       var_user_chosen_map_list_ids := var_user_chosen_map_list_ids ||
       '''' ||
       par_user_chosen_map_list_ids(rec_user_chosen_map_list_ids) ||
    END LOOP;
    var_user_chosen_map_list_ids := substr(var_user_chosen_map_list_ids,
                                            1,
                                            length(var_user_chosen_map_list_ids)-1);
    var_exe_imm_map := 'FOR rec_search_entered_details IN cur_map_search
    LOOP
    htp.print('Map date: ' || cur_map_search.map_date || ' Map title: ' || cur_map_search.map_title)
    END LOOP;';
    END PROCMAPSEARCH;EXECUTE IMMEDIATE var_exe_imm_map;
    I would be grateful of any comments or advice.
    Kind regards
    Tim

    I would like to thank everyone for their kind help.
    I have now successfully converted my code for use with dynamic SQL. Part of my problem was getting the concept confused a little, especially as I could get everything work in a static cursor, including variables, as long as they did not contain multiple values. I have learnt that dynamic sql runs the complete select statement at runtime. However even with this I was getting concepts confused. For example I was including variables and the terminator; inside my select string, where as these should be outside it. For example the following is wrong:
         TABLE (sys.dbms_debug_vc2coll(par_user_chosen_map_list_ids))....
    AND MI.map_publication_id = column_value;';Where as the following is correct:
         TABLE (sys.dbms_debug_vc2coll('||par_user_chosen_map_list_ids||'))....
    AND MI.map_publication_id = column_value';PL/SQL is inserting the values and then running the select statement, as opposed to running the select statement with the variables and then accessing the values stored in those variables. Once I resolved that it worked. My revised code is as follows:
    --Global variable section contains:
    var_user_chosen_map_list_ids VARCHAR2(32767);
    var_details VARCHAR(32767);
    PROCEDURE PROCMAPSEARCH (par_user_chosen_map_list_ids PKG_ARR_MAPS.ARR_MAP_LIST)
    IS
    BEGIN
    FOR rec_user_chosen_map_list_ids IN 1 .. par_user_chosen_map_list_ids.count
    LOOP
       var_user_chosen_map_list_ids := var_user_chosen_map_list_ids ||
       '''' ||
       par_user_chosen_map_list_ids(rec_user_chosen_map_list_ids) ||
    END LOOP;
    var_user_chosen_map_list_ids := substr(var_user_chosen_map_list_ids,
                                            1,
                                            length(var_user_chosen_map_list_ids)-1);
    var_details := FUNCMAPDATAFIND (var_user_chosen_map_list_ids);
    htp.print(var_details);
    END PROCMAPSEARCH;
    FUNCTION FUNCMAPDETAILS (par_user_chosen_map_list_ids IN VARCHAR2(32767)
    RETURN VARCHAR2
    AS
    TYPE cur_type_map_search IS REF CURSOR;
    cur_map_search cur_type_map_search;
    var_map_date NUMBER(4);
    var_map_title VARCHAR2(32767);
    begin:
    OPEN cur_map_search FOR
    'SELECT MI.map_date,
           MT.map_title
    FROM map_info MI,
         map_title MT,
         TABLE (sys.dbms_debug_vc2coll(' || par_user_chosen_map_list_ids || '))
    WHERE MI.map_title_id = MT.map_title_id
    AND MI.map_publication_id = column_value';
    LOOP
    FETCH cur_map_compare INTO
    var_map_date,
    var_map_title;
    var_details := var_details || 'Map date: '||
                        var_map_date ||
                        'Map title: ' ||
                        var_map_title;
    EXIT WHEN cur_map_compare%NOTFOUND;
    END LOOP;
    RETURN var_details;
    END FUNCMAPDETAILS;Kind regards
    Tim

  • Use of DECODE and NULL value in a WHERE clause

    hi all,
    I came into an issue trying to use the DECODE function in a simple where clause.
    this is my test case
    CREATE TABLE tab_test (lev NUMBER, code VARCHAR2(10), val VARCHAR2(10));
    INSERT INTO tab_test VALUES (1, NULL, 'val11');
    INSERT INTO tab_test VALUES (1, NULL, 'val12');
    INSERT INTO tab_test VALUES (1, '13', 'val13');
    INSERT INTO tab_test VALUES (2, '21', 'val21');
    INSERT INTO tab_test VALUES (1, '22', 'val22');
    INSERT INTO tab_test VALUES (1, '23', 'val23');
    and this is the query
    SELECT * FROM tab_test WHERE code = DECODE(:lev,1,NULL,:cod)
    as you can see running this query, setting :lev to 1 will return an empty record set, instead of the expected first two rows (as it will be, running "select * from tab_test where code is null").
    is there a way to overcome this issue? thanks for help

    hi Frank,
    I can confirm that the queries do work when run on TOAD, but do not when they are put in the WHERE clause of my data block. I guess the problem relies on some data block setting; I should investigate on Forms forum.
    Anyway, here is my test case, including data and some examples. You can realize that it works good
    CREATE TABLE TAB_TEST
    LEV NUMBER,
    CODE VARCHAR2(10 BYTE),
    VAL VARCHAR2(10 BYTE)
    Insert into tab_test
    (LEV, CODE, VAL)
    Values
    (3, 'val21', 'val3_211');
    Insert into tab_test
    (LEV, CODE, VAL)
    Values
    (2, 'val21', 'val3_212');
    Insert into tab_test
    (LEV, VAL)
    Values
    (1, 'val11');
    Insert into tab_test
    (LEV, VAL)
    Values
    (1, 'val12');
    Insert into tab_test
    (LEV, VAL)
    Values
    (1, 'val13');
    Insert into tab_test
    (LEV, CODE, VAL)
    Values
    (2, 'val11', 'val21');
    Insert into tab_test
    (LEV, CODE, VAL)
    Values
    (2, 'val12', 'val22');
    Insert into tab_test
    (LEV, CODE, VAL)
    Values
    (2, 'val13', 'val23');
    COMMIT;
    SELECT * FROM TAB_TEST
    CONNECT
    BY PRIOR val = code
    START WITH (CASE
    WHEN :LIV = 1 AND code IS NULL THEN 'OK'
    WHEN :LIV != 1 AND code = :COD THEN 'OK'
    END = 'OK')
                   AND VAL = :V
    :LIV = 1
    :COD = [any]
    :V = 'val11'
    LEV     CODE     VAL
    1          val11
    2     val11     val21
    3     val21     val3_211
    3     val21     val3_212
    :LIV = 1
    :COD = [any]
    :V = 'val12'
    LEV     CODE     VAL
    1          val12
    2     val12     val22
    :LIV = 2
    :COD = 'val11'
    :V = 'val21'
    LEV     CODE     VAL
    2     val11     val21
    3     val21     val3_211
    2     val21     val3_212

  • Using Select List value for building report

    I have an interactive report form. I have a "After Header" (LOAD) process that run sql commands that will populate a table with the data that the report needs for a given week.
    I have a Select List item that is run as a "Before Header" that gets a list of dates from a table. The dates only contain the first day of the week for the past two years. It is called "WEEK_OF" table and the column is called "WEEK_OF_DATE".
    The default value for the Select List is the first day of the current week. And then all of the first day of the week from the WEEK_OF table.
    I would like the LOAD process to use the value in the Select List. So at start up I would like the List to show the current week and report to begin with data from the current week.
    So I have tried to use the variable :WEEK_OF_DATE (Item name) as the beginning date for the report. However :WEEK_OF_DATE is null.
    Also, after I have the report displayed, I would like to select a new date from the list and have the report automatically refresh with that new data.
    Any Ideas what I am doing wrong?

    Hi Lyle,
    When setting a default value for a select list that is to be used to filter a report, I have found it best to do that using a computation, conditional on the item being NULL and running Before Header. If other computations rely on this value, then it should have the lowest sequence number to ensure that the value is available for those.
    Andy

  • How to use a lexical variable in a WHERE clause and as a function argument.

    Hello,
    My report has a lexical variable which has values like 'and id in (1,3,4)'. I want to use this variable in two separate queries. In the first, it is used in the WHERE clause, something like:
    .. where date is not null &var;
    In the second query, the variable is used in a function call, something like:
    select * from table (my_function(&var));
    The trouble is that the first query works when the value of the variable is unquoted, but for the second query the value should be quoted.
    Does anyone have an idea how I could solve this problem?
    Thanks in advance,
    Frans
    Message was edited by:
    fransie

    http://tkyte.blogspot.com/2006/06/varying-in-lists.html
    Presents many options.

  • Prompted value corrupts SQL WHERE clause - bug?

    Using 10.1.3.4...
    I implemented a simple pivot based request that navigates to a second request when the user drill down on one of the fields. This field is set to "value is prompted" in my second request. (I chose navigate method above drill (dimensions) for a few reasons not really important to this posting, mainly to do with format of requests at different levels)
    All good and the drill down works well, parameters are passed correctly, except then I noticed that totals in my second request doesn't accurately tie back to my first request. After some research I found a very odd reason for this, my WHERE clause is getting corrupted - which almost looks like a bug in OBIEE and were wondering if anybody else has seen this behaviour from OBIEE and know a work around (before I try the Oracle support channels)
    From Answers the request SQL is (I'll highlight the lines getting messed up):
    SET VARIABLE DISABLE_CACHE_HIT = 1;
    SELECT
    BUSINESS_UNIT.Segment saw_0, BUSINESS_UNIT."Business Unit" saw_1, OPPORTUNITY.CLOSEPROBABILITY saw_2, OPPORTUNITY.CLOSEPROBABILITY saw_3, YEAR(OPPORTUNITY.ESTIMATEDCLOSE) saw_4, OPPORTUNITY_ADDON.TCV_IN_USD/1000000 saw_5, OPPORTUNITY_ADDON.WEIGHTED_TCV_IN_USD/1000000 saw_6, CASE OPPORTUNITY.CLOSEPROBABILITY WHEN 100 THEN OPPORTUNITY_ADDON.TCV_IN_USD/1000000 ELSE 0 END saw_7 FROM "Sales"
    WHERE (OPPORTUNITY.STAGE NOT IN ('Lost', 'On Hold')) AND (YEAR(OPPORTUNITY.ESTIMATEDCLOSE) >= YEAR(CURRENT_DATE)) AND
    ((({color:#ff0000}OPPORTUNITY.CLOSEPROBABILITY > 25) AND (TIMESTAMPDIFF(SQL_TSI_MONTH, CURRENT_DATE,OPPORTUNITY.ESTIMATEDCLOSE) <= 4)) OR ((OPPORTUNITY.CLOSEPROBABILITY >= 10) AND (TIMESTAMPDIFF(SQL_TSI_MONTH, CURRENT_DATE,OPPORTUNITY.ESTIMATEDCLOSE) > 4{color})))
    ORDER BY saw_0, saw_1, saw_2, saw_3, saw_4, saw_5, saw_6, saw_7
    Which results in the following SQL request (from NQQuery.log)... The prompted value (BUSINESS_UNIT.Segment) is added correctly to the WHERE clause, but see how the remainder get's changed:
    SQL Request:
    SET VARIABLE QUERY_SRC_CD='Report',SAW_DASHBOARD='/shared/01 - Financials/_portal/4. Pipeline',SAW_DASHBOARD_PG='Pipeline',SAW_SRC_PATH='/shared/01 - Financials/4. Pipeline/Pipeline - Current - T2',DISABLE_CACHE_HIT = 1;
    SELECT
    BUSINESS_UNIT.Segment saw_0, BUSINESS_UNIT."Business Unit" saw_1, OPPORTUNITY.CLOSEPROBABILITY saw_2, OPPORTUNITY.CLOSEPROBABILITY saw_3, YEAR(OPPORTUNITY.ESTIMATEDCLOSE) saw_4, OPPORTUNITY_ADDON.TCV_IN_USD/1000000 saw_5, OPPORTUNITY_ADDON.WEIGHTED_TCV_IN_USD/1000000 saw_6, CASE OPPORTUNITY.CLOSEPROBABILITY WHEN 100 THEN OPPORTUNITY_ADDON.TCV_IN_USD/1000000 ELSE 0 END saw_7 FROM "Sales"
    WHERE (BUSINESS_UNIT.Segment = 'Enterprise') AND (OPPORTUNITY.STAGE NOT IN ('Lost', 'On Hold')) AND (YEAR(OPPORTUNITY.ESTIMATEDCLOSE) >= YEAR(CURRENT_DATE)) AND
    ((({color:#ff0000}OPPORTUNITY.CLOSEPROBABILITY >= 10) AND (TIMESTAMPDIFF(SQL_TSI_MONTH, CURRENT_DATE,OPPORTUNITY.ESTIMATEDCLOSE) > 4)) OR ((OPPORTUNITY.CLOSEPROBABILITY >= 10) AND (TIMESTAMPDIFF(SQL_TSI_MONTH, CURRENT_DATE,OPPORTUNITY.ESTIMATEDCLOSE) > 4{color})))
    ORDER BY saw_0, saw_1, saw_2, saw_3, saw_4, saw_5, saw_6, saw_7
    Which definitely explains why my totals do not add up when drilling down. Interestingly, if I run my second request without the prompt from Answers, the SQL request works like a charm:
    SET VARIABLE QUERY_SRC_CD='Report',SAW_SRC_PATH='/shared/01 - Financials/4. Pipeline/Pipeline - Current - T2',DISABLE_CACHE_HIT = 1;
    SELECT BUSINESS_UNIT.Segment saw_0, BUSINESS_UNIT."Business Unit" saw_1, OPPORTUNITY.CLOSEPROBABILITY saw_2, OPPORTUNITY.CLOSEPROBABILITY saw_3, YEAR(OPPORTUNITY.ESTIMATEDCLOSE) saw_4, OPPORTUNITY_ADDON.TCV_IN_USD/1000000 saw_5, OPPORTUNITY_ADDON.WEIGHTED_TCV_IN_USD/1000000 saw_6, CASE OPPORTUNITY.CLOSEPROBABILITY WHEN 100 THEN OPPORTUNITY_ADDON.TCV_IN_USD/1000000 ELSE 0 END saw_7 FROM "Sales"
    WHERE (OPPORTUNITY.STAGE NOT IN ('Lost', 'On Hold')) AND (YEAR(OPPORTUNITY.ESTIMATEDCLOSE) >= YEAR(CURRENT_DATE)) AND
    ((({color:#ff0000}OPPORTUNITY.CLOSEPROBABILITY > 25) AND (TIMESTAMPDIFF(SQL_TSI_MONTH, CURRENT_DATE,OPPORTUNITY.ESTIMATEDCLOSE) <= 4)) OR ((OPPORTUNITY.CLOSEPROBABILITY >= 10) AND (TIMESTAMPDIFF(SQL_TSI_MONTH, CURRENT_DATE,OPPORTUNITY.ESTIMATEDCLOSE) > 4{color})))
    ORDER BY saw_0, saw_1, saw_2, saw_3, saw_4, saw_5, saw_6, saw_7
    Anybody had the same problem before?

    Here's the excerpt (it's relative to crashing, but I think it should also address the bug):
    # PRESENTATION SERVER CRASH AFTER UPGRADING TO 10.1.3.4 (Doc ID 756541.1)
    crash when they run the reports containing Pivot Table. This has been a known issue with version ... subsequently upgraded to version
    Doc Type:ALERTModified:2/10/2009

  • Exclude duplicate values on SQL where clause statement

    Hi!
    Are some posibilities to exclude duplicate values do not using sql aggregate functions in main select statement?
    Priview SQL statement
    SELECT * FROM
    select id,hin_id,name,code,valid_date_from,valid_date_to
    from diaries
    QRSLT
    WHERE (hin_id = (SELECT NVL(historic_id,id)FROM tutions where id=/*???*/ 59615))
    AND NVL(valid_date_to,to_date('22.12.2999','dd.mm.yyyy')) <= (SELECT NVL(valid_date_to,to_date('22.12.2999','dd.mm.yyyy'))FROM tutions where id= /*???*/ 59615)
    AND trunc(valid_date_from) >=(SELECT trunc(valid_date_from)FROM tutions where id= /*???*/ 59615)
    The result
    ID                  HIN_ID    NAME      CODE    VALID_DATE FROM                 VALID_DATE_TO    
    50512
    59564
    RE TU
    01
    07.06.2013 16:32:15
    07.06.2013 16:33:28
    50513
    59564
    TT2 
    02
    07.06.2013 16:33:23
    07.06.2013 16:33:28
    50515
    59564
    TT2 
    02
    07.06.2013 16:33:28
    07.06.2013 16:34:42
    50516
    59564
    ROD 
    03
    07.06.2013 16:34:37
    07.06.2013 16:34:42
    VALID_DATE_TO & AND VALID_DATE_FROM tutions
    07.06.2013 16:34:42
    15.07.2013 10:33:23
    In this case i got duplicate of entry TT2 id 50513  In main select statement cant use agregate functions are even posible to exclude this value from result modifying only the QLRST WHERE clause (TRUNC need to be here)
    THANKS FOR ANY TIP !
    ID.

    Hi, Ok this is working in this case
    SELECT * FROM
    select id,hin_id,name,code,valid_date_from,valid_date_to
    from diaries ahs
    QRSLT
    WHERE (hin_id = (SELECT NVL(historic_id,id)FROM aip_healthcare_tutions where id=/*???*/ 59615))
    AND NVL(valid_date_to,to_date('22.12.2999','dd.mm.yyyy')) <= (SELECT NVL(valid_date_to,to_date('22.12.2999','dd.mm.yyyy'))FROM tutions where id= /*???*/ 59615)
    AND trunc(valid_date_from) >=(SELECT trunc(valid_date_from)FROM tutions where id= /*???*/ 59615)
    AND NOT  EXISTS
    (SELECT null FROM diaries ahs WHERE  ahs.valid_date_from < QRSLT.valid_date_from
        AND QRSLT.hin_id=ahs.hin_id
        AND QRSLT.code=ahs.code);
    Result
    50512
    59564
    RE TU
    01
    07.06.2013 16:32:15
    07.06.2013 16:33:28
    50513
    59564
    TT2 
    02
    07.06.2013 16:33:23
    07.06.2013 16:33:28
    50516
    59564
    ROD 
    03
    07.06.2013 16:34:37
    07.06.2013 16:34:42
    But if the Data in tutions row  are theese(valid_date_to-null)  then NO ROWS are returning and its logical because in full result list Valid_date_from column are logical incorect
    valid_date_from                                 valid_date_to
    15.07.2013 10:33:23
    NULL
    ID                  HIN_ID    NAME      CODE    VALID_DATE FROM                 VALID_DATE_TO 
    50510
    59564
    RE TU
    01
    07.06.2013 16:33:28
    50511
    59564
    TT2 
    02
    07.06.2013 16:34:41
    50514
    59564
    ROD 
    03
    07.06.2013 16:34:41
    50520
    59564
    Params
    04
    03.07.2013 21:01:30
    50512
    59564
    RE TU
    01
    07.06.2013 16:32:15
    07.06.2013 16:33:28
    50513
    59564
    TT2 
    02
    07.06.2013 16:33:23
    07.06.2013 16:33:28
    50515
    59564
    TT2 
    02
    07.06.2013 16:33:28
    07.06.2013 16:34:42
    50516
    59564
    ROD 
    03
    07.06.2013 16:34:37
    07.06.2013 16:34:42
    Are that posible modifying where statement  if the valid_date_to in tutions are null then theese records where in diary valid_date_to is null is correct to, but need to stay previos logic
    D                  HIN_ID    NAME      CODE    VALID_DATE FROM                 VALID_DATE_TO 
    50510
    59564
    RE TU
    01
    07.06.2013 16:33:28
    null
    50511
    59564
    TT2 
    02
    07.06.2013 16:34:41
    null
    50514
    59564
    ROD 
    03
    07.06.2013 16:34:41
    null
    50520
    59564
    Params
    04
    03.07.2013 21:01:30
    null
    Thanks !
    ID.

Maybe you are looking for

  • Deleting photo's from ipod etc

    i need to delete all photo files from my ipod 80g and i see that on the summary it says i have 177mb in 'other' i don't know what that refers to anyone have similar probs

  • Relation between employee data and SAP user ID

    Hi experts, I am searching a relation between a SAP User Id and the personal data of an employee like Infotype 2. Is there any relation like this? Thanks!

  • Acrobat  Reader 9 Bug?

    I designed a form in Acrobat Professional 8. When I look at the form in Acrobat Reader version 9 and attempted to submit the form, the software opens my email client and creates a new email message, but doesn't fill the "To:" in the email. When I use

  • Adobe Flash has no sound

    Supposedly, I have the latest version of Flash installed, yet I still can't hear anything that uses flash. Youtube and all that, I can see the video part, but there is no sound. This comes up after I download it: Version 9,0,45,0 Installed Successful

  • Searching For Dashboard Widgets

    Hi, How do you search for Dashboard Widgets on Apple's website? Since they changed the site this year, I've found it very hard to find widgets which I know for a fact are listed on the site. For example, if I type into the Search bar in the top-right