Prompt for UNION query

I have developed a combined request to use in a dashboard. The combined request is a
UNION and consists of some columns that are from the same tables but also a few of the columns in the request come from different tables although they are identically named.
For example, there is a column named Expense Type that comes from two different tables and the first sql in the Union uses Expense Type from Table A and the second sql in the Union uses Expense Type from Table B. Both combined requests specify Expense Type "is prompted". How can I make this work so that a single dashboard prompt for Expense Type can pass the user selected value to both sql's in the Union?
I really don't want to make the user have to have 2 prompts, one for Expense Type using Table A values and one for Expense Type using Table B values.
Thanks

Wow! I can't believe it works without the request being imbedded in the dashboard but as you said, try it, and I did!
One further refinement or clarification:
This method doesn't work unless I use a presentation variable.
On the dashboard page's Prompt I set/defined a Presentation Variable for the "Type" prompt and then in my 3rd request I set a filter that compared "Type"'s value fo the Presentation Variable's value. Otherwise no luck. Is that how you did it too?

Similar Messages

  • Prompt for Record filter

    Hi guys,
    I see where i can have a prompt for a Query filter...
    but
    i think what i want is even easier.
    i have a field called open which is true or false.
    what i need is to prompt if the user wants to see
    the open data or not.
    do I need a special version of Crystal to do this?
    thanks
    timalaugh

    Have this open column at last in the details tab....
    Create a formula which returns boolean 0/1
    say 0 is returned, if user sets "open" as TRUE
    1 is returned 1 if user sets "open" as FALSE
    Conditionally suppress the column "open" based on the Boolean value returned
    Thanks,
    G

  • Prompts for Combine similar request (Union query)

    I have been given 5 tables for creating one report out of each table. I created aliases and
    necessary self joins. I now need a summaryreport that combines these five tables. I tried the
    "combine similar request" and the report functions fine. Now I have to create two prompts, one for
    country and one for job. These are fields available in 4 tables and have the same format alongwith
    the same datatypes. Please help me with this.
    Table 1 Report A
    Table 2 Report B
    Table 3 Report C
    Table 4 Report D
    Table 5 Report E
    Table 1 - Table 4 contains Country and Job field which is of the same format and datatype.
    Table 5 does not have these and its not necessary for us to prompt this.
    This has no star schema setup and I am not in a position to get it done as well. I considered each
    table to be a fact table and created aliases, selfjoins etc. Please help with the procedure to
    create the two dashboard prompts. If I choose USA then the first four amongst the union queries
    should reflect data for the USA. The same applies for Job.

    Hello
    Thanks for the reply.
    My problem here is that I have 5 different tables with country fields in them. They are of the same format and datatype but there is no join between these tables. If I choose one Country field from any particular table, then the combine similar request doesnt seem to take it for other queries where the fields come from a different table.
    eg.
    Table 1 - table 5 have country fields
    I choose to create a prompt based on Country from Table 1. The union query doesnt seem to reflect on filtering values on the queries from other tables. It would filter only the values from table 1.
    Please let me know as to what can be done!

  • Can we change filter column values in a union query using Dashboard prompt

    Hi,
    I have a requirement in which have to draw a chart report for last six months?.
    When i query against database, my query got different where clause for open month and close month.
    Say for july month bar, it got close month as july and open month as july, june, may. Like this, for june month bar, it has to have close month as june and open month as june, may, april. like this, i created six union queries using repository variable.
    Want to give control using dashboard prompt for close month and open month?
    my query look like this.
    select close month1, fact1 from table1
    where close month = july and open month in (july, june, may)
    UNION
    select close month2, fact2 from table1
    where close month = june and open month in (june, may, april)
    UNION
    select close month3, fact3 from table1
    where close month = may and open month in (may, april, march)
    UNION
    select close month4, fact4 from table1
    where close month = april and open month in (april, march, february)
    UNION
    select close month5, fact5 from table1
    where close month = march and open month in (march, february, january)
    UNION
    select close month6, fact6 from table1
    where close month = february and open month in (february, january, december)
    Welcome your suggestions on this?.
    Thanks

    Hi Karol,
    Yes the prompt is working fine when i put this following method under the "Button" Component.
    APPLICATION.openPromptDialog(800, 600);
    Somehow the when i use the "Input Field" and use the "Button" Component and write this following logic inside it i don't see the prompt is not taking the values what i am entering in input field i assume that its issue with data-source not getting refreshed.
    Variable=INPUTFIELD_1.getValue();
    APPLICATION.setVariableValue("PercentageIncrease",Variable);
    Thanks,
    Kumar

  • Query not prompting for input

    Hello,
    I am just learning Oracle and I am having problems getting a query to run correctly. I am creating a query on the HR database that should prompt the user for input. The code I have so far is below using the single ampersand substitution variable. When I run the query, I keep getting no data found instead of being prompted to enter a letter. I have also tried running the query using a ':' instead of an '&' and get the same results. If I change '&ltr%' to 'A%' the query will run, however I need it to prompt the user to input a letter. I have also tried to run the query without the single quotes, it will prompt for input and return an error of ORA-00911: invalid character. Any help given will be greatly appreciated.
    SELECT last_name, first_name, job_id, department_id
    FROM employees
    WHERE last_name LIKE '&ltr%'
    ORDER BY last_name;

    If you are the sql query form in APEX, try using this query:
    SELECT last_name, first_name, job_id, department_id
    FROM employees
    WHERE last_name LIKE :ltr
    ORDER BY last_name;For input include the % at the end of your string
    When looking for employees with last name like MILLER, enter MILL%
    Thank you,
    Tony Miller
    LuvMuffin Software
    (281) 871-0950

  • Query to get translated seeded prompts for responsibilities

    My customer is doing a global EBS R12.1.3 implementation and they are in need of a query that can give all the seeded or custom translated Prompts for the Responsibilities. If any you have developed such query, please share with us and it is much appreciated.

    user13380563 wrote:
    My customer is doing a global EBS R12.1.3 implementation and they are in need of a query that can give all the seeded or custom translated Prompts for the Responsibilities. If any you have developed such query, please share with us and it is much appreciated.
    Please see previous threads.
    https://forums.oracle.com/search.jspa?q=Responsibilities+AND+Query+AND+EBS
    https://forums.oracle.com/search.jspa?q=Responsibilities+AND+Query
    Thanks,
    Hussein

  • ADF panel does not prompt for variable defined in ADF view object.

    I have created an ADF Panel, which allows the user to run a few simple queries against an Oracle database done using ADF view objects and ADF view links and ADF application module.
    One of these queries lookup detail information about a given database object (Table, view or whatever) from dba_objects. The SQL uses a parameter (:P_OBJ_NAME) that has a default value of “Departments”. If I run the ADF application module by itself outside of the ADF panel, all works fine, it prompts me to provide a value for the parameter :P_OBJ_NAME.
    As I said the panel contains the different ADF view links including the one that should prompt the user to provide a value for :P_OBJ_NAME. When I run the panel it does not prompt me for :P_OBJ_NAME, it just uses the default defined value “departments”.
    I hope I described my problem for every one to understand. The question obviously is how do I get the ADF panel to prompt the user to provide a value for parameter :P_OBJ_NAME, my expectation was that since the sql in the view object and the application module both are designed to prompt for a value for this parameter then the panel should do just that but it does not.
    You expert input would be most appreciated.
    Thanks.
    Bobby A.
    Edited by: Babak Akbari on Aug 13, 2009 8:34 AM
    Edited by: Babak Akbari on Aug 13, 2009 11:12 AM

    The prompting for a parameter is a feature we built into the ADF Tester - it is not a default behavior you get in your application when you just place a VO on your page.
    To get something like this expend the operations node under the VO in the data control palette, and drag the "Execute with parameters" operation to your page to drop it as a parameter form.
    This will provide your user a place to fill out the parameter and press a button to execute the query.

  • How to get Average of a column in UNION query

    Hi All,
    I will try to explain the issue as much as I can and If you need clarification on any piece please let me know.
    So, I have a Union Query with two sets of Criteria.
    The first Criteria Brings the list of Buildings and a set of Measures for it. The second criteria does the same but with a different set of filters.
    No I use a UNION between these both criteria and present them in a Pivot view so that we only have one row per each building. The values in each of the criteria in the UNION query are Summed
    Ex:
    Building
    Metric 1
    Metric 2
    1
    20
    30
    1
    25
    35
    2
    40
    50
    2
    45
    55
    So as I show in the pivot the result is
    Building
    Metric 1
    Metric 2
    1
    45
    65
    2
    85
    105
    Now the issue is with the Grand Total.
    I want the Grand Total to be an Average of the Buildings. So for Metric 1 The Grand Total should be (45+85)/2 because we have two buildings so the answer should be 65.
    How can I get that.
    Bottom Line: Need an Average as the Grand Total when the Aggregation rule on the column is set to Sum.
    we use 11.1.6.10 version

    Hi VJ
    What you are asking is impossible in the pivot table itself as you are asking one part of the pivot table to aggregate via one method, and another to aggregate via another method, on the same column ..
    It can be done using a calculated item. For your example above you'd use the formula ( $1 + $2) / 2.
    .. But thats HIGHLY explicit, and would only work if you KNOW how many buildings will come back in the query.. EVERYTIME.
    Why not restructure the query to combine it into a single query using an combinations of filters with OR in between?

  • Calendar prompt for Date variable from bex

    Hi All,
    I have a Bex query where I have a variable on 0CALDAY
    - Customer exit (i_step = 1 to populate with current date)
    - Single value
    - Mandatory
    I created universe on this query and in webI selection screen i do see the variable prompt.
    I am not able to see the current date populated automatically since exit values are not populated to WebI at runtime.
    My problem is that in WebI selection screen we get list of date values from the info provider instead of Calendar prompt
    where user can enter the values directly.
    I am currently on BO XI 3.1 SP3.
    Is there any specific setting in Universe or bex query which is required to get this Calendar prompt instead of list of values for dates?
    Note: When we were on SP1 the universe created then had same variable from bex and it still shows us Calendar prompt but ever since we upgraded to SP3 for the query splitter functionality we not able to get the calendar prompt for date variable in new universe we create
    Thanks
    Ritesh

    Yep.
    Now tell me how you want to show that Prompt @ WebI report level.
    My problem is that in WebI selection screen we get list of date values from the info provider instead of Calendar prompt
    where user can enter the values directly. Exactly, i didn't get this??
    @Prompt:
    You have flexibility to show options like:
    Mono/Multi: User can select Single value or Multiple.
    BW Variable: Same we have (Single/Multiple)
    Free/Constrained: User can Enter his/her value directly or No change option.
    BW Variable: By defalut you will get this, once you made it to Optional input.
    Persistent/Not_Persistent: Refreshed report has to show last selected value means use Persistent otherwise Not_P.
    By seeing the Prompt syntax , I can say your Variable is after Customer Exit, Correct??
    Workaround for your Problem is:
    <FILTER KEY="ZV_DATE"><CONDITION OPERATORCONDITION="Equal"><CONSTANT TECH_NAME="@Prompt('Date (Previous Day)','A','Date\LovDate (Previous Day)Base',mono,primary_key)"/></CONDITION></FILTER>
    You have to remove that Date class and objects from prompt syntax. Because of that it showing up LOV's not calendar.
    Like:
    <FILTER KEY="ZV_DATE"><CONDITION OPERATORCONDITION="Equal"><CONSTANT TECH_NAME="@Prompt('Date (Previous Day)','A',',mono,primary_key)"/></CONDITION></FILTER>
    Why, It should be blank??
    Because Date needs no class\object to show up, by default you will get Calendar on the fly.
    Hope you got my point.
    Thank You!!

  • Prompt for setting Top N

    I have a report to list top N sources of data. For my report, I have 12 prompt fields excluding the prompt for setting the top N value. The report is working fine with the 12 prompts some of which are constrained. All the prompts have "All Choices" as default values. The moment I add the prompt for the top N, the constrained prompts do not show any value in the drop-down. To provide a little more perspective, this is what I have done to create the top N prompt:
    Used any random field and then changed the fx with hard value 1. Selected "Edit Box" for the control. The specific value has been set to 5. Using a presentation variable.
    However, if I add this prompt with its own "Go" button, then I do not see the issue described above. I would not like to have 2 "Go" buttons.
    Please let me know what I am missing here to make it work.
    Thanks.
    Bhusan

    As you said, 'All the prompts have "All Choices" ', this is one of the requirement's for the constrain to work. I believe that to get the constrain values, you might have used a SQL query
    and you are getting the values. In that case, as per my knowledge, you cannot constrain a dashboard prompt when you are using SQL Results.
    Constrained columns will be constrained by all other columns in the prompt. For example, if the prompt contains columns Year, Region, and District, and Constrain is checked for District, the values shown in District will be limited by the values entered in Region and Year.
    Thanks,
    Chandu.

  • 1 User Prompt for 2 rows in Financial Reporting ?

    Hello,
    for 2 years, I am struggling with following-
    we have very detailled (detailled in 2 or 3 dimensions - let's say here: CBU and CostCenter ) reports, which run very long
    in order to give user the overview/total as well, we want to give the total over all 2 or 3 dimensions only
    the user should be allowed to choose 1 or more values (CBUs) via user prompt
    current workaround is to have 2 user prompts (1 for detailled combinations) and (1 for total) and asking the user to fill the CBU 2 times
    if user is not chosing same CBU(s), then report is inconsistant:
    as many people have to use dozens of values and because there is no select all/ deselect all function - the handling is very annoying for the users.
    Sample Report Definition
    ...........................................Dimension 1...........................................Dimension 2
    Row 1 (of report definition): Descendants of Prompt for CBUs..............Descendants of Costcenter
    Row 2 (of report definition): Prompt for CBUs....................................Costcenter Total
    by this, we get a sample output like this: (Projects are the level 0 members of CBUs in CBU dimension)
    ...........................................Project A from CBU I.....................CostCenter X...............50
    ...........................................Project A from CBU I.....................CostCenter Y...............20
    ...........................................Project B from CBU II....................CostCenter X...............10
    ...........................................Project C from CBU III...................CostCenter Z...............100
    ...........................................Project D from CBU III...................CostCenter X...............200
    ...........................................CBU I..........................................CostCenter Total..........70
    ...........................................CBU II.........................................CostCenter Total..........10
    ...........................................CBU III........................................CostCenter Total..........300
    Problem is:
    I would like to define for
    Row 2 Prompt for CBUs
    and for
    Row 1 Descendants of Same as Row 2
    but then I get the error "5200 : Error executing query: +Server+/+Application+/+Database+/+User+/Error(1001005) Unknown Member [Same As Row  2] in Report
    any idea how to workaround with that ? (have same problem with *Children of Same as Row 2*
    I tried to combine *Same as Row 2* with *RelativeMember & Offset -1* definition in reporting is then: Relative to Same As Row 2 offset by -1
    - but no success - all I achieve is a true Same as - resulting in duplication of all data of Row 2 and nothing from row 1.
    Any other ideas, how to combine a same as function with functions like parent,children,descendants or relative member ? Did I do anything wrong in combining them or is the relativemember function not working in 9.3.1 ?
    Please note, that these detailled reports typicially run 10 to 20 minutes - so telling users to run 2 reports or including lot's of not needed data or first retrieving and then hiding again is not really helpful - I would also not ask, if this function was not used in dozens of reports.
    The user prompt function in financial reporting is the most used functionality in our reports- the users run approx. 100 reports a day - and fill between 3 and 10 user prompts (with a lot of default values & substitution variables) - this appeared the most efficient way for unexperienced users, who need different data every day.
    unfortunately, it does not allow the report designer to allow either 1 or many values
    it seems to struggle with our special request of "children of same as"
    and it has no "select all" / "unselect all" button - which would allow the user to select all/none of the Choices List, defined in the user prompt.
    Please do not recommend usage of Analyzer - this tool is far to slow, has no cancel button and the users simply go lost.
    Smartview is too risky for majority of our users, as they would use the refresh button only - and not zoom in & zoom out - and miss a lot of new combinations by using old smartview-excel-templates (from previous month/forecast)
    Any help on any of these items would be highly recommended.

    If I understand correctly you would only have one CBU on any given report.
    Instead of prompting for Row 2 and pulling the totals from the Outline. You could delete your current Row2 and have the report provide the totals based on the data results from ROW 1. Insert a row formula for Row 2 and sum the results for that paticular column.
    Formula:
    Sum([1])
    Edited by: ronnie on Apr 21, 2011 9:51 AM
    Edited by: ronnie on Apr 21, 2011 9:52 AM

  • Performance tuning in 11g for said query

    Hello,
    I have the below query which needs to be tuned:
    SELECT DISTINCT a.emplid
    , a.upa_fiscal_year
    , b.balance_period
    , 0
    , a.descr
    , a.UPA_CURRENT_AMT
    , a.UPA_CURRENT_AMT2
    , a.UPA_CURRENT_AMT3
    , a.UPA_CURRENT_AMT4
      FROM ps_upa_eq_incal_vw a
      , ps_upa_eq_incal_vw b
    WHERE a.emplid = b.emplid
       AND a.UPA_FISCAL_YEAR = b.UPA_FISCAL_YEAR
       AND a.balance_period = (
    SELECT MAX(balance_period)
      FROM ps_upa_eq_incal_vw
    WHERE emplid = a.emplid
       AND upa_fiscal_year = a.upa_fiscal_year
       AND descr = a.descr
       AND balance_period <= b.balance_period)
       AND a.descr NOT IN (
    SELECT DISTINCT descr
      FROM ps_upa_eq_incal_vw
    WHERE emplid = b.emplid
       AND upa_fiscal_year = b.upa_fiscal_year
       AND balance_period = b.balance_period
       AND b.balance_period > a.balance_period )
      UNION
    SELECT emplid
    , upa_fiscal_year
    , balance_period
    , 1
    , 'Total'
    , SUM ( UPA_CURRENT_AMT )
    , SUM ( UPA_CURRENT_AMT2 )
    , SUM ( UPA_CURRENT_AMT3 )
    , SUM ( UPA_CURRENT_AMT4 )
      FROM (
    SELECT DISTINCT a.emplid emplid
    , a.upa_fiscal_year upa_fiscal_year
    , b.balance_period balance_period
    , a.descr
    , a.UPA_CURRENT_AMT UPA_CURRENT_AMT
    , a.UPA_CURRENT_AMT2 UPA_CURRENT_AMT2
    , a.UPA_CURRENT_AMT3 UPA_CURRENT_AMT3
    , a.UPA_CURRENT_AMT4 UPA_CURRENT_AMT4
      FROM ps_upa_eq_incal_vw a
      , ps_upa_eq_incal_vw b
    WHERE a.emplid = b.emplid
       AND a.UPA_FISCAL_YEAR = b.UPA_FISCAL_YEAR
       AND a.BALANCE_PERIOD = (
    SELECT MAX(balance_period)
      FROM ps_upa_eq_incal_vw
    WHERE emplid = a.emplid
       AND upa_fiscal_year = a.upa_fiscal_year
       AND descr = a.descr
       AND balance_period <= b.balance_period)
       AND a.descr NOT IN (
    SELECT DISTINCT descr
      FROM ps_upa_eq_incal_vw
    WHERE emplid = b.emplid
       AND upa_fiscal_year = b.upa_fiscal_year
       AND balance_period = b.balance_period
       AND b.balance_period > a.balance_period ) )
      GROUP BY emplid , upa_fiscal_year , balance_period;The EXPLAIN plan for this query is as under:
    Plan hash value: 3550380953
    | Id  | Operation                              | Name               | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT                       |                    |    24 |  2784 |       |   429M (53)|999:59:59 |
    |   1 |  SORT UNIQUE                           |                    |    24 |  2784 |       |   429M (53)|999:59:59 |
    |   2 |   UNION-ALL                            |                    |       |       |       |            |          |
    |*  3 |    FILTER                              |                    |       |       |       |            |          |
    |   4 |     NESTED LOOPS                       |                    |   196M|    29G|       |   205M  (4)|685:32:54 |
    |   5 |      VIEW                              | PS_UPA_EQ_INCAL_VW |  4513K|   146M|       | 72281   (2)| 00:14:28 |
    |   6 |       HASH GROUP BY                    |                    |  4513K|   249M|   329M| 72281   (2)| 00:14:28 |
    |*  7 |        HASH JOIN                       |                    |  4513K|   249M|       |  8644   (4)| 00:01:44 |
    |   8 |         TABLE ACCESS FULL              | PS_UPA_EQ_TRCD_TBL |   513 | 14364 |       |     3   (0)| 00:00:01 |
    |*  9 |         TABLE ACCESS FULL              | PS_UPA_EQ_DC_BAL   |  4513K|   129M|       |  8592   (4)| 00:01:44 |
    |  10 |      VIEW PUSHED PREDICATE             | PS_UPA_EQ_INCAL_VW |     1 |   127 |       |    46   (5)| 00:00:01 |
    |  11 |       SORT GROUP BY                    |                    |    33 |  1914 |       |    46   (5)| 00:00:01 |
    |* 12 |        HASH JOIN                       |                    |    33 |  1914 |       |    45   (3)| 00:00:01 |
    |* 13 |         TABLE ACCESS FULL              | PS_UPA_EQ_TRCD_TBL |    32 |   896 |       |     3   (0)| 00:00:01 |
    |  14 |         TABLE ACCESS BY INDEX ROWID    | PS_UPA_EQ_DC_BAL   |    44 |  1320 |       |    41   (0)| 00:00:01 |
    |* 15 |          INDEX RANGE SCAN              | PS_UPA_EQ_DC_BAL   |    44 |       |       |     3   (0)| 00:00:01 |
    |* 16 |     FILTER                             |                    |       |       |       |            |          |
    |  17 |      HASH GROUP BY                     |                    |     1 |    53 |       |     8  (25)| 00:00:01 |
    |* 18 |       FILTER                           |                    |       |       |       |            |          |
    |* 19 |        HASH JOIN                       |                    |     4 |   212 |       |     7  (15)| 00:00:01 |
    |* 20 |         INDEX RANGE SCAN               | PS_UPA_EQ_DC_BAL   |     4 |   100 |       |     3   (0)| 00:00:01 |
    |* 21 |         TABLE ACCESS FULL              | PS_UPA_EQ_TRCD_TBL |    32 |   896 |       |     3   (0)| 00:00:01 |
    |  22 |     SORT AGGREGATE                     |                    |     1 |    91 |       |            |          |
    |  23 |      VIEW                              | PS_UPA_EQ_INCAL_VW |     1 |    91 |       |     6   (0)| 00:00:01 |
    |  24 |       SORT GROUP BY                    |                    |     1 |    58 |       |     6   (0)| 00:00:01 |
    |  25 |        NESTED LOOPS                    |                    |       |       |       |            |          |
    |  26 |         NESTED LOOPS                   |                    |     1 |    58 |       |     6   (0)| 00:00:01 |
    |  27 |          TABLE ACCESS BY INDEX ROWID   | PS_UPA_EQ_DC_BAL   |     2 |    60 |       |     4   (0)| 00:00:01 |
    |* 28 |           INDEX RANGE SCAN             | PS_UPA_EQ_DC_BAL   |     1 |       |       |     3   (0)| 00:00:01 |
    |* 29 |          INDEX UNIQUE SCAN             | PS_UPA_EQ_TRCD_TBL |     1 |       |       |     0   (0)| 00:00:01 |
    |* 30 |         TABLE ACCESS BY INDEX ROWID    | PS_UPA_EQ_TRCD_TBL |     1 |    28 |       |     1   (0)| 00:00:01 |
    |  31 |    HASH GROUP BY                       |                    |    12 |   852 |       |   214M  (5)|715:46:12 |
    |  32 |     VIEW                               |                    |    12 |   852 |       |   214M  (5)|715:46:12 |
    |  33 |      HASH UNIQUE                       |                    |    12 |  1932 |       |   214M  (5)|715:46:12 |
    |* 34 |       FILTER                           |                    |       |       |       |            |          |
    |  35 |        NESTED LOOPS                    |                    |   196M|    29G|       |   205M  (4)|685:32:54 |
    |  36 |         VIEW                           | PS_UPA_EQ_INCAL_VW |  4513K|   146M|       | 72281   (2)| 00:14:28 |
    |  37 |          HASH GROUP BY                 |                    |  4513K|   249M|   329M| 72281   (2)| 00:14:28 |
    |* 38 |           HASH JOIN                    |                    |  4513K|   249M|       |  8644   (4)| 00:01:44 |
    |  39 |            TABLE ACCESS FULL           | PS_UPA_EQ_TRCD_TBL |   513 | 14364 |       |     3   (0)| 00:00:01 |
    |* 40 |            TABLE ACCESS FULL           | PS_UPA_EQ_DC_BAL   |  4513K|   129M|       |  8592   (4)| 00:01:44 |
    |  41 |         VIEW PUSHED PREDICATE          | PS_UPA_EQ_INCAL_VW |     1 |   127 |       |    46   (5)| 00:00:01 |
    |  42 |          SORT GROUP BY                 |                    |    33 |  1914 |       |    46   (5)| 00:00:01 |
    |* 43 |           HASH JOIN                    |                    |    33 |  1914 |       |    45   (3)| 00:00:01 |
    |* 44 |            TABLE ACCESS FULL           | PS_UPA_EQ_TRCD_TBL |    32 |   896 |       |     3   (0)| 00:00:01 |
    |  45 |            TABLE ACCESS BY INDEX ROWID | PS_UPA_EQ_DC_BAL   |    44 |  1320 |       |    41   (0)| 00:00:01 |
    |* 46 |             INDEX RANGE SCAN           | PS_UPA_EQ_DC_BAL   |    44 |       |       |     3   (0)| 00:00:01 |
    |* 47 |        FILTER                          |                    |       |       |       |            |          |
    |  48 |         HASH GROUP BY                  |                    |     1 |    53 |       |     8  (25)| 00:00:01 |
    |* 49 |          FILTER                        |                    |       |       |       |            |          |
    |* 50 |           HASH JOIN                    |                    |     4 |   212 |       |     7  (15)| 00:00:01 |
    |* 51 |            INDEX RANGE SCAN            | PS_UPA_EQ_DC_BAL   |     4 |   100 |       |     3   (0)| 00:00:01 |
    |* 52 |            TABLE ACCESS FULL           | PS_UPA_EQ_TRCD_TBL |    32 |   896 |       |     3   (0)| 00:00:01 |
    |  53 |        SORT AGGREGATE                  |                    |     1 |    91 |       |            |          |
    |  54 |         VIEW                           | PS_UPA_EQ_INCAL_VW |     1 |    91 |       |     6   (0)| 00:00:01 |
    |  55 |          SORT GROUP BY                 |                    |     1 |    58 |       |     6   (0)| 00:00:01 |
    |  56 |           NESTED LOOPS                 |                    |       |       |       |            |          |
    |  57 |            NESTED LOOPS                |                    |     1 |    58 |       |     6   (0)| 00:00:01 |
    |  58 |             TABLE ACCESS BY INDEX ROWID| PS_UPA_EQ_DC_BAL   |     2 |    60 |       |     4   (0)| 00:00:01 |
    |* 59 |              INDEX RANGE SCAN          | PS_UPA_EQ_DC_BAL   |     1 |       |       |     3   (0)| 00:00:01 |
    |* 60 |             INDEX UNIQUE SCAN          | PS_UPA_EQ_TRCD_TBL |     1 |       |       |     0   (0)| 00:00:01 |
    |* 61 |            TABLE ACCESS BY INDEX ROWID | PS_UPA_EQ_TRCD_TBL |     1 |    28 |       |     1   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       3 - filter( NOT EXISTS (SELECT 0 FROM SYSADM."PS_UPA_EQ_TRCD_TBL" "V",SYSADM."PS_UPA_EQ_DC_BAL" "J" WHERE
                  :B1>:B2 AND "J"."BALANCE_PERIOD"=:B3 AND "J"."UPA_FISCAL_YEAR"=:B4 AND "J"."EMPLID"=:B5 AND
                  ("J"."UPA_INC_TYPE"='C' OR "J"."UPA_INC_TYPE"='D' OR "J"."UPA_INC_TYPE"='M' OR "J"."UPA_INC_TYPE"='P') AND
                  "J"."UPA_FISCAL_YEAR"="V"."UPA_FISCAL_YEAR" AND "J"."UPA_EQ_INC_CD"="V"."UPA_EQ_INC_CD" AND
                  "V"."UPA_FISCAL_YEAR"=:B6 GROUP BY "J"."EMPLID","J"."UPA_FISCAL_YEAR","J"."BALANCE_PERIOD","V"."DESCR"
                  HAVING "V"."DESCR"=:B7) AND "A"."BALANCE_PERIOD"= (SELECT MAX("BALANCE_PERIOD") FROM  (SELECT "J"."EMPLID"
                  "EMPLID","J"."UPA_FISCAL_YEAR" "UPA_FISCAL_YEAR","J"."BALANCE_PERIOD" "BALANCE_PERIOD","V"."DESCR"
                  "DESCR",SUM(DECODE("J"."UPA_INC_TYPE",'D',"J"."UPA_CURRENT_AMT",0))
                  "UPA_CURRENT_AMT",SUM(DECODE("J"."UPA_INC_TYPE",'M',"J"."UPA_CURRENT_AMT",0))
                  "UPA_CURRENT_AMT2",SUM(DECODE("J"."UPA_INC_TYPE",'C',"J"."UPA_CURRENT_AMT",0))
                  "UPA_CURRENT_AMT3",SUM(DECODE("J"."UPA_INC_TYPE",'P',"J"."UPA_CURRENT_AMT",0)) "UPA_CURRENT_AMT4" FROM
                  SYSADM."PS_UPA_EQ_TRCD_TBL" "V",SYSADM."PS_UPA_EQ_DC_BAL" "J" WHERE "J"."BALANCE_PERIOD"<=:B8 AND
                  "J"."UPA_FISCAL_YEAR"=:B9 AND "J"."EMPLID"=:B10 AND ("J"."UPA_INC_TYPE"='C' OR "J"."UPA_INC_TYPE"='D' OR
                  "J"."UPA_INC_TYPE"='M' OR "J"."UPA_INC_TYPE"='P') AND "V"."UPA_FISCAL_YEAR"=:B11 AND
                  "J"."UPA_EQ_INC_CD"="V"."UPA_EQ_INC_CD" AND "V"."DESCR"=:B12 AND "J"."UPA_FISCAL_YEAR"="V"."UPA_FISCAL_YEAR"
                  GROUP BY "J"."EMPLID","J"."UPA_FISCAL_YEAR","J"."BALANCE_PERIOD","V"."DESCR") "PS_UPA_EQ_INCAL_VW"))
       7 - access("J"."UPA_EQ_INC_CD"="V"."UPA_EQ_INC_CD" AND "J"."UPA_FISCAL_YEAR"="V"."UPA_FISCAL_YEAR")
       9 - filter("J"."UPA_INC_TYPE"='C' OR "J"."UPA_INC_TYPE"='D' OR "J"."UPA_INC_TYPE"='M' OR
                  "J"."UPA_INC_TYPE"='P')
      12 - access("J"."UPA_EQ_INC_CD"="V"."UPA_EQ_INC_CD" AND "J"."UPA_FISCAL_YEAR"="V"."UPA_FISCAL_YEAR")
      13 - filter("V"."UPA_FISCAL_YEAR"="B"."UPA_FISCAL_YEAR")
      15 - access("J"."EMPLID"="B"."EMPLID" AND "J"."UPA_FISCAL_YEAR"="B"."UPA_FISCAL_YEAR")
           filter("J"."UPA_INC_TYPE"='C' OR "J"."UPA_INC_TYPE"='D' OR "J"."UPA_INC_TYPE"='M' OR
                  "J"."UPA_INC_TYPE"='P')
      16 - filter("V"."DESCR"=:B1)
      18 - filter(:B1>:B2)
      19 - access("J"."UPA_EQ_INC_CD"="V"."UPA_EQ_INC_CD" AND "J"."UPA_FISCAL_YEAR"="V"."UPA_FISCAL_YEAR")
      20 - access("J"."EMPLID"=:B1 AND "J"."UPA_FISCAL_YEAR"=:B2 AND "J"."BALANCE_PERIOD"=:B3)
           filter("J"."UPA_INC_TYPE"='C' OR "J"."UPA_INC_TYPE"='D' OR "J"."UPA_INC_TYPE"='M' OR
                  "J"."UPA_INC_TYPE"='P')
      21 - filter("V"."UPA_FISCAL_YEAR"=:B1)
      28 - access("J"."EMPLID"=:B1 AND "J"."UPA_FISCAL_YEAR"=:B2 AND "J"."BALANCE_PERIOD"<=:B3)
           filter("J"."UPA_INC_TYPE"='C' OR "J"."UPA_INC_TYPE"='D' OR "J"."UPA_INC_TYPE"='M' OR
                  "J"."UPA_INC_TYPE"='P')
      29 - access("J"."UPA_EQ_INC_CD"="V"."UPA_EQ_INC_CD" AND "V"."UPA_FISCAL_YEAR"=:B1)
           filter("J"."UPA_FISCAL_YEAR"="V"."UPA_FISCAL_YEAR")
      30 - filter("V"."DESCR"=:B1)
      34 - filter( NOT EXISTS (SELECT 0 FROM SYSADM."PS_UPA_EQ_TRCD_TBL" "V",SYSADM."PS_UPA_EQ_DC_BAL" "J" WHERE
                  :B1>:B2 AND "J"."BALANCE_PERIOD"=:B3 AND "J"."UPA_FISCAL_YEAR"=:B4 AND "J"."EMPLID"=:B5 AND
                  ("J"."UPA_INC_TYPE"='C' OR "J"."UPA_INC_TYPE"='D' OR "J"."UPA_INC_TYPE"='M' OR "J"."UPA_INC_TYPE"='P') AND
                  "J"."UPA_FISCAL_YEAR"="V"."UPA_FISCAL_YEAR" AND "J"."UPA_EQ_INC_CD"="V"."UPA_EQ_INC_CD" AND
                  "V"."UPA_FISCAL_YEAR"=:B6 GROUP BY "J"."EMPLID","J"."UPA_FISCAL_YEAR","J"."BALANCE_PERIOD","V"."DESCR"
                  HAVING "V"."DESCR"=:B7) AND "A"."BALANCE_PERIOD"= (SELECT MAX("BALANCE_PERIOD") FROM  (SELECT "J"."EMPLID"
                  "EMPLID","J"."UPA_FISCAL_YEAR" "UPA_FISCAL_YEAR","J"."BALANCE_PERIOD" "BALANCE_PERIOD","V"."DESCR"
                  "DESCR",SUM(DECODE("J"."UPA_INC_TYPE",'D',"J"."UPA_CURRENT_AMT",0))
                  "UPA_CURRENT_AMT",SUM(DECODE("J"."UPA_INC_TYPE",'M',"J"."UPA_CURRENT_AMT",0))
                  "UPA_CURRENT_AMT2",SUM(DECODE("J"."UPA_INC_TYPE",'C',"J"."UPA_CURRENT_AMT",0))
                  "UPA_CURRENT_AMT3",SUM(DECODE("J"."UPA_INC_TYPE",'P',"J"."UPA_CURRENT_AMT",0)) "UPA_CURRENT_AMT4" FROM
                  SYSADM."PS_UPA_EQ_TRCD_TBL" "V",SYSADM."PS_UPA_EQ_DC_BAL" "J" WHERE "J"."BALANCE_PERIOD"<=:B8 AND
                  "J"."UPA_FISCAL_YEAR"=:B9 AND "J"."EMPLID"=:B10 AND ("J"."UPA_INC_TYPE"='C' OR "J"."UPA_INC_TYPE"='D' OR
                  "J"."UPA_INC_TYPE"='M' OR "J"."UPA_INC_TYPE"='P') AND "V"."UPA_FISCAL_YEAR"=:B11 AND
                  "J"."UPA_EQ_INC_CD"="V"."UPA_EQ_INC_CD" AND "V"."DESCR"=:B12 AND "J"."UPA_FISCAL_YEAR"="V"."UPA_FISCAL_YEAR"
                  GROUP BY "J"."EMPLID","J"."UPA_FISCAL_YEAR","J"."BALANCE_PERIOD","V"."DESCR") "PS_UPA_EQ_INCAL_VW"))
      38 - access("J"."UPA_EQ_INC_CD"="V"."UPA_EQ_INC_CD" AND "J"."UPA_FISCAL_YEAR"="V"."UPA_FISCAL_YEAR")
      40 - filter("J"."UPA_INC_TYPE"='C' OR "J"."UPA_INC_TYPE"='D' OR "J"."UPA_INC_TYPE"='M' OR
                  "J"."UPA_INC_TYPE"='P')
      43 - access("J"."UPA_EQ_INC_CD"="V"."UPA_EQ_INC_CD" AND "J"."UPA_FISCAL_YEAR"="V"."UPA_FISCAL_YEAR")
      44 - filter("V"."UPA_FISCAL_YEAR"="B"."UPA_FISCAL_YEAR")
      46 - access("J"."EMPLID"="B"."EMPLID" AND "J"."UPA_FISCAL_YEAR"="B"."UPA_FISCAL_YEAR")
           filter("J"."UPA_INC_TYPE"='C' OR "J"."UPA_INC_TYPE"='D' OR "J"."UPA_INC_TYPE"='M' OR
                  "J"."UPA_INC_TYPE"='P')
      47 - filter("V"."DESCR"=:B1)
      49 - filter(:B1>:B2)
      50 - access("J"."UPA_EQ_INC_CD"="V"."UPA_EQ_INC_CD" AND "J"."UPA_FISCAL_YEAR"="V"."UPA_FISCAL_YEAR")
      51 - access("J"."EMPLID"=:B1 AND "J"."UPA_FISCAL_YEAR"=:B2 AND "J"."BALANCE_PERIOD"=:B3)
           filter("J"."UPA_INC_TYPE"='C' OR "J"."UPA_INC_TYPE"='D' OR "J"."UPA_INC_TYPE"='M' OR
                  "J"."UPA_INC_TYPE"='P')
      52 - filter("V"."UPA_FISCAL_YEAR"=:B1)
      59 - access("J"."EMPLID"=:B1 AND "J"."UPA_FISCAL_YEAR"=:B2 AND "J"."BALANCE_PERIOD"<=:B3)
           filter("J"."UPA_INC_TYPE"='C' OR "J"."UPA_INC_TYPE"='D' OR "J"."UPA_INC_TYPE"='M' OR
                  "J"."UPA_INC_TYPE"='P')
      60 - access("J"."UPA_EQ_INC_CD"="V"."UPA_EQ_INC_CD" AND "V"."UPA_FISCAL_YEAR"=:B1)
           filter("J"."UPA_FISCAL_YEAR"="V"."UPA_FISCAL_YEAR")
      61 - filter("V"."DESCR"=:B1)Any directions as to how to tune this query would be greatly appreciated!
    Thanks,
    Suddhasatwa

    looks like these two steps hurts the most (causing the NL join take forever - because of the 4,5M rows)
    |*  9 |         TABLE ACCESS FULL              | PS_UPA_EQ_DC_BAL   |  4513K|   129M|       |  8592   (4)| 00:01:44 |
    |* 40 |            TABLE ACCESS FULL           | PS_UPA_EQ_DC_BAL   |  4513K|   129M|       |  8592   (4)| 00:01:44 |
       9 - filter("J"."UPA_INC_TYPE"='C' OR "J"."UPA_INC_TYPE"='D' OR "J"."UPA_INC_TYPE"='M' OR
                  "J"."UPA_INC_TYPE"='P')
      40 - filter("J"."UPA_INC_TYPE"='C' OR "J"."UPA_INC_TYPE"='D' OR "J"."UPA_INC_TYPE"='M' OR
                  "J"."UPA_INC_TYPE"='P')do you have an index on PS_UPA_EQ_DC_BAL.UPA_INC_TYPE column?
    reducing the number of rows returned in this step would be critical to speed up the NL join

  • Crystal Report doesn't prompt for SAP credentials / errors out on refresh

    2 Environments tested with same results:
    <p>
    BOE XI 3.1 SP2 & BOE XI 3.1 SP2 FP2.5<br>
    SAP Intg Kit on mirrored SP/FP levels in each environment.
    <p>
    We've been successfully creating Crystal Reports against BEx queries in BW for months now as well as ECC master data.  We've also built universes and have WebI reports actively working against similar BEx queries in the same.  However, we're getting some curious behavior when we refresh the Crystal Reports against BEx queries in BW.  Verified all necessary transports and authorizations have been provided for both authoring, as well as refreshing/viewing on demand, etc.
    <p>
    We've setup all the Crystal Reports we're testing to:
    <p>
    a) Use custom database logon information specified here.<br>
    b) Specify a custom driver, leveraging the crdb_bwmdx driver<br>
    c) Prompt the user for database login
    <p>
    We have not enabled SNC as of yet.
    <p>
    1) When we refresh a WebI report hitting a BEx query with security applied, it doesn't prompt for the credentials, but we confirmed through tracing on the SAP side that if the user hits a paramater it has access to, the data comes through and when we hit a paramater they do not have access to, we can clearly see SAP reject it and it spits out a logical error on the BO side in InfoView and in the WebI logs on the BO server. 
    <p>
    2) When we refresh a Crystal Report hitting ECC data, we are prompted for the SAP credentials and everything works as expected
    <p>
    However:
    <p>
    3) When we refresh a Crystal Report hitting a BEx query in BW, we are not promtped for SAP credentials.  We immediately get the "LOV" prompts.  Now, if we use a test user in SAP that has NO SECURITY restrictions at all and open access to the query, the data comes through.  However, as soon as any security is applied to the query level, even if it is SAP ALL, we cannot retrieve the data.  Tracing is also strange, as we can see on the SAP side it buffer the selected paramaters, but unlike with the WebI reports, it never shows it reaching the point where it checks each paramater against what the role has access to.  An error is then spit back.  We run the same queries with the same users within SAP and get normal behavior.  It's as though as soon as we apply security to the query the mdx driver doesn't like it.  Dependant on the type of InfoView viewer we use, the errors we consistently get on the BO side are:
    <p>
    Interactive Viewer: "Error in File %reportname%: Encapsulating Page Failed"<br>
    Java Viewer:  "Error in File %reportname%: Database Connection Error"
    <p>
    Nothing glaring in the event logs on the BO servers or in the Crystal logs that I can see, however just because it isn't spitting a specific error in the crystal logs doesn't mean I'm not missing something because I don't know what to look for behavior wise. To reduce the liklihood that it has to do with the way the report was built, we've tried against the same query by building a report using standard methods, as well as the SAP Toolbar using a very plain jane report.  Same behavior.
    <p>
    Thoughts?
    Edited by: Jay Riddle on Mar 1, 2010 8:55 PM

    Hi,
    1) When we refresh a WebI report hitting a BEx query with security applied, it doesn't prompt for the credentials, but we confirmed through tracing on the SAP side that if the user hits a paramater it has access to, the data comes through and when we hit a paramater they do not have access to, we can clearly see SAP reject it and it spits out a logical error on the BO side in InfoView and in the WebI logs on the BO server.
    >> Which authentication are you using to logon to InfoView ? Whats the configuration in the Universe Connection for Authentication ?
    2) When we refresh a Crystal Report hitting ECC data, we are prompted for the SAP credentials and everything works as expected
    >> The user is using which authentication ? and against which system does he log on ?
    However:
    3) When we refresh a Crystal Report hitting a BEx query in BW, we are not promtped for SAP credentials. We immediately get the "LOV" prompts. Now, if we use a test user in SAP that has NO SECURITY restrictions at all and open access to the query, the data comes through. However, as soon as any security is applied to the query level, even if it is SAP ALL, we cannot retrieve the data. Tracing is also strange, as we can see on the SAP side it buffer the selected paramaters, but unlike with the WebI reports, it never shows it reaching the point where it checks each paramater against what the role has access to. An error is then spit back. We run the same queries with the same users within SAP and get normal behavior. It's as though as soon as we apply security to the query the mdx driver doesn't like it. Dependant on the type of InfoView viewer we use, the errors we consistently get on the BO side are:
    >> The user is using which authentication ? and against which system does he log on ?
    >> You mentioned security restrictions and I assume we talk about BI authorizations in form of data level security. If so - does the BW query include the authorization variables ?
    Ingo

  • Passing two values in a column prompt for display and filtering

    Hi All,
    Is there a workaround to use two columns in a prompt for display and passing the input value for a prompt value in dashboard prompt? For eg we want to display the description in the prompt but pass the id to the filter value or presentation variable, just like we have in bi publisher,LOV automatically grab the two value for display and actual value to pass to the query.Therefore, user will click the description and corresponding id will be saved in presentation variable from the prompt .
    Thanks,
    Sushil
    Edited by: 872073 on Apr 5, 2013 11:06 AM

    Check this
    http://www.rittmanmead.com/2010/08/oracle-bi-ee-11g-handling-double-columns-iddescription-interoperability/

  • Using prompts with SQL query

    Post Author: wleonetti
    CA Forum: Crystal Reports
    Hello!
    I have acquired a report from our regional headquarters, and have been asked locally to add a prompt to one that already exists in the report.
    The report currently uses an SQL query, which in turn uses a single prompt to limit the data reported. However, the name of the parameter in the Field Explorer in Parameter Fields is "Facility", but, when I use the Database Expert and select edit for the query (under Selected Tables, right-click on "Command" under the database and click on "Edit Command"--is Command a default name?), under the Parameter List, the name of the parameter there is "Facility1" (?). The SQL references the parameter "Facility1" (...like '{?Facility1}'), but I cannot find any link/interface between the Parameter List "Facility1" to the Parameter Field "Facility", and I cannot find any other references to "Facility1" anywhere else in the report (sorry, I'm very new at CR, and am not sure how to do a global search of a desired text string in the reports).
    I have asked the author for an explanation, but he would only offer, after indicating that he ... was not obligated to help me in any way .., the following bone: "I just simply rename the parameter in Command from Facility1 to Facility which bears the same name as the parameter interface and it just works fine." This only served to confuse me more, since the parameter name currently in Command is  "Facility1" (and the report works the way it is)--when I change the name of the parameter in Parameter List (and the parameter name in the SQL query) to "Facility" (to match the Parameter Field's "Facility"?) ... the parameter in the Parameter Fields ... disappears?
    Can someone please instruct me how to, in whatever steps are necessary, add a parameter to the Parameter Fields and edit the SQL code to use that parameter? or point me to some documentation that will help me with this?
    Thanks in advance for any help offered.
    wleonetti

    Hi Eric,
    Try expressing the source as this:
    begin
       return functionname(to_date('30-sep-2010', 'dd-mon-yyyy'));
    end;That works fine for me, and if I take out the begin-end and the trailing semicolon from the return statement I get the same behavior as you.
    It does mention in the help for the source (only during the wizard though) that this source type has to be expressed that way, but I agree it would be helpful if the tool would validate for this format when 'Function Returning SQL Query' is used or give some sort of indication of the trouble. Anyway, this should get you going again.
    Hope this helps,
    John
    If you find this information useful, please remember to mark the post "helpful" or "correct" so that others may benefit as well.

Maybe you are looking for