Average of column with the format of date/time in the response of BI

Hello world

We working on the response of BI and training to get the average of the hours of work of departments. Work hours column is the Date in the database format, so we tried to converted to CHAR through the Cast function to modify columns in BI answers formula, and this gave us date "2007/09/01' as a result! We have also tried to throw the working hours for:

CAST (CHARACTER of WORK HOURS FORMAT AS 'yyyyMMdd-HHmmss')

NOTE: In working hours, we have null values...

work real hours to appear in the picture of the response is "01/07/2009-06:13.


How to get the column of working hours average on response BI?

Appreciate your help
Concerning

Published by: user817525 on July 21, 2009 23:15

No, u do not attend the general tab. you need to go to the Data Type and click the button change. you will see a list of logical column. In your case, you will need to find the logical column when u used to store your WorkingHour and click on the button with three love (close your logical column). Now you have expression builder where you put formula: EXTRACTS ("Ain_Access" TIME. "" "" Fact_Access '. "" Hours of work)

I hope this helps?

all best
Phoenix
Belgrade

Tags: Business Intelligence

Similar Questions

  • String column with some formats from date to date

    Hello!
    IM new in Oracle :)
    I need to convert a string column {VARCHAR2 (70 bytes)} to this day. But this column have some type os dates... I found three types:

    17/02/12 06:00:04, 403398 - 02:00
    19 MARCH 12 06.00.07.936287 AM - 03:00
    06:00:03:000 30/03/2012

    How can I convert this column to date? I have hours, just need the date...
    IM using Oracle 10 g.

    Thank you very much!

    EdStevens wrote:
    Someone better than me can probably provide some ideas on exactly how to analyze the current value of VARCHAR_DATE

    The fact is that any analysis fails for a date like 10/11/12.
    You have only one chance if you know for sure that the order of the months of the year and the day is always the same. otherwise you can only guess.

    If guess is good enough depends on the importance of the process of using it for the success of your business...

    Good bye
    DPT

  • help me create a column with the time format

    Hi all

    Please help me find the query to create a table with 3 columns and insert the following data

    ENTITYID | CHGDATE | CHGTIME

    ======= ==================== ========

    4214984 | 2 OCTOBER 06 12.00.00.000000 AM | 07:23:57

    4214985 | 12.00.00.000000 11-SEP-08 AM | 10:52:19

    and update of the first line of the above table as follows
    ---------------------
    4214984 | 2 OCTOBER 06 07.23.57.000000 AM | 07:23:57
    ------------------------
    you will need to update the CHGDATE column with the time of the CHGTIME column.

    Sorry, we need a new format around the to_date

    select to_date(to_char(chgdate, 'mm/dd/yyyy') || ' ' || to_char(chgtime, 'hh24:mi:ss'), 'mm/dd/yyyy hh24:mi:ss') from etime3;
    

    This should telll Oracle to the format of the generated string. If this isn't the case, run select with the to_char two as separate columns to see that get us the data that we expect.

  • Columns with the same name but different data or precision length.

    DB version: 10 gr 2

    In a diagram, I need to find all of the columns with the same name but different or precision data length (if the column is of type number). I know I have to use the USER_TAB_COLS view for this. But I need to find a logic to compare the names of columns and its lengths.

    something like

    select t1.table_name
         , t1.column_name
         , t1.data_type
         , t1.data_length
         , t2.table_name
         , t2.column_name
         , t2.data_type
         , t2.data_length
      from user_tab_columns t1
         , user_tab_columns t2
     where t1.table_name != t2.table_name
       and t1.column_name = t2.column_name
       and t1.data_type = t2.data_type
       and t1.data_length != t2.data_length
    

    ... could be a starting point.

  • [8i & 10g XE] How to compare a column with the text of a column with numbers

    This is probably a simple question, but I can't seem to find the answer. I tried variations on use to_number to_char and interpreters, all nothing will do.

    The real problem is that I have a table with a column of numbers in a database 8i (datatype = NUMBER (3)) and a column with the text (datatype = CHAR (3)), and I need to compare two values.

    This table has thousands of lines, but here's an example of the data in these two columns:
    TXT     CHR
    -----------
    001     1
    001     2
    002     2
    XXX     1
    003     3
    What I want to do is select the lines where the TXT and CHR VALUES do not match, then it would be (given my example):
    TXT     CHR
    -----------
    001     2
    XXX     1
    But, I'm having difficulties in comparing two columns, because they are not the same type of data.

    I tried to work on a simplified version of the problem in the 8i database both my 10g XE database:
    SELECT     *
    FROM     (
         SELECT     1.000               AS nbr
         ,     TO_CHAR(1.000,'000')     AS txt
         ,     CAST('001' AS CHAR(3))     AS chr
         FROM     dual
         )
    WHERE     txt = chr
    ;
    But this also returns any line, and it isn't even the "XXX" in the text column to treat in this example.

    Can someone help me understand what it is that I'm missing?

    Thank you!

    Hello

    user11033437 wrote:
    This is probably a simple question...

    Simple if you know the secret; maddening if you do not have.

    ... I tried to work on a simplified version of the problem in the 8i database both my 10g XE database:

    SELECT     *
    FROM     (
         SELECT     1.000               AS nbr
         ,     TO_CHAR(1.000,'000')     AS txt
         ,     CAST('001' AS CHAR(3))     AS chr
         FROM     dual
         )
    WHERE     txt = chr
    ;
    

    Try:

    TO_CHAR (1.000, 'FM000')
    

    By default, TO_CHAR leaves place the beginning of the string to a sign less, in which case he should ever one, TO_CHAR (1,000, '000') returns makes 4 characters, not 3. "FM" in the format said TO_CHAR do not add a space.

    If it does not, after the release of DUMP (txt) for the few lines that you can't match, so that we can see exactly what is in them.

  • An update on an index column with the same value generates an index to the top

    An update on an index column with the same value generates an update of the index?


    Thank you

    In addition to my previous answer, see also

    http://orainternals.WordPress.com/2010/11/04/does-an-update-statement-modify-the-row-if-the-update-modifies-the-column-to-same-value/

    Riyaj Shamsudeen has this to say:
    "+ We have an index on this column v1 and we update this column indexed too." Oracle was updating the indexed column? N ° if the values match the level of the indexed column, then the code of RDBMS isn't up-to-date index, a feature for optimization again. Only the row of table is updated, and the index is not updated. + "

    Hemant K Collette

  • Documentation about adding column with the DEFAULT value.

    Hello

    http://download.Oracle.com/docs/CD/B19306_01/server.102/b14200/statements_3001.htm#i2198241

    < quote >
    If you add a column, then the initial value of each row in the new column is NULL unless you specify the DEFAULT clause. In this case, Oracle database updates each row in the new column with the value specified for the DEFAULT value. This update operation, in turn, triggers AFTER UPDATE triggers defined on the table.
    < quote >

    I am not able to understand the emphasis on the part AFTER UPDATE while the column with DEFAULT values addition triggers both BEFORE and AFTER triggers defined on UPDATE.

    According to the documents of 11 g

    http://download.Oracle.com/docs/CD/B28359_01/server.111/b28286/statements_3001.htm#i2133105

    n.m. (u) r only changes with the NON NULL columns, but focus on AFTER UPDATE is still there. No trigger defined on the fire of the update in this case.

    This insistence is intended? If not, IMO, it should be changed.

    Kind regards

    Hi Sissi. After further discussion, we have added some information about a change in behavior. Here is what says the next version of the doc:

    When you add a column, the initial value of each row in the new column is null.

    * If you specify the DEFAULT clause for a column NOT NULL, then the default value is stored as metadata, but the column itself is not populated with data. However, the following queries that specify the new column are rewritten so that the default value is returned in the result set.

    This optimized behavior differs from earlier versions, when as part of operation ALTER TABLE Oracle database updated every line in the newly created with the default column and then fired defined update triggers on the table. In this release, no trigger is triggered because the default value is stored only in the form of metadata.

    * If you specify the DEFAULT for a nullable column clause, then the default value is added to existing lines under this ALTER TABLE statement, and any update triggers defined on the table are activated. This behavior also means if you change a NOT NULL column with a default value to be nullable.

    Hope that helps to clarify the matter further.

    Kind regards
    Diana

  • I have a column with two values, separated by a space, in each line. How to create 2 new columns with the first value in a column, and the second value in another column?

    I have a column with two values, separated by a space, in each line. How do I create 2 new columns with the first value in one column and the second value in another column?

    Add two new columns after than the original with space separated values column.

    Select cell B1 and type (or copy and paste it here) the formula:

    = IF (Len (a1) > 0, LEFT (A1, FIND ("", A1) −1), ' ')

    shortcut for this is:

    B1 = if (Len (a1) > 0, LEFT (A1, FIND ("", A1) −1), ' ')

    C1 = if (Len (a1) > 0, Member SUBSTITUTE (A1, B1 & "", ""), "")

    or

    the formula of the C1 could also be:

    = IF (Len (a1) > 0, RIGHT (A1, LEN (A1) −FIND ("", A1)), "")

    Select cells B1 and C1, copy

    Select cells B1 at the end of the C column, paste

  • How to take a column of duplicate names and fill a different column with the same names, excluding duplicates?

    How to take a column of duplicate names and fill a different column with the same names, excluding duplicates?

    I find easier to use this copy separate Automator Service (download Dropbox).

    To install in your numbers > Services, double-click menu just the package downloaded .workflow and if necessary give permissions in system preferences > security & privacy.

    To use, just:

    1. Select the cells in the column with duplicate names.
    2. Choose separate copy in numbers > Services menu.
    3. Click once in the upper cell where you want the deduplicated values appear.
    4. Command-v to paste.

    SG

  • Querying the oracle table that has a column with the name of "FILE".

    Hi all

    I need to have an oracle table that has the column with the name "FILE".

    I can query all columns with the query "select * from table".

    But I'm not able to use the query "select the table file.

    This table is converted from ms access to oracle and I need to have this column with the name "FILE".

    Any suggestions?

    Thank you

    Abdellaoui

    Hello

    FILE is a keyword from Oracle, so it's not a good name,

    Use FILEDATE, or DATE_FILED, or something else that is not in V$ RESERVED_WORDS. KEYWORD as the name column.

    If you need to use the FILE, then you must use quotation marks.

  • column with the only format of loading time

    My DB, 11 2 on OEL 5.5 GR
    Hi all
    I have a problem with the loading of the external table. I have a txt file with a format of columns HH24:MI:SS
    START_TIME
    00:10:20
    01:15:11
    02:11:10
    And I don't know which data type use in external table because in the future, I'll have to do some calculations on this column, so I should load as a DATE, but miss me "mm/dd/yy" to the front. Any suggestion how to do properly?

    You could use a data type CHAR or date for the outer table and do your math with this column correctly.

    The key is that convert a time string to a date data type will add the current date to it. For example:

    SQL> alter session set nls_date_format='dd/mm/yyyy hh24:mi:ss';
    
    Session altered.
    
    SQL> select to_date('00:10:20', 'hh24:mi:ss') from dual;
    
    TO_DATE('00:10:20',
    -------------------
    01/02/2011 00:10:20
    

    Some examples of code for both cases, by using the DATE and CHAR data type. I tested it on 11.2.0.1:

    CREATE OR REPLACE DIRECTORY ext_tab_dir AS '/tmp';
    
    -- /tmp/info.txt
    1,00:10:20
    2,01:15:11
    3,02:11:10
    
    alter session set nls_date_format='dd/mm/yyyy hh24:mi:ss';
    

    (1) using the DATE data type

    drop table tab_time_date;
    
    CREATE TABLE tab_time_date (
      key VARCHAR2(5),
      start_time date)
      ORGANIZATION EXTERNAL (
         TYPE ORACLE_LOADER
         DEFAULT DIRECTORY ext_tab_dir
         ACCESS PARAMETERS
          (FIELDS TERMINATED BY ','
           (key char(5),
            start_time CHAR(8) DATE_FORMAT DATE MASK "HH24:MI:SS"
           )
          )
          LOCATION ('info.txt'));
    
    select * from tab_time_date;
    
    KEY   START_TIME
    ----- -------------------
    1     01/02/2011 00:10:20
    2     01/02/2011 01:15:11
    3     01/02/2011 02:11:10
    

    (2) using the CHAR data type

    CREATE TABLE tab_time_char (
      key VARCHAR2(5),
      start_time char(8))
      ORGANIZATION EXTERNAL (
         TYPE ORACLE_LOADER
         DEFAULT DIRECTORY ext_tab_dir
         ACCESS PARAMETERS
          (FIELDS TERMINATED BY ','
          )
          LOCATION ('info.txt'));
    
    select key, to_date(start_time, 'hh24:mi:ss') from tab_time_char;
    
    KEY   TO_DATE(START_TIME,
    ----- -------------------
    1     01/02/2011 00:10:20
    2     01/02/2011 01:15:11
    3     01/02/2011 02:11:10
    

    Kind regards.

  • Insert/update the column with the clob data type

    Hi all

    ORCL Version: 11g.

    I have a table with the clob data type.

    Test12

    (col1 clob);

    I'm trying to insert/update to update the column with more than 4000 characters.

    But due to the limitation of tank 4000, I could not Insert/Update.

    Need your help in resolving this issue.

    THX

    Rod.

    The limit of 4000 characters is incorrect.  That pertains only to the varchar2 data type.  A clob can hold more than 4 G.

    Here is an example that shows how to insert it, I found...

    Otherwise, here is a way 'dirty' to do.

    insert into your_table (COLA, COLB)

    values

    (PRIMARY_KEY, PART 1 OF DATA)

    ;

    Update your_table

    Define COLB = COLB | PART 2 OF BIG DATA

    where COLA = PRIMARY_KEY;

    Update your_table

    Define COLB = COLB | PART 3 OF BIG DATA

    where COLA = PRIMARY_KEY;

    .. and so on...

    I don't know that I personally recommend the second style...  But he could do the job.

  • Format of column with the percent sign (%)

    Y at - it shaped the column put percent signs (%)?

    Currently, one of the fields in the report shows a number, for example "3.75", but we must add the percent (%) sign, for example "3.75%".

    I found the following:
    * To view '$5 234,10', I use "FML999G999G999G999G990D00", these formats with a dollar sign ($) and two decimal places.
    * To display "-5,234.10", I can use "S999G999G999G999G990D00", these formats with the sign (+) or (-) and two decimal places.

    However, I can't find how to add the percent (%) sign...

    -Frank

    Hello

    You can specify a normal number format, and then in the Expression of HTML (in the attributes column) you enter in the ex #COLUMN #%

    Kind regards
    Dimitri
    ----------------------------------
    http://dgielis.blogspot.com/
    http://www.apex-evangelists.com/
    http://www.apexblogs.info/

  • update of NULL in the column with the values of the adjacent column

    Examples of data

    with test_data as
    (select 1 as one, null as two, 2 as three,5 as four, 6 as five, null as six from dual
    union all
    select 1 as one, null as two, 2 as three,5 as four, 6 as five, null as six from dual)
    select * from test_data;
    

    This is one of those cases, the case may be where any value of a column can be null

    or two similar columns can be null. If the column is null then I want to update the adjacent column

    average value of the column, if the first column is null so I want to take the next non-null column and update, if the last column is null

    so I want to take prev not zero column and to update.

    In this case would be my expected output

    Un Two Three Four Five Six
    11.52566
    123566

    Prospects for the future the suggesion or advice.

    Or, using Analytics:

    SQL> with test_data (id, one, two, three, four, five, six) as (
      2    select 1, 1   , null, 2   , 5, 6, null  from dual union all
      3    select 2, 1   , null, 3   , 5, 6, null  from dual union all
      4    select 3, 1   , null, null, 5, 6, null  from dual union all
      5    select 4, null, null, null, 5, 6, null  from dual
      6  )
      7  select *
      8  from (
      9    select id
     10         , cell
     11         , case when next_nn is not null and prev_nn is not null
     12             then (next_nn + prev_nn)/2
     13             else nvl(next_nn, prev_nn)
     14           end val
     15    from (
     16      select id
     17           , cell
     18           , val
     19           , last_value(val) ignore nulls over(partition by id order by cell) as prev_nn
     20           , first_value(val) ignore nulls over(partition by id order by cell range between current row and unbounded following) as next_nn
     21      from test_data
     22      unpivot include nulls (val for cell in (one as 1, two as 2, three as 3, four as 4, five as 5, six as 6) )
     23    )
     24  )
     25  pivot ( min(val) for cell in (1 as "ONE", 2 as "TWO", 3 as "THREE", 4 as "FOUR", 5 as "FIVE", 6 as "SIX") )
     26  ;
    
            ID        ONE        TWO      THREE       FOUR       FIVE        SIX
    ---------- ---------- ---------- ---------- ---------- ---------- ----------
             1          1        1,5          2          5          6          6
             2          1          2          3          5          6          6
             3          1          3          3          5          6          6
             4          5          5          5          5          6          6
    
  • update of column with the number of sequence based on the condition


    Hello

    Version of DB: database Oracle 11 g Enterprise Edition Release 11.2.0.1.0 - 64 bit Production

    Here's the script to reporduce:

    CREATE TABLE T2
    (
    PARAMLOCATION NVARCHAR2 (16).
    PARAMTYPE VARCHAR2 (3 BYTE),
    PARAMNUM VARCHAR2 (3 BYTE)
    )

    Insert into T2
    (PARAMLOCATION)
    Values
    ('49');
    Insert into T2
    (PARAMLOCATION)
    Values
    (« 12 ») ;
    Insert into T2
    (PARAMLOCATION)
    Values
    (« 50 ») ;
    Insert into T2
    (PARAMLOCATION, PARAMTYPE)
    Values
    ('loc51', 'B');
    Insert into T2
    (PARAMLOCATION, PARAMTYPE)
    Values
    ('loc52', 'B');
    Insert into T2
    (PARAMLOCATION, PARAMTYPE)
    Values
    ('loc53', 'B');
    Insert into T2
    (PARAMLOCATION)
    Values
    ("loc54");
    Insert into T2
    (PARAMLOCATION)
    Values
    ("loc55");
    Insert into T2
    (PARAMLOCATION, PARAMTYPE)
    Values
    ('aoc01', 'I');
    Insert into T2
    (PARAMLOCATION, PARAMTYPE)
    Values
    ('aoc02', 'I');
    Insert into T2
    (PARAMLOCATION)
    Values
    ("loc58");
    Insert into T2
    (PARAMLOCATION, PARAMTYPE)
    Values
    ("doc03", "DL");
    Insert into T2
    (PARAMLOCATION, PARAMTYPE)
    Values
    ("doc02", "DL");
    Insert into T2
    (PARAMLOCATION, PARAMTYPE)
    Values
    ("doc01", "DL");

    I should update the column in table (paramnum) function sequential paramtype as this: also you can not order in paramlocation, its like that paramlocation comes first start sequence ordering from there based on paramtype.

    PARAMLOCATIONPARAMTYPEPARAMNUM
    49
    12
    50
    loc51B1
    loc52B2
    loc53B3
    loc54
    loc55
    aoc01AI1
    aoc02AI2
    loc58
    doc03DL1
    doc02DL2
    doc01DL3

    Please advice.

    Hello

    I'll assume you have a column called load_order, which corresponds to the order of the lines:

    CREATE TABLE T2
    (
    NUMBER OF LOAD_ORDER
    PARAMLOCATION NVARCHAR2 (16).
    PARAMTYPE VARCHAR2 (3 BYTE),
    PARAMNUM VARCHAR2 (3 BYTE)
    ) ;

    Insert into T2
    (LOAD_ORDER, PARAMLOCATION)
    Values
    (1, '49');
    Insert into T2
    (LOAD_ORDER, PARAMLOCATION)
    Values
    (2, '12');
    Insert into T2
    (LOAD_ORDER, PARAMLOCATION)
    Values
    (3, '50');
    Insert into T2
    (LOAD_ORDER, PARAMLOCATION, PARAMTYPE)
    Values
    (5, 'loc51', 'B');
    Insert into T2
    (LOAD_ORDER, PARAMLOCATION, PARAMTYPE)
    Values
    (8, 'loc52', 'B');
    Insert into T2
    (LOAD_ORDER, PARAMLOCATION, PARAMTYPE)
    Values
    (13, 'loc53', 'B');
    Insert into T2
    (LOAD_ORDER, PARAMLOCATION)
    Values
    (13.2, "loc54");
    Insert into T2
    (LOAD_ORDER, PARAMLOCATION)
    Values
    (13.5, 'loc55');
    Insert into T2
    (LOAD_ORDER, PARAMLOCATION, PARAMTYPE)
    Values
    (50, 'aoc01', 'I');
    Insert into T2
    (LOAD_ORDER, PARAMLOCATION, PARAMTYPE)
    Values
    (80, 'aoc02', 'I');
    Insert into T2
    (LOAD_ORDER, PARAMLOCATION)
    Values
    (81, 'loc58');
    Insert into T2
    (LOAD_ORDER, PARAMLOCATION, PARAMTYPE)
    Values
    (82, "doc03", "DL");
    Insert into T2
    (LOAD_ORDER, PARAMLOCATION, PARAMTYPE)
    Values
    (83, "doc02", "DL");
    Insert into T2
    (LOAD_ORDER, PARAMLOCATION, PARAMTYPE)
    Values
    (99, "doc01", "DL");

    Any data type, this column is or what are the values it contains, as long as you can derive from the order of the rows of values in the column.  (Of course, the values can be consecutive integers, only they do not have to be).  If you do not have this type of column, you don't have any order to your lines, and what you request is impossible.

    Since you have a load_order column, here's a way to get the results you requested:

    MERGE INTO dst t2

    WITH THE HELP OF)

    WITH got_grp AS

    (

    SELECT load_order

    paramlocation

    paramtype

    ROW_NUMBER () OVER (ORDER BY load_order)

    -ROW_NUMBER () OVER (PARTITION BY CASE

    WHEN paramtype IS NULL

    THEN 0

    END

    ORDER BY load_order

    ) AS the grp

    THE t2

    )

    SELECT load_order

    paramlocation

    ROW_NUMBER () OVER (PARTITION BY grp

    ORDER BY load_order

    ), Paramnum

    OF got_grp

    WHERE the paramtype IS NOT NULL

    ) CBC

    WE (dst.paramlocation = src.paramlocation)

    WHEN MATCHED THEN UPDATE

    SET dst.paramnum = src.paramnum

    ;

    Results:

    LOAD_ORDER PARAMLOCATION BY

    ---------- ---------------- --- ---

    1 49

    2 12

    3 50

    loc51 5 B 1

    loc52 8 B 2

    13 loc53 B 3

    13.2 loc54

    loc55 13.5

    50 aoc01 AI 1

    80 aoc02 AI 2

    loc58 81

    1 DL of 82 doc03

    2 DL doc02 83

    3 DL of 99 doc01

Maybe you are looking for

  • TextEdit display anomaly

    TextEdit appears to be display in a different resolution than the rest of my programs. 12 pt text is smaller that everywhere else, the icons appear too small etc. Any thoughts?

  • Satellite Pro L20 PCMCIA support WOL?

    Support of the L20 Wake-On-Lan via the PCMCIA bus card, if I get a compatible card WOL?

  • my country is not on the billing address

    am currently in Zambia (Africa), but can't find my country on the billing address. How do I use my account to buy & download things

  • ClusterRecovery.exe x 64 Win2k3

    Hi all clusterrecovery.exe is available for Win2k3 x 64? I found the following link http://www.microsoft.com/en-us/download/details.aspx?id=10047but it is clearly written that this tool should not be used on x 64 machines. Also, I found some other fo

  • "Cannot create file, no access to", trying to move the pictures to a media card.

    I want to send pictures on a memory card for a digital photo frame, but when I click on the image I get a warning saying that the computer could not move or copy the file. Cannot create the directory. How to make photos accessible?