Made with multi date columns to the dimension of time

Hello world

First let see my script:

I have the control panel with these columns

order_no (int),

create_date (date),

approve_date (date)

close_Date (date)

----

I have a time hierarchy dimension: time

I want to see at the time of the hierarchy, how many orders created, approved and closed for each time part(year,quarter,month,..) as below:

Date | created | approved | closed

————————————————------------------------

2007-1st quarter | 50. 40         | 30

2007 - q2 | 60. 20         | 10

Q3-2007 | 10. 14         | 11

2007-4th quarter | 67. 28         | 22

Q1-2008 | 20. 13         | 8

Q2-2008 | 55. 25         | 20

Q3-2008 | 75. 35         | 20

Q4-2008 | 90. 20         | 2

My solution:

Physical layer;

1. I create an order f alias as the fact table for the roll of the order

2 i joined f-ordered with d-time (time alias) on f_order.created_Date = d - time.day_id

3 - I added 2 logical column with the formula of the measures:

Sum aggregation is_approved(If approve_date= THEN 0 else 1)

Sum aggregation is_closed(If closed_date= THEN 0 else 1)

order_no (will use to measure aggregation created County

When I create the report in analytics in the generated query he used created_date and this isn't what I expected!

What is the best solution?

1-

If I have to create 3 is of the order: f_order_created, f_order_approved, f_order_closed and join each other on these columns d-time?

f_order_created.created_Date = d - time.day_id

f_order_approved.approved_Date = d - time.day_id

f_order_closed.closed_Date = d - time.day_id

2-do you create my fine measure?

Hello anonymous user,.

The approach with three done alias that you then use in three separate sources of logical table for your logical fact is the right one. This way, you keep canonical once and did do the role play.

So you won't need to 3 facts in the layer of logic that you ask above, but only 3 LTS. Physically, you need 3 alias joined the dimension of time with the join specifications you mention of course.

PS: Jeff wrote about this a few years if you want to take a look.

Tags: Business Intelligence

Similar Questions

  • sum of a column of the dimension

    Hello
    If my requirement of report said we get SUM (Treasury of column) of the dimension table then can we do it? I have undersatnd that function must be used for measures in fact table. What are we doing to reach the sum of the columns in the dimension table? The report tries to compare the sum (column done) sum (dimension columns). Earlier when I used the sum on the column dimension function he gave no precise results. Please advice.

    Unfortunately, I could not explain this matter in a simple unique way, without seeing exactly the report and generated queries

    In the simple table, OBIEE is supposed to do something like this (I assume you put the attribute of the year, money and a measure of 'real')

    "+ select +".
    + Year +.
    + Sum (cash) +.
    + Sum (fact measure) +.

    + Of +.
    + time_dim_table, +.
    + cash_dim_table, +.
    + fact_table +.

    + where (joins).
    + Group by year +.
    "

    You can check if the physical demand looks like this, in order to understand the results.

    In the PivotTable, it's totally different.
    Your physical demand will be no aggregation: so what will:

    "+ select +".
    + Year +.
    + Cash +.
    + Sum (fact measure) +.

    + Of +.
    + time_dim_table, +.
    + cash_dim_table, +.
    + fact_table +.

    + where (joins).
    + Group by year, money +.
    "

    But, OBIEE then apply logic calculatiosn to display goods results in the PivotTable.
    Who can explain the different results.

    But don't forget that told you right: avoid the aggregation on the dimension attributes. You can sometimes has good results (ex: using the pivot, or other), but it's not really the best way to make your reports. If you often need a "sum (cash"), create a new table of logic made with the 'picture of cash' (even if it is also a dimension table).

  • Helps the model clause. Date field in the Dimension

    Hello, all.

    I'm having a problem with the clause type in my query. In my view, it may be a misunderstanding on my part, but I can't find any documentation that is opposed to the use of the date fields in the dimensions of my model.

    Given these data;
    LOGDATE               SHIFTNAME  BUILDING  UNIT  DOORNUMBER  INOUT    EVENTCOUNT
    2012-02-01 06:00:00      A        1800      R      Door 4     Out         14
    2012-02-01 06:00:00      A        1800      R      Door 4     In          15
    2012-02-01 18:00:00      D        1800      R      Door 4     Out         17
    2012-02-01 18:00:00      D        1800      R      Door 4     In          19
    2012-02-02 06:00:00      A        1800      R      Door 4     Out         14
    2012-02-02 06:00:00      A        1800      R      Door 4     In          14
    ...
    I write my SQL like this:
    SELECT logdate, shiftname, building, unit, doornumber, inout, eventcount
      FROM door_events
     WHERE building='1800' AND unit='R' AND doornumber=4
     MODEL DIMENSION BY (logdate, shiftname, building, unit, doornumber, inout)
           MEASURES (eventcount)
          RULES ()
    And I get the expected result. (The same table as above) But when I try to add rows using rules, I get no new line until the LOGDATE field is a date. For example, by using this code, I expect to get a new line, with a 100 EVENTCOUNT (and other fields as written) but I stiill get the same set of data (no line is added)
    SELECT logdate, shiftname, building, unit, doornumber, inout, eventcount
      FROM door_events
     WHERE building='1800' AND unit='R' AND doornumber=4
     MODEL DIMENSION BY (logdate, shiftname, building, unit, doornumber, inout)
           MEASURES (eventcount)
           RULES (eventcount[SYSDATE,'X','1800','R',4,'In'=100)
    However, when I turn the LOGDATE field in a CHAR data type (and make the SYSDATE a TANK in the same way) with the code below, all of a sudden I get the line I was expecting!
    SELECT TO_CHAR(logdate,'YYYY-MM-DD HH24:MI:SS') logdate, shiftname, building, unit, doornumber, inout, eventcount
      FROM door_events
     WHERE building='1800' AND unit='R' AND doornumber=4
     MODEL DIMENSION BY (logdate, shiftname, building, unit, doornumber, inout)
           MEASURES (eventcount)
           RULES (eventcount[TO_CHAR(SYSDATE,'YYYY-MM-DD HH24:MI:SS'),'X','1800','R',4,'In'=100)
    
    
    LOGDATE               SHIFTNAME  BUILDING  UNIT  DOORNUMBER  INOUT    EVENTCOUNT
    2012-02-01 06:00:00      A        1800      R      Door 4     Out         14
    2012-02-01 06:00:00      A        1800      R      Door 4     In          15
    2012-02-01 18:00:00      D        1800      R      Door 4     Out         17
    2012-02-01 18:00:00      D        1800      R      Door 4     In          19
    2012-02-02 06:00:00      A        1800      R      Door 4     Out         14
    2012-02-02 06:00:00      A        1800      R      Door 4     In          14
    ...
    2012-02-07 15:18:33      X        1800      R      Door 4     In          100
    Can someone explain this behavior? I intend to do some calculations on the LOGDATE dimension and I would like to keep it as a date. Thanks in advance for any help!

    I do not get the same result. When I use SYSDATE, I don't get the extra line. When I use TO_CHAR (SYDATE...) as you say, I still don't get the extra line.

    However, when I use a constant date, such as TO_DATE (' 2012/02/07 02:00 ',' YYYY-MM-DD HH24:MI:SS'), then I get the extra line.

    This behavior is described in http://docs.oracle.com/cd/E11882_01/server.112/e25554/sqlmodel.htm#BEIGGGFJ

    «Using UPSERT creates a new cell corresponding to that referenced on the left-hand side of the rule when the cell is absent, and the cell reference contains only positional references * qualified constants *.»

    Best regards, stew Ashton

    P.S. "Oracle Database 11g Enterprise Edition Release 11.2.0.2.0.

    Published by: stew Ashton on 7 February 2012 23:03

  • How to insert the date column for the new line of adf BC tester.

    Hello

    JDeveloper version 11.1.1.5.0

    I have a table with a DATE column. I'm trying to insert a new row in the table of the BC ADF tester. While providing a value for the DATE column, I am struck the below error:

    (oracle.jbo.domain.DataCreationException) Houston-25009: failed to create an object of type: oracle.jbo.domain.Date type: java.lang.String with value: 2011/12/06

    Please let me know what should be the format to specify the date when inserting input value using the tester of BC.

    Thank you
    Rouhaud

    Roudier,
    You can determine the format of date by yourself.
    in your entity object select the attribute, click on edit, go to the control indicators, the Format type, select Date Simple
    and in the format field, you can enter the format you need
    as YYYY/MM/DD

  • Problems with sorting of columns and the number of lines in the report

    Hello

    I'm having a problem with sorting of columns and the number of lines displayed in a report.

    This report displays the data correct, but if I try to sort on a column when I click on the column heading in the report returns no line... I need to click on the "go" button to refresh the report (with the column sorted now) in to display the data.

    Similarly, I display only 15 lines per page. If I try to view the lines 16-30, 31-45, etc., that it returns no line until I click on the 'go' button to refresh again.

    Has anyone else had (and overcome) the same problem?

    Thank you

    Joseph

    Joseph,

    2 questions:

    1) are you using the elements referenced by the report page to filter etc.. ? If so, you're failing values of these when the loading of the page?
    (2) are you using PPR page through the results?

    If so, it could be a problem with the different types of session state, as Anton Nielsen blogged about here:
    http://c2anton.blogspot.com/2008/12/Oracle-Application-Express-Apex-three.html

    If so, you can use calculations or processes to set element values in session state persistent during page rendering, as Anton mentions. In this way, when you use PPR page values will be available in session state and your report should work fine.

    Anthony.

  • date fill in the dimension with the correct values

    Hi all

    I have a 'simple' problem, but can't get it resolved! The calculations of the CDA in the cube not 'reset' at the right moment in time (they should 'reset' on the exercise, but it actually seems to happen on the normal calendar year).

    Our dimensions and cubes are MOLAP. There is a relational table that contains columns with values for both a calendar hierarchy as well as a hierarchy of exercise. This table tells the date dimension (only the tax hierarchy as MOLAP, we have just a fiscal hierarchy). The result seems correct in the data viewer.

    The cube is filled with both relational sources. A perspective provides the measurement values and CODE (distinctive signs of business) values for each dimension involved. In the case of the date dimension, it provides the code for the involved level value in which we cube (months).

    I made a very simple testcase with only 1 dimension (date) and 1 small cube. The cube uses only the dimesion of date (to load the cube on the fiscal hierarchy at the month level) and has 1 base measure that is loaded with a simple number and 1 calculated measure that calculates the value of the CDA for this basic measure. The calculated measure is added to the cube designer OWB by using the button 'generate calculated measures' and choosing the function 'Year to Date'.

    When complete the cube and using the data viewer to verify the results, CDA values don't 'reset' at the end of the year. They seem to reset at the end of the normal calendar year!
    After some tests, I have concluded that this has to do with the values I provide to fill the date dimension, but I can't figure out what should be the change, and I can't find examples anywhere.

    Someone out there a calculation for a YEAR of work in MOLAP?

    Any help much appreciated.
    Kind regards
    Ed

    Hi Ed

    It can be an inherent behavior of the time dimension in the AWs where the CDA on financial is not supported out of the box, see the OLAP thread below. Have you tried just build your simple case in AWM recreate? If you can get around using a custom expression, you should be able to define this custom OWB and still keep the design you have.

    Calculated against calendar CDA CDA tax measure

    See you soon
    David

  • How to calculate the difference between a Date column and the Date yesterday in the analysis (in the formula in the column)

    . For example, I need to calculate the difference between a date column, 'Table_Name '. "' Column_Name ' and (Current_Date-1). I tried different ways to do this. But nothing seems to work.

    Try the below formula.

    Replace "Time". "" Date "with your column.

    TIMESTAMPDIFF (SQL_TSI_DAY, "Time". "Date", TIMESTAMPADD (SQL_TSI_DAY-1, CURRENT_DATE))

    Thank you!

  • ADF table filter - date column - in the table data type is timestamp

    Hello

    I want to filter adf table based on the time stamp column, but unable to do so.

    Details.

    1. The data type of the column (dateAdded) in the database is timestamp.
    2. the type of this column in the mode attribute is oracle.jbo.domain.Timestamp. and the format is DD/MM/YYYY
    3. the part of the code in my page jspx is

    < af:column sortProperty = filterable "DateAdded" = "true" width = '80' sortable = "true" headerText = "creation Date" id = "c6" >

    < f: facet = name 'filter' >

    < af:inputDate value = "#{vs.filterCriteria.DateAdded}" id = "id1" > "

    < af:convertDateTime pattern = "dd/MM/yyyy" / >

    < / af:inputDate >

    < / f: facet >

    < af:outputText value = "#{rank." DateAdded}"id ="ot5">

    < af:convertDateTime pattern = "#{bindings." MYCASE_CONS_VO1.hints.DateAdded.format}"/ >

    < / af:outputText >

    < / af:column >

    4. everything by filtering this field giving entered in the format DD/Mm/yyyy, the query runs but no change in the result (the value of this field in the table lavel is 10.54.16.000000000 18 June 14 h)

    Note: In the interface user, the value of the field is display in the format DD/MM/YYYY.

    Please feel free to ask me questions. Enjoy for little help.

    Thank you

    ASIS

    You can try with that mentioned in the link:

    http://dkleppinger.blogspot.in/2011/09/how-to-ignore-time-component-of-date.html

    Date query shows no results for the date of the day

  • Compare a column varchar2 with a date column segment


    Dear all,

    I have a column with the data type varchar2 with the sample of data such as segment ' 2013/06/09 00:00:00 ', I want to compare this column by date column

    I tried many ways to conversion but does not like

    Select to_date (TO_NCHAR (substr (' 2013/06/09 00:00:00 ',1 11),' DD-MM-YY '))DATE_C of double-> giving invalid number

    Select TO_TIMESTAMP (TO_NCHAR (substr (' 2013/06/09 00:00:00 ',1 11),' DD-MM-YY '))DATE_C of double-> giving invalid number

    Can I have any suggestion for this please

    Thank you and best regards

    Hello

    Use something like this:

    Select to_date (' ' 2013/06/09 00:00:00 ', ' DD/MM/RRRR HH24:MI:SS') twice;

    Thank you &

    Best regards

  • Columns in the dimension fact table

    OBIEE, can we use a column of fact in the related dimension table where this column is only a description column? Well Yes, I know that use columns of fact indeed and volumetric size... But what exactly will question if we do? I have observed in one model... No data connection was there to test...

    Hi Hari,

    Why you cannot create two tables MDB is as a fact and DIM and place all the columns in the description of Sun and measures actually?

    in this way, you should reach patterns star in MDB

    http://www.varanasisaichand.com/2012/04/fact-and-dimension-from-single-source.html  (2nd method)

    Thank you

    Angelique

  • 2 data columns of the worksheet in the indicator and a FFT

    Description of the problem:

    I have ben far from labview for many years. Now I am taking 2 data worksheet columns, read them in the 'read delimited spreadsheet vi', and view the two columns on the façade of my
    VI. I can get only one column to display.

    so I want to draw the power spectrum of these data without having to use additional
    loops, arrays, etc.

    LabVIEW is an example vi that is half of what I want to do

    (Amplitude of the spectrum (sim) .vi).  The spectrum analysis is performed using the entries from a signal generator vi instead of reading of a worksheet.  Also the (Amplitude of the spectrum (sim) .vi uses a real world vi which produces an index of time for the x axis.  It also adds noise to the data, to which I do not.

    I see the problem.

    Your delimiter for the file playback.  You show a comma, but it is actually a comma and tab in there.

    Right-click, then set it to \codes see of display style.

    Delete the content of this constant and re-enter the comma.

  • interactive report - highlight a line based on the date column in the past

    We have an interactive report that shows an expiration date. We want to emphasize the lines when this date is in the past.

    How is that possible?

    Best regards, Nann

    Hi Nann,

    Add the below css in the HTML of the page header

    
    

    Kind regards
    Shijesh

    You can reward this answer marking it as useful or Correct ;)

  • Flashback data archive commit the performance of time - a bug problem?

    Hi all

    I use the Oracle 11 g R2 on 64-bit windows environment. I just want to do some tests quue flashback data archive. I created one and add to a table. about 1.8 million records is to exist in this table. Furthermore, this table is one of the examples of oracle, SH. SALEStables. I created another table using the table and insert the same data twice.
    -- not a SH session
    
    Create Table Sales as select * from sh.sales;
    
    insert into sales select * from sh.sales;
    Commit;
    insert operation takes a few seconds. sometimes, in this code, validation command takes more of * 20 *, sometimes 0 seconds. If validation time is brief after insert, can I update the table and then validate again:
    update sales set prod_id = prod_id; -- update with same data
    commit;
    update takes a few seconds longer. If the first commit (after integration) has had too little time, second validation, after the update, takes more than 20 minutes. At this time, while that commit were working, my cpu becomes overloaded, 100% charge.

    the system that oracle runs on is good for quest staff use, i7 4 real core cpu, 8 GB ram, disk SSD etc.

    When I looked at the Business Manager - performance monitoring, I saw this SQL in my sql album list:
    insert /*+ append */ into SYS_MFBA_NHIST_74847  select /*+ leading(r) 
             use_nl(v)  PARALLEL(r,DEFAULT) PARALLEL(v,DEFAULT)  */ v.ROWID "RID", 
             v.VERSIONS_STARTSCN "STARTSCN",  v.VERSIONS_ENDSCN "ENDSCN", 
             v.VERSIONS_XID "XID" ,v.VERSIONS_OPERATION "OPERATION",  v.PROD_ID 
             "PROD_ID",  v.CUST_ID "CUST_ID",  v.TIME_ID "TIME_ID",  v.CHANNEL_ID 
             "CHANNEL_ID",  v.PROMO_ID "PROMO_ID",  v.QUANTITY_SOLD 
             "QUANTITY_SOLD",  v.AMOUNT_SOLD "AMOUNT_SOLD"  from SYS_MFBA_NROW r, 
             SYS.SALES versions between SCN :1 and MAXVALUE v where v.ROWID = 
             r.rid
    This consumes my resources for more than 20 minutes. what I do is, just an update 1.8 milion records (which use update is really takes little time) and validation (which kills my system).

    What is the reason for this?

    Info:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    PL/SQL Release 11.2.0.1.0 - Production
    CORE    11.2.0.1.0      Production
    TNS for 64-bit Windows: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production

    I see that in the example of Guy Harrison the SYS_MFBA_NROW table contains a very large number of lines - and the query is forced into a loop of neste join on this table (as is your query). In your case the nested loop is a vision (and there is no sign of a current "pushed" predicate.

    If you have a very large number of rows in the table, the resulting code is bound to be slow. To check, I suggest your run the test again (from scratch) with active sql_trace or statistics_level defined at all so that you can get the rowsource for the query execution statistics and check where the time is being spent and where the volume is displayed. You will have to call this one in Oracle - if this observation is correct that FBDA is only for OLTP systems, no DSS or DW.

    Concerning
    Jonathan Lewis

  • Problem with "Filling space" described in the Blog of Tim

    Dear Experts,
    I use the invoice template described in the excellent Blog of Tim Dexter (Anatomy of a model) to produce my own version. However, I have problems with the 'fill' space as described here: http://blogs.oracle.com/xmlpublisher/2007/03/anatomy_of_a_template_ii_heade.html

    My model is almost identical to the example, when I import XML data when there is only a single folder, fill space have not not cushion with enough blank lines so that the Total of the table at the bottom of the page, does not correspond with the watermark that I. The code in the field "Fill the space" is as in the Blog:

    <? If: not (count ($invLines) mod $lpp = 0) and ($start + $lpp > count ($invLines))? > <? for each: $invLines? > <? If: position() < $lpp - (count ($invLines) mod $lpp)? >


    If the number of records is greater than half a page or more, then the padding is correct. This is even if the word to say on the third page, it is a single record. Therefore, it seems that the padding does not work if the number of records is less than half a page total.

    Is this correct and what someone have a solution - would be greatly appreciated.

    Thank you very much
    Mark

    Hi Mark,

    I had problems with this earlier. See the comments on the bottom of the blog post you linked to above. The problem is down to the filling loop is a variable containing the invoice-based. If the number of invoices in this recordset is not sufficient to provide all the required filling lines, the formatting goes belly up.

    For loop in the XSLT file, you must use models of void. I got it going with my report using the code here:

    http://www.IBM.com/developerWorks/library/x-tiploop.html

    Basically you call recursively model for the number of required fill lines. A lot of effort but far as I could tell, the only solution given the available technology.

    I hope this helps.

    Jon.

  • Expulsion of objects based on the aging of the dimensions of time and no cache

    Hello
    II uses a cluster of coherence (extend) and wish to implement a policy of aviction for each object inserted into the cache.

    Documentation, I read I understand political custom eviction are ALL size based and not time based (way, expulsion is triggered when the cache is full and not hide when the aging of the affected object time).

    It there a way to implement these evictions?

    Hi Reem,

    When you say that you want to trigger my own code/class at this end of the cache item what exactly do you mean?

    1. don't you want to control what happened to expire?
    2. don't want to trigger a treatment when the entries are expired?

    If it is 2, then you can use a normal cache listener. In the entryDeleted of the MapListener method you can cast a delete the MapEvent isSynthetic CacheEvent and call that returns true if the event is due to expulsion or false if the event is due to a real.

    JK

Maybe you are looking for

  • Satellite P300D - 15 c is very slow to start WMI

    Hello My pc (Satellite P300D - 15 c) is very slow at startup.When I look in the newspaper, there is a WMI wich tooks 2 minutes East service delivered with an error. After that, my pc on the screen fr jumps 'welcom' starts normally. So I turn the WMI

  • Dock freezes on shut down

    I have a MacBook Pro mid-2015 retina and whenever I turned off the Mac, my dock freezes for a few seconds.  Video on the link below.  What is happening with anyone else? https://youtu.be/Q8HddWG6Bpo

  • Satellite P200 and new update of BIOS 1.70

    Hello Toshiba just released update 1.70 for their P200 model BIOS. Notice that I've seen is that the Logo has changed since in touch ith tomorrow at Toshiba leading an and the Intel logo is now black.haven't noticed all the new settings.

  • How to connect USB 6259 so that I can generate trains of pulses of a meter

    Hello We just bought NI USB-6259 BNC. We used to use BNC-2110, which integrates the connectors BNC for trigger and the meter so that we can send trains of pulses through it to our electric Stimulator. However, I find no terminal BNC for the output of

  • Number of a specific string format

    Colleagues Labview users, I'm quite familiar with Labview, but for some reason, I can't understand how to do the following: I need to format a number (a number) to a string of the form "mmmmee", where m is a number and 'ee' the exponential. For examp