Way to use Prompts , UDFs in Derived table

Hi guys,
In our org we have been using prompts in the derived tables. Derived table would return Single final select statement. Now that report requirements are complex we would have to use table variables, UDFs, and many select, delete, update statements. How should we handle many such statements in a derived table to return a result set for the report?
If we cannot handle many selects in a derived table, I am hoping to use Table-Valued Function in the derived table something like this:
create myFunction()
Returns Table as (......)
select * from myFunction()
But then I should be able to use the user input prompts in the syntax: @PROMPT('test1','A',Multi,,). The user would input 5 such prompts from the report.
Any ideas from anyone who has used Prompts, UDFs in a derived table?
Environment: BO X1r2, Crystal x1r2, sql server 2005
Thanks !

In the past, I have opted to create complex logic in a server-side procedure, complete with prompts.  The prompt are passed to and presented in Crystal.  This way, instead of splitting the logic between UDFs, derived tables and prompts, you can keep the logic in a relatively tidy procedure.

Similar Messages

  • How to use LOV on a derived table dependent on a prompt for Webi web intelligence view.

    The semantic layer has not created a defined LOV for the derived table.   This only happens when pulling columns from derived table which depends on a prompt for unique selection.  When pulling from derived table that does not depend on a date prompt does not have an issue in Webi.
    I don't know if this is a universe design issue or WEBI.
    Webi Rich internet application   selects the date prompt first but if click on Storeno in List it returns a LOV with auto refresh.
    Webi Web Intelligence returns  List of Values for current prompt requires values for following prompts:   and when you click to refresh  webi responds with 'undefined'

    Hi…
    Can you check Prompt : Store No is created at universe level and defined the syntax correctly
    @Prompt(1,2,3,4,5)  insert a prompts in SQL. When the user runs the query, the user is prompted to enter a value for a refresh each time.
    1 = 'Prompt Text Message'
    2 = 'Prompt Type'  (i.e. A,N,D,U)
    where A= Character, N= Number, D= Date, U= Unit.
    3 = 'Class Name/ Object Name'
    4 = 'Multi/ Mono'
    Multi means Multiple ( Example = 2004,2005,2011)
    Mono means Single ( Example = 2012)
    5 = Free/Constrain (Type value or select value in LOV/ Select Value)
    Example for creating a @prompt filter is below
    @Prompt('enter year','A','time period/year', Multi', Free)
    Pointer to a “List of Values” from an existing universe object. You invoke the target list of values by double-clicking on the object contain ing the list of values that you want to use in the "Classes and Objects" panel. This gives the Class name and the Object name, separate ed by a backslash. It must be enclosed in single quotes. For example: 'Client\Country'. When you are using “Index Awareness”, and you want to return the key values for an object,set the 5th value to primary_key
    • Hard-coded list of single values or value pairs. The values in a pair are separated by a colon. Each value is enclosed in single quotes. The pairs of values are separated by a comma. The whole list is enclosed in curly brackets. Set the constraint to primary_key
    http://www.businessobjectstips.com/tips/web-intelligence/prompt-functions-the-next-step-optional-prompts/

  • Invalid prompt Error in derived table

    hello All,
    I have the below query which works in SQL server...but the same query in derived table is giving invalid prompt error when instead of hardcoding the value...I gave  @prompt for user input value.
    SELECT
      convert(varchar(6), dateadd(MM,-3, convert(datetime, substring(cast(EMR_REPORTING.dbo.vMH_MEASURE_PRACTICE.RPT_YEAR_MONTH as varchar), 5,2) + '/' + '30' + '/'+ substring(cast(EMR_REPORTING.dbo.vMH_MEASURE_PRACTICE.RPT_YEAR_MONTH as varchar), 1,4))), 112) as prequarter,
      Primed_Status,
      EHR
    FROM
      EMR_REPORTING.dbo.vMH_MEASURE_PRACTICE
      where RPT_YEAR_MONTH = '201406'
    SELECT
      convert(varchar(6), dateadd(MM,-3, convert(datetime, substring(cast(EMR_REPORTING.dbo.vMH_MEASURE_PRACTICE.RPT_YEAR_MONTH as varchar), 5,2) + '/' + '30' + '/'+ substring(cast(EMR_REPORTING.dbo.vMH_MEASURE_PRACTICE.RPT_YEAR_MONTH as varchar), 1,4))), 112) as prequarter,
      Primed_Status,
      EHR
    FROM
      EMR_REPORTING.dbo.vMH_MEASURE_PRACTICE
      where RPT_YEAR_MONTH = @Prompt('Enter values for Rpt Year Month:','N','Folder\MeasurePractice\Rpt Year Month',Mono,Constrained)
    Thanks in advance for any inputs.
    Regards.

    Please check the Prompt definition and whether you are entering all the parameters in the prompt syntax.  As I could see there are only 5 parameters there in your prompt definitions

  • Ways to use the Content option in table sources

    how many ways we can use the (Logical table sources->Content tab).
    tell me in which situations we use the aggregation levels.are those only with detail tables?
    anybody explain me more elaborately?
    Edited by: user12077461 on Dec 31, 2010 6:16 AM

    In the content tab, you can configure in which (column or logical level) you want the aggregation to happen.
    For example you are dealing with sales, you can aggregate your results in the "sales per product level" or "sales per state level"
    In addition, you can also aggregate your results based on column summation.

  • Can we create prompts in Derived Table sql query

    Hi,
    I am trying to define derived table sql query as below. Though the syntax parsing is going through but when I am generating the report it is throwing and invalid prompt definition error.
    " select * from table_a where call_direction = @Prompt('Enter Call Direction','A','"derivedtable_a".SHORT_STRING',mono,free,not_persistent,) and
    where call_type = @Prompt('Enter Call Direction','A','"derivedtable_b".SHORT_STRING',mono,free,not_persistent,) "
    Can somebody please share your thoughts if this can be achieved in universe or not ?
    Appreciate immediate responses as it is a show stopper for my deliverable.
    Thanks in advance.
    Thanks and Regards,
    Shireen.

    Hi Shireen
    We can use prompt in the derived table. There is issue with the SQL that you have used while creating the Derived Table.
    Instead of using the "derivedtable_a".SHORT_STRING' field use the object from the class on which you are creating the derived table.
    For example: If you are creating a derived table in the sample universe efashion on Agg_yr_qt_rn_st_ln_ca_sr table then use the following query:
    SELECT *
    FROM Agg_yr_qt_rn_st_ln_ca_sr
    WHERE Agg_yr_qt_rn_st_ln_ca_sr.Yr = @Prompt ('Enter Value','C','Time Period\Year',mono,constrained)
    Hope this helps!
    Thanks

  • @prompt functions usage in Derived table

    How can we use prompt functions in Derived table?.Please repaly ASAP.
    Advanced thanks.
    Thanks&Regards
    Ramu

    Hi Ramu,
    It is quite straight foward.You define your derived table using the normal sql but then put in the @prompt code in the where clause.
    This worked for me in XI 3.0 using the Efashion universe.
    SELECT
    Article_Lookup_criteria.Article_Lookup_criteria_id,
    Article_Lookup_criteria.Article_criteria_id,
    Article_Lookup_criteria.criteria_type
    FROM
    Article_Lookup_criteria
    WHERE
    Article_Lookup_criteria.criteria_label = @prompt('Label,'A',,Mono,Free,Presistent)
    Regards
    Alan

  • IDT 4.1 - Derived Table Question

    Hello,
    I working on a project and I have hit a road block,  need your help...
    Scenario:  We have a Derived Table with multiple @prompts and I need to make this optional so that if the user does not answer any of the prompts the query should bring back results.  But I tried already tried using 'optional' in the @prompt syntax like below, this makes the prompts NOT mandatory but when user does not answer these prompts we DON'T get any results...
    @Prompt('Parameter Name','A',LOV,Multi,Constrained,Not_Persistent,,optional)
    Any ideas and thoughts are welcome !!
    Warm Regards,
    Manohar Singh

    This is how I I would go about debugging the issue, then.
    I would temporarily pull the result of the prompt into a column of the derived table (we'll call it derived table A), and then add a dimension which displays the value of that column. 
    Then I would add some sort of outer join (which generates a Cartesian product perhaps -- doesn't matter for debugging, though you may want to choose a small table!) between derived table A and another table (we'll call it 'table B').  Then create another dimension on 'table B'.
    Then I would run a query using the dimension from derived table A and the dimension from table B.  The outer join should always give a result and allow you to see what BO is actually substituting for the empty prompt value. 
    If you transform the empty prompt value somehow in one of your subqueries, you could take the transformed value and turn it into another dimension on derived table A.  Take it one step at a time this way and you'll eventually understand how the pieces are being put together.
    Good luck!

  • Derived table

    Plz re-Play
      @ functions,@ prompts @ awareness are using in Derived table

    Hi,
    You can use @functions, @Prompts, @awareness in Derived Tables.
    But
    ■Do not use derived tables instead of aggregate tables.
    And see the following site for full Information.....
    http://www.msatish.com/sap-businessobjects-designer-universe-using-derived-tables/
    All the Best,
    Madhu...

  • Is there a way to use Frame 8 keyboard shortcuts in 9?

    I understand that there is a new UI, but my coworker wants to remain on Frame 8 if he can't use the shortcuts he's been using for 15 years (muscle memory lasts a long time). Is there any way (a preference maybe) to use the F8 shortcuts? I saw a trick for scrolling through paragraph styles starting with the same letter using the down arrow. (Hello Adobe? It is not reasonable to suggest having headings names start with a unique letter. There are huge and current books that have all their tags already. And there are only but so many letters.) If there is no way to use F8, is there a table somewhere of what to do now?
    Thanks so much.
    jen

    quabbinjen wrote:
    So here are a few specific problems:
    1. Ctrl 8 and 9 make you use the down arrow key to cycle through letters. How would I change the ini file so that I could just keep hitting the letter?
    2. When I start typing something and then realize I've hit the wrong letter, it seems I need to backspace to the begining to correct it. I used to be able to just start up with the correct letter.
    3. Sometimes I hit Ctrl 9 and I do not get the small box where the style names display, I only see the arrow that I then need to mouse over to and click to list the styles. Why is that?
    4. If I accidently hit Ctrl 8 when I wanted 9 (for example), I have to hit escape and then start again. Previously, hitting the correct sequence twice would get me where I wanted.
    That's all I can think of now...I appreciate the assistance...jen
    The operation of the menu that opens with Ctrl+8 and similar commands has changed in recent releases. It's not clear if it's due to a bug or a design intention. You can ask for a bug fix or feature enhancement at Adobe - Feature Request/Bug Report Form.
    Search FrameMaker help for Keyboard Shortcuts for lists of useful shortcuts. Even if you open a menu with a different shortcut - say Escape q p, or Escape q c (quick paragraph or character format list) instead of Ctrl+8 or 9, the menu still misbehaves.
    I haven't tried typing a different shortcut with the Escape-key method, while in a "wrong" one, to see if that works as you remember the Ctrl+ method, but it's more keystrokes than typing Escape.
    It's not customizable in maker.ini.
    There are third-party keystroke recorder utilities that may be useful. For example, you could invoke a shortcut that opens a Ctrl+ or Escape-key menu, then types the specific command you want (without mis-typing) and executes it. Search for keystroke macro recorders on Google.
    HTH
    Regards,
    Peter
    Peter Gold
    KnowHow ProServices

  • Use_hash in derived table

    Is it possible to use use_hash in the derived table?
    I get a warning "Each calculated column must have an explicit name" if I include
    select /*+ use_hash(table_names) */.It parses ok  if I remove this line.Basically query runs for a long time without use_hash.
    Can somebody help me with this?

    Hi Me map,
    Thanks for your reply.
    The parsing is ok if I remove the first line after select "/*+ use_hash(Table1 Table2) */".
    My query is as follows:
    select /*+ use_hash(Table) */
      cus.name 
    etc.
    However when I edit the sql at the report level the query is running.

  • How do I use Derived Table to dynamically choose fact table

    How do I use the Derived Table functionality to dynamically choose a fact table?
    I am using BO XI R2 querying against Genesys Datamart kept in Oracle 10g.  The datamart contains aggregated fact tables at different levels (no_agg, hour, day, week, etc...) I would like to build my universe so that if the end user chooses a parameter to view reports at daily granularity, then the daily fact table is used;  choose hourly granularity, then hourly fact table is used, etc....
    I tried using dynamic SQL in Oracle Syntax, but Business Obljects Universe didn't like that type of coding.
    The tables look something like this:
    O_LOB1_NO_AGG o
    inner join V_LOB1_NO_AGG v on o.object_id = v.object_id
    inner join T_LOB1_NO_AGG t on v.timekey = t.timekey
    Likewise, in the 'hour', 'day', 'week', etc... fact tables, the Primary Key to Foreign Key names and relationships are the same.  And the columns in each O_, V_, T_ fact table is the same, or very similar (just aggregated at different levels of time).
    I was thinking of going a different route and using aggregate aware; but there are many Lines of Business (20+) and multiple time dimensions (7) and I believe aggregate aware would require me to place all relevant tables in the Universe as separate objects, which would create a large Universe with multiple table objects,  and not be maintenance-friendly. I also was going to dynamically choose Line of Business (LOB) in the derived tables, based on the end user choosing a parameter for LOB, but that is out-of-scope for my current question.  But that information sort of points you down the train of thought I am travelling. Thanks for any help you can provide!

    You can create a derived table containing a union like the following:
    select a,b,c from DailyFacts where (@prompt('View'....) = 'Daily' and (<rest of your where conditions here if necessary>)
    union
    (select a,b,c from MonthlyFacts where (@prompt('View'....) = 'Monthly' and (<rest of your where conditions here if necessary>))
    union
    (select a,b,c from YearlyFacts where (@prompt('View'....) = 'Yearly' and (<rest of your where conditions here if necessary>))
    I assume that you are familiar with the @prompt syntax
    Regards,
    Stratos

  • Does derived table use where clause fillters inside

    dear all.
    Table "A" has two cols aid and col1 , aid is pk.
    Table "B" has two cols  bid , aid , and colb .
    followin query can be formulated in other ways ,but i wanted to ask something about query processing.
    select aid,aa.ca,aa.cb
    from A
    left join
    (select aid, b.colb ca ,b1.colb  cb
     from A
    left join B on a.aid=b.aid and b.colb='r'
    left join B b1 on a.aid=b1.aid and b1.colb='e'
    ) aa
    where a.aid (1,2)
    i wanted to know if i put the where clause "where a.aid(1,2) in side derived table aa
    then will it change its plan in any case or it is sufficant to put where clasue in last
    or i should put the where clause in side the derive table "aa" also.
    yours sincerley

    Please post DDL, so that people do not have to guess what the keys, constraints, Declarative Referential Integrity, data types, etc. in your schema are. Learn how to follow ISO-11179 data element naming conventions and formatting rules. Temporal data should
    use ISO-8601 formats. Code should be in Standard SQL as much as possible and not local dialect. 
    This is minimal polite behavior ON SQL forums. Is your boss this rude to you?? 
    CREATE TABLE Alphas
    (alpha_id INTEGER NOT NULL PRIMARY KEY,
     col1 INTEGER NOT NULL);
    Thanks to your rude, poor narrative I have to guess about the second table: 
    CREATE TABLE Betas
    (beta_id INTEGER NOT NULL PRIMARY KEY, 
     alpha_id INTEGER NOT NULL
       REFERENCES Alphas(alpha_id), 
     colb CHAR(1) NOT NULL);
    Your query is awful. OUTER JOINs are rare in a properly designed schemA. The DRI should guarantee inner joins!  We seldom need to re-name columns. 
    >> I wanted to know if I put the where clause WHERE A.alpha_id(1,2) in side derived table aa <<
    That is not a syntactically invalid search condition; did you mean 
    “WHERE A.alpha_id IN (1,2)” ??
    Why did you de-normalize your results? My guess is that you can get the same data with this: 
    SELECT alpha_id, colb
      FROM Betas AS B
     WHERE colb IN ('r', 'e')
       AND alpha_id IN (1, 2);
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

  • NVL in prompt on date in derived table

    hi
    needed some help in derived table end date is bind variable data base is oracle
    like this how to apply prompt on this  if end Date =0 or no value could accept in prompt
    ch.endDate <= nvl(:end Date,ch.endDate)
    i've tried in report level but optional prompt is not available could you please help me out of this

    Hi
    derived table will not pass null values using @prompt
    use this formula
    To_date(CASE WHEN @prompt(':bind variabe','D',,mono,free,persistent,{'01/01/2099'}) = '01/01/2099' then to_char(ch.end_date) else @prompt(':bind variabe','D',,mono,free,persistent,{'01/01/2099'}) END)
    for only in this situation it will work ch.end_date=NVL(:end date,ch.end_date)
    thanks
    Ravi Kumar

  • Derived tables with prompts - based universe

    why can't I use derived tables with prompts - based universes on Dashboard Design 4.0? I mean I can add to Dashboard Design data coming from a universe like that but the prompts don't show in the query panel in Dashboard Design. Could it be becuase my universe was created first as an unv and then I transformed it to unx?

    Good day Yuvraj,
    Thank you for your response.
    Basically, I have 2 classes based on physical tables:
    Product (P); and
    Time/Calendar (T/C).
    Two classed based on derived tables:
    Stock on Hand (SoH); and
    Stock Movements (SM)
    The derived tables SQL code selects (Quantity and Selling Price) from the SoH table and joins to the T/C table with conditions and a Where clause to restrict the data output to the last 2 months (the same applies to the SM derived table).
    Example code below:
    SELECT  q.sm_table _no, q.tim_cal_no, q.quantity, q.selling_price
    FROM    tim_cal_table p,
                  sm_table q
    WHERE  q.tim_cal_no= p.tim_cal_no
    AND        p.day between to_char(sysdate - 60,'DD/MON/YY') and to_char(sysdate - 1,'DD/MON/YY');
    Now, the SoH table and the SM table are joined (in the universe schema) to the P table and T/C table using Primary Keys (which are shared by all the tables - physical and derived i.e. foreign keys on the SoH and SM tables used in the derived tables).
    Now to answer your questions:
    Do you get data in case you take objects only from derived table class?NO
    Does the columns used to join physical table and derived table has matching values? YES. I mean to say is the join getting satisfied? YES. Checked Universe Integrity - structure, objects, joins, conditions, loops, context and cardinalities - everything is OK.
    Adding to this, is the data type same for both the columns (on which join is set) or is there any typecasting required? YES - checked the data types of the primary/foreign keys that join the tables and they all match, except for one on the SM table -  the foreign key has 6 set for precision (instead of 5 as per the other columns), however the data type is Numeric so this shouldn't be an issue.
    I hope this helps to clarify the nature of the problem.
    Thank you.
    Regards,
    B

  • Any way to use filter to exclude tables in navagation pane?

    Is there any way to use filter to exclude a set of tables from the table list in the navagation pane? I have a number of tables (15+) starting with the same prefix eg. AB123 that I would like eliminate from the list. They sort right to the top and I always have to scroll down, and go through the show more dialog to see the entire list.
    I am sure I'm missing something, but not sure what. Help Center has nothing to offer.
    Thanks
    Glenn

    This has been mentioned on the forum before - basically the need for more elaborate ways to filter (multiple conditions as well as 'not like'). It is on our list for future consideration, meaning post-production.
    -- Sharon
    Message was edited by:
    sbkenned

Maybe you are looking for