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

Similar Messages

  • HT3354 how can i use one table for reference to another

    how can i use a table for a referance to another eg when i type a word in a cell, i will like it to match the word with another table then return the information in the cell i am using

    you can use vlookup() (or any of the lookup family of functions) to locate an item based on a key value:
    Here is an example of something you can do with two tables:
    The table on the right is title "Data" and stores a list of names with age and favorite color.
    The table on the left uses the value in the first column to lookup up information in the table Data
    in the table on the left:
    B2=IFERROR(A2&" is " & VLOOKUP(A2, Data :: A:D, 2, 0)&" years old and likes the color "& VLOOKUP(A2, Data :: A:D, 3, 0), "NOT FOUND")
    I know this look complicated.  so I'll break it up into smalled pieces:
    first the "&" is called the concatenate operator and joins two strings.  like this:
    a string is a set of characters between double quotes.
    so "string 1" & "string 2" becomes "string 1string2"  or "Sam " & "Jones" becomes "Sam Jones"
    you can use cell references instead of strings directly in which case the concatenation is performed on the contents of the cells.
    so if cell A1 contains "Hi " and the cell A2 contains "There"  then A1 & A2 will result in "Hi There"
    so you could add the formula
    A3=A1 & A2
    this is short hand for select cell A3 then type everything including the A3 so that A3 contains "=A1 & A2" (omit the double quote)
    OK.  So the formula I provided concatenates several items together:
    it concatenates A2, then the string " is " then a formula, then the string " years old and likes the color " then a formula
    the two formulas (highlighted in blue) perform a lookup of the value in cell A2 in columns A thru D of the table named "Data".  If if finds the value in cell A2 in the first column of the lookup range in the table Data (column A) then it returns the value from the same row but in the second or third column.
    all that is in a function calld iserror() to trap the condition where the calue you enter in A2 does not exist in the table Data:
    You will find the Numbers users guide and function reference helpful.  You can download then from Apple here:
    http://support.apple.com/manuals/#productivitysoftware

  • How to make use of Table Maintanance Generator?

    PLs sany one can explain me how to maek use of Table maintanance Generator?
    Regards and cheers,
    Giri

    Hi,
        table maintainence Generator is used to manually
        input values using transaction sm30
        follow below steps
       1) go to se11 check table maintanance check box under
          attributes tab
       2) utilities-table maintanance Generator->
          create function group and assign it under
          function group input box.
          also assign authorization group default &NC& .
       3)
        select standard recording routine radio in table
        table mainitainence generator to move table
        contents to quality and production by assigning
        it to request.
       4) select maintaience type as single step.
       5) maintainence screen as system generated numbers
          this dialog box appears when you click on create
         button
        6) save and activate table
       using sm30 you can create entries manually.
    also check below thread to assign transaction code to
    table generator
    /message/240993#240993 [original link is broken]
    0#2409930  
    Regards
    amole

  • How can I use PowerPivot tables like Excel tables -- printing, etc.?

    I can't seem to find any information on this anywhere, and even more surprisingly, no one else seems to have even asked this question...
    How can I use tables I create in the Excel PowerPivot window in the same ways I use tables that are in ordinary Excel worksheets, to accomplish tasks such as printing? I am able to use the powerful capabilities of PowerPivot to produce tables with precisely
    the information I need for reports -- connecting data from multiple tables/sources, filtering, etc. -- but then there doesn't seem to be any way to actually print what I'm seeing, nor can I seem to access cells in these PowerPivot tables from Excel worksheets.
    If a PowerPivot table is conceptually an Excel table with additional power in terms of pulling in data and relating it, it would seem appropriate that all the power of Excel could be brought to bear on these PowerPivot tables, but on the contrary, the available
    operations are limited. if, instead, a PowerPivot table is more correctly viewed as a data source that Excel worksheets can connect to, that would be fine, and indeed, one
    can use a PowerPivot table as a data source -- except it can't be brought into an Excel worksheet as an ordinary Excel table, unlike most other data sources.
    I hope I'm missing something really obvious, and that someone can point out what it is. Thanks.

    Kirchh,
    When PowerPivot was first designed, the decision was to integrate closely to Sharepoint to allow for team sharing. We are constantly evaluating customer feedback to add more features, and this has been one of the feedbacks we have received. We will consider
    supporting this in the future but with no gurantee.
    Chu
    -- This posting is provided "AS IS" with no warranties, and confers no rights
    I'm not questioning why PowerPivot is closely integrated with SharePoint. I'm asking why connecting to the PowerPivot model from within Excel was intentionally blocked by Microsoft, when all the functionality to do so appears to be present.
    Is creating an OLE DB connection in Excel to PowerPivot as $Embedded$ supported?
    No support. It was originally designed for SharePoint. This changed with Power Pivot for Excel 2013 (it's packaged with it). Originally the scope (in 2010 through 2012) was that it was for SharePoint users. So it became more obvious through that to market it
    toward all Excel users. Thus the recent changes. 
    Ed Price, Power BI & SQL Server Customer Program Manager (Blog,
    Small Basic,
    Wiki Ninjas,
    Wiki)
    Answer an interesting question?
    Create a wiki article about it!

  • How can I use Hash Table when processing the data from cdpos and cdhdr

    Hello Guru,
    I've a question,
    I need to reduce the access time to both cdhdr and cdpos.
    Because may be I'll get a huge number of entries.
    It looks like that by processing cdhdr and cdpos data will take many secondes,
    it depends on how many data you need to find.
    Hints : Putting instructions inside a form will slow down the program?
    Also, I just want use Hash table and I need to put a loop-instruction going on the hash-table in form.
    I know that it's no possible but I can declare an index inside my customized hash table.
    For example :
    DO
    READ TABLE FOR specific_hash_table WITH KEY TABLE oindex = d_oindex.
    Process data
    d_oindex += 1.
    UNTIL d_oindex = c_max_lines + 1.
    Doing this would actually not necessary improve the performance.
    Because It looks like I'm having a standard table, may be there's a hash function, but it could be a bad function.
    Also I need to use for example COUNT (*) to know how many lines I get with the select.
    FORM find_cdpos_data_with_loop
      TABLES
        i_otf_objcs TYPE STANDARD TABLE
      USING
        i_cdhdr_data TYPE HASHED TABLE
        i_objcl TYPE j_objnr
    *    i_obj_lst TYPE any
        i_option TYPE c
      CHANGING
        i_global TYPE STANDARD TABLE.
      " Hint: cdpos is a cluster-table
      CONSTANTS : objectid TYPE string VALUE 'objectid = i_obj_lst-objectid',
                  changenr TYPE string VALUE 'changenr = i_obj_lst-changenr',
                  tabname TYPE string VALUE 'tabname = i_otf_objcs-tablename',
                  tabnameo1 TYPE string VALUE 'tabname NE ''''',
                  tabnameo2 TYPE string VALUE 'tabname NE ''DRAD''',
                  fname TYPE string VALUE 'fname = i_otf_objcs-fieldname'.
      DATA : BEGIN OF i_object_list OCCURS 0,
                objectclas LIKE cdpos-objectclas,
                objectid LIKE cdpos-objectid,
                changenr LIKE cdpos-changenr,
             END OF i_object_list.
      DATA : i_cdpos LIKE TABLE OF i_object_list WITH HEADER LINE,
             i_obj_lst LIKE LINE OF i_cdpos.
      DATA : tabnamev2 TYPE string.
      IF i_option EQ 'X'.
        MOVE tabnameo2 TO tabnamev2.
      ELSE.
        MOVE tabnameo1 TO tabnamev2.
      ENDIF.
    *LOOP AT i_cdhdr_data TO i_obj_lst.
      SELECT objectclas objectid changenr
        INTO TABLE i_cdpos
        FROM cdpos
        FOR ALL ENTRIES IN i_otf_objcs
        WHERE objectclas = i_objcl AND
              (objectid) AND
              (changenr) AND
              (tabname) AND
              (tabnamev2) AND
              (fname).
      LOOP AT i_cdpos.
        APPEND i_cdpos-objectid TO i_global.
      ENDLOOP.
    *ENDLOOP.
    ENDFORM.                    "find_cdpos_data

    Hey Mart,
    This is what I met, unfortunately I get the same performance with for all entries.
    But with a lot of more code.
    FORM find_cdpos_data
      TABLES
        i_otf_objcs TYPE STANDARD TABLE
      USING
        i_objcl TYPE j_objnr
        i_obj_lst TYPE any
        i_option TYPE c
      CHANGING
        i_global TYPE STANDARD TABLE.
      " Hint: cdpos is a cluster-table
      CONSTANTS : objectid TYPE string VALUE 'objectid = i_obj_lst-objectid',
                  changenr TYPE string VALUE 'changenr = i_obj_lst-changenr',
                  tabname TYPE string VALUE 'tabname = i_otf_objcs-tablename',
                  tabnameo1 TYPE string VALUE 'tabname NE ''''',
                  tabnameo2 TYPE string VALUE 'tabname NE ''DRAD''',
                  fname TYPE string VALUE 'fname = i_otf_objcs-fieldname'.
    *  DATA : BEGIN OF i_object_list OCCURS 0,
    *            objectclas LIKE cdpos-objectclas,
    *            objectid LIKE cdpos-objectid,
    *            changenr LIKE cdpos-changenr,
    *         END OF i_object_list.
    ** complete modified code [begin]
      DATA : BEGIN OF i_object_list OCCURS 0,
                objectclas LIKE cdpos-objectclas,
                objectid LIKE cdpos-objectid,
                changenr LIKE cdpos-changenr,
                tabname LIKE cdpos-tabname,
                fname LIKE cdpos-fname,
             END OF i_object_list.
    ** complete modified code [end]
      DATA : i_cdpos LIKE TABLE OF i_object_list WITH HEADER LINE.
      DATA : tabnamev2 TYPE string.
    ** complete modified code [begin]
    FIELD-SYMBOLS : <otf> TYPE ANY,
                    <otf_field_tabname>,
                    <otf_field_fname>.
    ** complete modified code [end]
      IF i_option EQ 'X'.
        MOVE tabnameo2 TO tabnamev2.
      ELSE.
        MOVE tabnameo1 TO tabnamev2.
      ENDIF.
    **  SELECT objectclas objectid changenr
    **    INTO TABLE i_cdpos
    *  SELECT objectid
    *      APPENDING CORRESPONDING FIELDS OF TABLE i_global
    *      FROM cdpos
    *      FOR ALL ENTRIES IN i_otf_objcs
    *      WHERE objectclas = i_objcl AND
    *            (objectid) AND
    *            (changenr) AND
    *            (tabname) AND
    *            (tabnamev2) AND
    *            (fname).
    ** complete modified code [begin]
      SELECT objectid tabname fname
          INTO CORRESPONDING FIELDS OF TABLE i_cdpos
          FROM cdpos
          WHERE objectclas = i_objcl AND
                (objectid) AND
                (changenr) AND
                (tabnamev2).
    ASSIGN LOCAL COPY OF i_otf_objcs TO <otf>.
      LOOP AT i_cdpos.
      LOOP AT i_otf_objcs INTO <otf>.
       ASSIGN COMPONENT 'TABLENAME' OF STRUCTURE <otf> TO <otf_field_tabname>.
       ASSIGN COMPONENT 'FIELDNAME' OF STRUCTURE <otf> TO <otf_field_fname>.
        IF ( <otf_field_tabname>  EQ i_cdpos-tabname ) AND ( <otf_field_fname> EQ i_cdpos-fname ).
          APPEND i_cdpos-objectid TO i_global.
          RETURN.
        ENDIF.
      ENDLOOP.
      ENDLOOP.
    ** complete modified code [end]
    **  LOOP AT i_cdpos.
    **    APPEND i_cdpos-objectid TO i_global.
    **  ENDLOOP.
    ENDFORM.                    "find_cdpos_data

  • JPA - How can I use the table's default Date types? e.g. CURRENT_TIME

    Once again, can't find an answer anwhere.
    I would like to know if/how one can use the default date/time/datetime types as declared for the target table when attempting to persist an entity having these fields set as null.
    create table item
         item_id INTEGER NOT NULL PRIMARY KEY DEFAULT AUTOINCREMENT,
         date_created DATETIME NOT NULL DEFAULT NOW(*),
         date_updated DATETIME NOT NULL DEFAULT NOW(*),
    );Now how can I get the above table to work when attempting to em.persist(myItem) whereby dateCreated and dateUpdated are both null?

    I should also mention that TopLink has always supported the ability to retrieve the current time from the database for use in optimistic locking. The TimestampLockingPolicy offers the ability to configure the next value being retrieved from the database instead of using the local time from the JVM. Our extended optimistic locking configuration does not currently support setting this option but it could be done using a descriptor customizer which can be configured in your persistence unit properties.
    Using optimistic locking may be a good solution for the last modified date since it will also ensure that you do not corrupt the database if someone else has incremented this value since your last read.
    Doug

  • How can I use external tables with directories not on Oracle host?

    Oracle 11.2.0.2
    We have developers using C# to populate global temporary tables (two one header and detail with 1 to many relationbship between these two tables). The process of using C# was blowing up memory on Windows.
    As an alternative I requested them to create two CSV files and I can use sqlldr to load the detail CSV file of over 1 million rows under 15 seconds. It came to my mind that I could use external tables for this purpose with getting read of header and trailer from the CSV files.
    The issue I have is that I am not a DBA so I do not have access to OS host that Oracle instance is running. sqlldr is a client side tool, whereas external tables are server side. I was wondering if there is an alternative in 11g to use external tables without creating directories on the OS host that Oracle runs on? Are there other alternatives?
    Thanks

    905989 wrote:
    Oracle 11.2.0.2
    We have developers using C# to populate global temporary tables (two one header and detail with 1 to many relationbship between these two tables). The process of using C# was blowing up memory on Windows.
    As an alternative I requested them to create two CSV files and I can use sqlldr to load the detail CSV file of over 1 million rows under 15 seconds. It came to my mind that I could use external tables for this purpose with getting read of header and trailer from the CSV files.
    The issue I have is that I am not a DBA so I do not have access to OS host that Oracle instance is running. sqlldr is a client side tool, whereas external tables are server side. I was wondering if there is an alternative in 11g to use external tables without creating directories on the OS host that Oracle runs on? Are there other alternatives?
    Thanks
    no other alternative

  • How do we Use Internal table in Global Memory  ?

    Hi All ,
        Can anyone help me with how to create and use an internal table in SAP global memory ?
    Regards,
    Ranjita

    Hi,
    Try with GET PARAMETER AND SET PARAMETER
    Refer the below link,
    Export Import Internal tables across two z programs
    Regards,
    Vijay

  • How Find space Used by Tables and Indexes

    Dear All(s)
    How i check space used (and number of rows) by each table and index in schema. ( can i check current space utilization and sysdate-date past in time)
    How i can check used, and free space for each database and tablespace.
    Thanks

    You can always use the search feature
    anyway
    how to calculate the percentage of free space for a table in Oracle
    Re: incorrect free space in dba_free_space
    These links could give you all the necessary info

  • How can we use the table partitions feature and.........

    Hai friends when i tried to use the bitmap indexes and table partitions feature ,
    I got a message like this
    'table partiotion feature not enabled'
    so please tell me how can i enable those features so that i will be able to use those features..........

    Partitioning and Bitmap Indexes are features of Oracle Enterprise addition. In fact, I think that Partitioning is an extra option that needs to purchased with Oracle Enterprise - it is not a default feature.
    These features do not exist on Oracle Standard Edition (and likely Express Edition too).

  • How can we use C# to read dynamic parameter's value list from .rpt?

    I'm using Cystal Report 2008. We know starting from CR XI we can create dynamic parameters, the list of items of this kind of parameter are fetching from database. So in general the SQLs to get the list of values for dynamic parameters are stored in the .rpt.
    In Crystal Report Designer, if I preview a report with dynamic parameters, it will first query the database and then show the input dialog with list of values from database for user to choose. My question is can we implement the same thing by our C# code? I'm planning to use C# code to read this dynamic parameter's value list from .rpt and render them on the web page. Then pass back the user selected values to the .rpt to run the report after user make the choice. I didn't find any APIs can do this. Is it possible?
    Thanks in advance!!

    Hi,
    Can you explain a bit in detail, I have similar scenario. I am using the following code but not getting the Column name for dynamic parameter list.
    foreach (ParameterFieldDefinition prm
                              in reportDocument.DataDefinition.ParameterFields)
                    try
                        string vParameterFieldName;                   
                        *vParameterFieldName = prm.ParameterFieldName.ToString();*
    Shakeel

  • How can I use a table as source for scrolling text

    Hi,
    I have a javascript scolling news on our portal page and anytime I need to update the news I have to update the portlet. Is there a way to use a database table to store the news and get it displayed automatically (as a scrolling text) after committing the transaction.
    Thanks,
    Leonard

    What do you mean by updating the portlet - page refresh?
    The nature of HTTP is that the client has to initiate the communication. As long as the browser doesn't submit a new request for the page, the content won't refresh.
    There are tricks, though that you may consider... such as placing an iframe on your portal page that "pings" the server and checks whether there's any change on the server side. Another option could be using an applet.

  • How to properly use H-T-D Dynamic Time Series Function

    Hello all.
    Our Period Dimension goes like default
    Period
    -Year Total
    --Qtr1
    ---Jan
    etc..
    Now when I set up HTD (lack of any explanation on the Documentation)
    I put the generation to Level 2. The function pretty much does what YTD does, sums up the total for hte year given the current month. What we want to try and accomplish is get values summed from the very first data saved to the current datal current. Now this can't happen since years are in a differnet dimension. So my main question is. Is this possible to do? and what is the main function of H-T-D? Thank you.

    HTD or History to date is meant for when you have a single time dimension with multiple years in it. If your outline liiked something like
    Years
    2008
    2008-q1
    2008-jan
    2008-feb
    2008-mar
    2008-Q4
    2008-Dec
    2009
    etc
    You could use set up qtd, ytd and htd and get totald for each.
    In your case if Years is in a separate dimension from periods, you would have to roll your own as formulas on created members. in either the period or year dimension (I'll guess the years dimension) where you add from my example 2008->period +( range of jan to the current member) look at sumrange and currmbrrange functions

  • How to use a Table View in AppleScriptObjC

    How can I use a table view and add data to it? And how can I display a button cell and image cell in the table? Thanks.

    Hi all,
    Actually i need some more clarification. How to use the same select statement, if i've to use the tabname in the where clause too?
    for ex : select * from (tab_name) where....?
    Can we do inner join on such select statements? If so how?
    Thanks & Regards,
    Mallik.

  • How can I use table control to enter data

    Hi all,
    I want to use table control to enter data, instead of using textboxes.
    So that the user can enter many data at once and just click the save button at the end of the work, only one click.
    How can I use the table control at this context?
    Thanks.
    Deniz.

    Hi deniz,
    go through it:
    /people/ravishankar.rajan/blog/2007/02/23/an-easier-way-of-displaying-and-editing-data-using-table-control
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/code%2bto%2bhandle%2bmultiple%2brecords%2bin%2bbdc%2btable%2bcontrol
    Regards,

Maybe you are looking for

  • Solution to problems synchronizing with Mercedes C...

    Warning: this is long but worths reading if you have trouble synchronizing your Nokia's phone book/addressbook with COMAND APS. I have spent hours looking on Mercedes and Nokia forums for my problem and did not find a posted solution. I have now foun

  • IPod Touch 3G in DFU Mode and won't come out

    Hello, My daughter's iPod Touch 3G appears to be in DFU mode, but won't come out. The screen is completely black, and when I attach it to the computer, it comes up with the message "iTunes had detected as an iPhone in recovery mode. You must restore

  • Reg: Hr/abap

    hello friends "To use logical database PNP in your program, specify in your program attributes". what i have to specify in the program attributes? i want to be clear

  • Is there a way to add a "proofing" page in iweb that is accessed by a password?

    I would like my clients to each be assigned their own password and access their proofs privately on my website. Any help would be appreciated! Thanks!

  • No joy with Dial-Up

    So when did the iTunes Store restrict downloads to high-speed internet connections only. I had problems downloading music, like I couldn't and now that I got DSL, everything is fine. Is that a new requirement now? Because I downloaded music before wi