Completion of data series by analytical function

I have the pleasure of learning the benefits of analytical functions and hope to get some help
The case is as follows:
Different projects gets funds from different sources over several years, but not from each source every year.
I want to produce the cumulative sum of funds for each source for each year for each project, but so far I have not been able to do so for years without fund for a particular source.
I have used this syntax:
SUM(fund) OVER(PARTITION BY project, source ORDER BY year ROWS UNBOUNDED PRECEDING)
I have also experimented with different variations of the window clause, but without any luck.
This is the last step in a big job I have been working on for several weeks, so I would be very thankful for any help.

If you want to use Analytic functions and if you are on 10.1.3.3 version of BI EE then try using Evaluate, Evaluate_aggr that support native database functions. I have blogged about it here http://oraclebizint.wordpress.com/2007/09/10/oracle-bi-ee-10133-support-for-native-database-functions-and-aggregates/. But in your case all you might want to do is have a column with the following function.
SUM(Measure BY Col1, Col2...)
I have also blogged about it here http://oraclebizint.wordpress.com/2007/10/02/oracle-bi-ee-101332-varying-aggregation-based-on-levels-analytic-functions-equivalence/.
Thanks,
Venkat
http://oraclebizint.wordpress.com

Similar Messages

  • 2.1 EA Bug: group by auto complete generates group by for analytic function

    Hi,
    when using an analytic function in the sql text, sqldeveloper generates an automatic group by statement in the sql text.
    Regards,
    Ingo

    Personally, I don't want anything changed automatically EVER. The day you don't notice and you run a wrong statement, the consequences may be very costly (read: disaster).
    Can this be turned off all together? If there's a preference I didn't find, can this be left off by default?
    Thanks,
    K.

  • Oracle Analytic function tuning

    Hi all,
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bi
    PL/SQL Release 10.2.0.3.0 - Production
    CORE 10.2.0.3.0 Production
    TNS for IBM/AIX RISC System/6000: Version 10.2.0.3.0 - Productio
    NLSRTL Version 10.2.0.3.0 - Production
    I have a query which has analytic function uses large space on temporary tablespace resulting in direct path temp read and direct path temp write wait events taking too much time. Is there any way to tune such query?
    Thanks in advance.

    user9074365 wrote:
    Hi all,
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bi
    PL/SQL Release 10.2.0.3.0 - Production
    CORE 10.2.0.3.0 Production
    TNS for IBM/AIX RISC System/6000: Version 10.2.0.3.0 - Productio
    NLSRTL Version 10.2.0.3.0 - Production
    I have a query which has analytic function uses large space on temporary tablespace resulting in direct path temp read and direct path temp write wait events taking too much time. Is there any way to tune such query?
    With your version of Oracle, and high-volumes of data going through analytic function, it's likely that this blog note applies. You may need an upgrade or special patch. http://jonathanlewis.wordpress.com/2009/09/07/analytic-agony/
    Regards
    Jonathan Lewis

  • Using analytical function to calculate concurrency between date range

    Folks,
    I'm trying to use analytical functions to come up with a query that gives me the
    concurrency of jobs executing between a date range.
    For example:
    JOB100 - started at 9AM - stopped at 11AM
    JOB200 - started at 10AM - stopped at 3PM
    JOB300 - started at 12PM - stopped at 2PM
    The query would tell me that JOB1 ran with a concurrency of 2 because JOB1 and JOB2
    were running started and finished within the same time. JOB2 ran with the concurrency
    of 3 because all jobs ran within its start and stop time. The output would look like this.
    JOB START STOP CONCURRENCY
    === ==== ==== =========
    100 9AM 11AM 2
    200 10AM 3PM 3
    300 12PM 2PM 2
    I've been looking at this post, and this one if very similar...
    Analytic functions using window date range
    Here is the sample data..
    CREATE TABLE TEST_JOB
    ( jobid NUMBER,
    created_time DATE,
    start_time DATE,
    stop_time DATE
    insert into TEST_JOB values (100, sysdate -1, to_date('05/04/08 09:00:00','MM/DD/YY hh24:mi:ss'), to_date('05/04/08 11:00:00','MM/DD/YY hh24:mi:ss'));
    insert into TEST_JOB values (200, sysdate -1, to_date('05/04/08 10:00:00','MM/DD/YY hh24:mi:ss'), to_date('05/04/08 13:00:00','MM/DD/YY hh24:mi:ss'));
    insert into TEST_JOB values (300, sysdate -1, to_date('05/04/08 12:00:00','MM/DD/YY hh24:mi:ss'), to_date('05/04/08 14:00:00','MM/DD/YY hh24:mi:ss'));
    select * from test_job;
    JOBID|CREATED_TIME |START_TIME |STOP_TIME
    ----------|--------------|--------------|--------------
    100|05/04/08 09:28|05/04/08 09:00|05/04/08 11:00
    200|05/04/08 09:28|05/04/08 10:00|05/04/08 13:00
    300|05/04/08 09:28|05/04/08 12:00|05/04/08 14:00
    Any help with this query would be greatly appreciated.
    thanks.
    -peter

    after some checking the model rule wasn't working exactly as expected.
    I believe it's working right now. I'm posting a self-contained example for completeness sake.I use 2 functions to convert back and forth between epoch unix timestamps, so
    I'll post them here as well.
    Like I said I think this works okay, but any feedback is always appreciated.
    -peter
    CREATE OR REPLACE FUNCTION date_to_epoch(p_dateval IN DATE)
    RETURN NUMBER
    AS
    BEGIN
    return (p_dateval - to_date('01/01/1970','MM/DD/YYYY')) * (24 * 3600);
    END;
    CREATE OR REPLACE FUNCTION epoch_to_date (p_epochval IN NUMBER DEFAULT 0)
    RETURN DATE
    AS
    BEGIN
    return to_date('01/01/1970','MM/DD/YYYY') + (( p_epochval) / (24 * 3600));
    END;
    DROP TABLE TEST_MODEL3 purge;
    CREATE TABLE TEST_MODEL3
    ( jobid NUMBER,
    start_time NUMBER,
    end_time NUMBER);
    insert into TEST_MODEL3
    VALUES (300,date_to_epoch(to_date('05/07/2008 10:00','MM/DD/YYYY hh24:mi')),
    date_to_epoch(to_date('05/07/2008 19:00','MM/DD/YYYY hh24:mi')));
    insert into TEST_MODEL3
    VALUES (200,date_to_epoch(to_date('05/07/2008 09:00','MM/DD/YYYY hh24:mi')),
    date_to_epoch(to_date('05/07/2008 12:00','MM/DD/YYYY hh24:mi')));
    insert into TEST_MODEL3
    VALUES (400,date_to_epoch(to_date('05/07/2008 10:00','MM/DD/YYYY hh24:mi')),
    date_to_epoch(to_date('05/07/2008 14:00','MM/DD/YYYY hh24:mi')));
    insert into TEST_MODEL3
    VALUES (500,date_to_epoch(to_date('05/07/2008 11:00','MM/DD/YYYY hh24:mi')),
    date_to_epoch(to_date('05/07/2008 16:00','MM/DD/YYYY hh24:mi')));
    insert into TEST_MODEL3
    VALUES (600,date_to_epoch(to_date('05/07/2008 15:00','MM/DD/YYYY hh24:mi')),
    date_to_epoch(to_date('05/07/2008 22:00','MM/DD/YYYY hh24:mi')));
    insert into TEST_MODEL3
    VALUES (100,date_to_epoch(to_date('05/07/2008 09:00','MM/DD/YYYY hh24:mi')),
    date_to_epoch(to_date('05/07/2008 23:00','MM/DD/YYYY hh24:mi')));
    commit;
    SELECT jobid,
    epoch_to_date(start_time)start_time,
    epoch_to_date(end_time)end_time,
    n concurrency
    FROM TEST_MODEL3
    MODEL
    DIMENSION BY (start_time,end_time)
    MEASURES (jobid,0 n)
    (n[any,any]=
    count(*)[start_time<= cv(start_time),end_time>=cv(start_time)]+
    count(*)[start_time > cv(start_time) and start_time <= cv(end_time), end_time >= cv(start_time)]
    ORDER BY start_time;
    The results look like this:
    JOBID|START_TIME|END_TIME |CONCURRENCY
    ----------|---------------|--------------|-------------------
    100|05/07/08 09:00|05/07/08 23:00| 6
    200|05/07/08 09:00|05/07/08 12:00| 5
    300|05/07/08 10:00|05/07/08 19:00| 6
    400|05/07/08 10:00|05/07/08 14:00| 5
    500|05/07/08 11:00|05/07/08 16:00| 6
    600|05/07/08 15:00|05/07/08 22:00| 4

  • Are analytic functions usefull only for data warehouses?

    Hi,
    I deal with reporting queries on Oracle databases but I don't work on Data Warehouses, thus I'd like to know if learning to use analytic functions (sql for anaylis such as rollup, cube, grouping, ...) might be usefull in helping me to develop better reports or if analytic functions are usually usefull only for data warehouses queries. I mean are rollup, cube, grouping, ... usefull also on operational database or do they make sense only on DWH?
    Thanks!

    Mark1970 wrote:
    thus does it worth learning them for improving report queries also not on DHW but on common operational databases?Why pigeonhole report queries as "+operational+" or "+data warehouse+"?
    Do you tell a user/manager that "<i>No, this report cannot be done as it looks like a data warehouse report and we have an operational database!</i>"?
    Data processing and data reporting requirements not not care what label you assign to your database.
    Simple real world example of using analytical queries on a non warehouse. We supply data to an external system via XML. They require that we limit the number of parent entities per XML file we supply. E.g. 100 customer elements (together with all their child elements) per file. Analytical SQL enables this to be done by creating "buckets" that can only contain 100 parent elements at a time. Complete process is SQL driven - no slow-by-slow row by row processing in PL/SQL using nested cursor loops and silly approaches like that.
    Analytical SQL is a tool in the developer toolbox. It would be unwise to remove it from the toolbox, thinking that it is not applicable and won't be needed for the work that's to be done.

  • Max  date in analytic function

    I have records that has repeating load dates.
    I would like to pick the records that has the maximum load_dates.
    My source data looks like this -
    ( select 60589 as C_number, to_date('01/08/2012','DD/MM/YYYY') as load_dt from dual union all
    select 60768, to_date('01/08/2012','DD/MM/YYYY') from dual union all
    select 60888, to_date('01/08/2012','DD/MM/YYYY') from dual union all
    select 12345, to_date('01/09/2012','DD/MM/YYYY') from dual union all
    select 54321, to_date('01/09/2012','DD/MM/YYYY') from dual union all
    select 66666, to_date('01/10/2012','DD/MM/YYYY') from dual union all
    select 55555, to_date('01/10/2012','DD/MM/YYYY') from dual)
    I would like to pick records with the max load_dt that means
    C_number load_dt
    666666 01-Oct-12
    555555 01-Oct-12
    I have written an oracle analytic function but it's not working the way it should be -
    My query looks like this -
    select a.*
    from
    select
    c_number,
    load_dt,
    max(load_dt) over (partition by load_dt) as mx_dt
    from table_name
    where
    load_dt = mx_dt;
    It returns all the rows for some reason.
    Any help or guidance is highly appreciated
    PJ

    without analytical..
    with mydata as
    ( select 60589 as C_number, to_date('01/08/2012','DD/MM/YYYY') as load_dt from dual union all
    select 60768, to_date('01/08/2012','DD/MM/YYYY') from dual union all
    select 60888, to_date('01/08/2012','DD/MM/YYYY') from dual union all
    select 12345, to_date('01/09/2012','DD/MM/YYYY') from dual union all
    select 54321, to_date('01/09/2012','DD/MM/YYYY') from dual union all
    select 66666, to_date('01/10/2012','DD/MM/YYYY') from dual union all
    select 55555, to_date('01/10/2012','DD/MM/YYYY') from dual)
    select *
              from mydata
              where load_dt = (select max(load_dt) from mydata);

  • Analytical function sum() ...for Till-date reporting

    Hi,
    I need help in forming an SQL with analytical function.
    Here is my scenario:
    create table a (name varchar2(10), qty_sold number,on_date date);
    insert into a values ('abc',10,'10-JAN-2007 00:01:00');
    insert into a values ('abc',01,'10-JUL-2007 00:01:00');
    insert into a values ('abc',05,'10-JUL-2007 08:11:00');
    insert into a values ('abc',17,'10-JUL-2007 09:11:00');
    insert into a values ('def',10,'10-JAN-2006 08:01:00');
    insert into a values ('def',01,'10-JUN-2006 10:01:00');
    insert into a values ('def',05,'10-JUL-2006 08:10:00');
    insert into a values ('pqr',17,'10-JUL-2006 09:11:00');
    Now I want to have a sql which displays the following:
    NAME--TOTAL_QTY_SOLD_IN_LAST_10_DAYS, TOTAL_QTY_SOLD_IN_LAST_20_DAYS...etc
    I know we can do it using sum(qty_sold) over (order on_date range interval '10' days and preceding) .... but I get too many rows for each "NAME" ....for each of the date in the database table a ... I want just one row for each "Name"...and sum() should be till SYSDATE ....
    Any help is highly appreciated.
    Thanks.

    SQL> select name
      2       , sum(case when sysdate - on_date <= 10 then qty_sold end) total_qty_last_10_days
      3       , sum(case when sysdate - on_date <= 100 then qty_sold end) total_qty_last_100_days
      4       , sum(case when sysdate - on_date <= 500 then qty_sold end) total_qty_last_500_days
      5    from a
      6   group by name
      7  /
    NAME          TOTAL_QTY_LAST_10_DAYS   TOTAL_QTY_LAST_100_DAYS   TOTAL_QTY_LAST_500_DAYS
    abc                                                         23                        33
    def                                                                                    6
    pqr                                                                                   17
    3 rijen zijn geselecteerd.Regards,
    Rob.

  • Date ranges - possible to use analytic functions?

    The next datastructure needs to be converted to a daterange datastructure.
    START_DATE END_DATE      AMMOUNT
    01-01-2010 28-02-2010         10
    01-02-2010 31-03-2010         20
    01-03-2010 31-05-2010         30
    01-09-2010 31-12-2010         40Working solution:
    with date_ranges
    as   ( select to_date('01-01-2010','dd-mm-yyyy') start_date
           ,      to_date('28-02-2010','dd-mm-yyyy') end_date
           ,      10                                 ammount
           from   dual
           union all
           select to_date('01-02-2010','dd-mm-yyyy') start_date
           ,      to_date('31-03-2010','dd-mm-yyyy') end_date
           ,      20                                 ammount
           from   dual
           union all
           select to_date('01-03-2010','dd-mm-yyyy') start_date
           ,      to_date('31-05-2010','dd-mm-yyyy') end_date
           ,      30                                 ammount
           from   dual
           union all
           select to_date('01-09-2010','dd-mm-yyyy') start_date
           ,      to_date('31-12-2010','dd-mm-yyyy') end_date
           ,      40                                 ammount
           from   dual
    select   rne.start_date
    ,        lead (rne.start_date-1,1)  over (order by rne.start_date) end_date
    ,        ( select sum(dre2.ammount)
               from   date_ranges dre2
               where  rne.start_date >= dre2.start_date
               and    rne.start_date <= dre2.end_date
             ) range_ammount
    from     ( select dre.start_date
               from   date_ranges dre
               union -- implicit distinct
               select dre.end_date + 1
               from   date_ranges dre
             ) rne
    order by rne.start_date
    /Output:
    START_DATE END_DATE   RANGE_AMMOUNT
    01-01-2010 31-01-2010            10
    01-02-2010 28-02-2010            30
    01-03-2010 31-03-2010            50
    01-04-2010 31-05-2010            30
    01-06-2010 31-08-2010
    01-09-2010 31-12-2010            40
    01-01-2011
    7 rows selected.However, I would like to use an analytic function to calculate the range_ammount. Is this possible?
    Edited by: user5909557 on Jul 29, 2010 6:19 AM

    Hi,
    Welcome to the forum!
    Yes, you can replace the scalar sub-queriy with an analytic SUM, like this:
    WITH  change_data   AS
         SELECT     start_date     AS change_date
         ,     ammount          AS net_amount
         FROM     date_ranges
        UNION
         SELECT     end_date + 1     AS change_date
         ,     -ammount        AS net_amount
         FROM     date_ranges
    ,     got_range_amount     AS
         SELECT     change_date          AS start_date
         ,     LEAD (change_date) OVER (ORDER BY  change_date) - 1
                                     AS end_date
         ,     SUM (net_amount)   OVER (ORDER BY  change_date)
                                    AS range_amount
         FROM    change_data
    ,     got_grp          AS
         SELECT     start_date
         ,     end_date
         ,     range_amount
         ,     ROW_NUMBER () OVER ( ORDER BY        start_date, end_date)
               - ROW_NUMBER () OVER ( PARTITION BY  range_amount
                                         ORDER BY          start_date, end_date
                           )         AS grp
         FROM    got_range_amount
    SELECT       MIN (start_date)     AS start_date
    ,       MAX (end_date)     AS end_date
    ,       range_amount
    FROM       got_grp
    GROUP BY  grp
    ,            range_amount
    ORDER BY  grp
    ;This should be much more efficient.
    The code is longer than what you posted. That's largely because it consolidates consecutive groups with the same amount.
    For example, if we add this row to the sample data:
           union all
           select to_date('02-01-2010','dd-mm-yyyy') start_date
           ,      to_date('30-12-2010','dd-mm-yyyy') end_date
           ,      0                                 ammount
           from   dualThe query you posted produces:
    START_DAT END_DATE  RANGE_AMMOUNT
    01-JAN-10 01-JAN-10            10
    02-JAN-10 31-JAN-10            10
    01-FEB-10 28-FEB-10            30
    01-MAR-10 31-MAR-10            50
    01-APR-10 31-MAY-10            30
    01-JUN-10 31-AUG-10             0
    01-SEP-10 30-DEC-10            40
    31-DEC-10 31-DEC-10            40
    01-JAN-11I assume you only want a new row of output when the range_amount changes., that is:
    START_DAT END_DATE  RANGE_AMOUNT
    01-JAN-10 31-JAN-10           10
    01-FEB-10 28-FEB-10           30
    01-MAR-10 31-MAR-10           50
    01-APR-10 31-MAY-10           30
    01-JUN-10 31-AUG-10            0
    01-SEP-10 31-DEC-10           40
    01-JAN-11                      0Of course, you could modify the original query so that it did this, but it would end up about as complex as the query above, but less efficient.
    Conversely, if you prefer the longer output, then you don't need the suib-query got_grp in the query above.
    Thanks for posting the CREATE TABLE and INSERT statments; that's very helpful.
    There are some people who have been using this forum for years who still have to be begged to do that.

  • Query in analytic function

    Hi,
    I am using below query
    select * from
    SELECT FLAG,S_DATE,ROW_NUMBER() OVER (PARTITION BY
    flag order by S_DATE,FLAG ) as d
    FROM table_name
    ORDER BY S_DATE
    which gives below output
    Flag     | S_DATE      | D
    Y     | 2/27/2012 5:33     |     1
    Y     | 2/27/2012 5:34     |     2
    Y     | 2/27/2012 5:34     |     3
    N     | 2/27/2012 5:34     |     1
    N     | 2/27/2012 5:34     |     2
    N     | 2/27/2012 5:34     |     3
    N     | 2/27/2012 5:35     |     4
    N     | 2/27/2012 5:35     |     5
    Y     |  2/27/2012 5:36     |     4
    Y     |  2/27/2012 5:36     |     5
    Y     |  2/27/2012 5:36     |     6
    But i want the output to be in below order there is change in last 3 rows
    Flag     | S_DATE      | D
    Y     | 2/27/2012 5:33     |     1
    Y     | 2/27/2012 5:34     |     2
    Y     | 2/27/2012 5:34     |     3
    N     | 2/27/2012 5:34     |     1
    N     | 2/27/2012 5:34     |     2
    N     | 2/27/2012 5:34     |     3
    N     | 2/27/2012 5:35     |     4
    N     | 2/27/2012 5:35     |     5
    Y     |  2/27/2012 5:36     |     1
    Y     |  2/27/2012 5:36     |     2
    Y     |  2/27/2012 5:36     |     3
    ihave used the analytic function.
    Edited by: user8858890 on Feb 27, 2012 2:00 AM

    Hi,
    user8858890 wrote:
    ... But i want the output to be in below order there is change in last 3 rows
    Flag     | S_DATE      | D
    Y     | 2/27/2012 5:33     |     1
    Y     | 2/27/2012 5:34     |     2
    Y     | 2/27/2012 5:34     |     3
    N     | 2/27/2012 5:34     |     1
    N     | 2/27/2012 5:34     |     2
    N     | 2/27/2012 5:34     |     3
    N     | 2/27/2012 5:35     |     4
    N     | 2/27/2012 5:35     |     5
    Y     |  2/27/2012 5:36     |     1
    Y     |  2/27/2012 5:36     |     2
    Y     |  2/27/2012 5:36     |     3
    Why do you want the last 3 rows (which have flag = 'Y') to be numbered 1, 2, 3, when the first 3 rows (which also have flag = 'Y') already have numbers 1, 2 and 3? Do you want a separate #1 whenevever there is a group of consecutive rows (when ordered by s_date) that have the same flag? If so, then you have to identify the groups, like this:
    WITH     got_grp_id     AS
         SELECT     flag
         ,     s_date
         ,     ROWID               AS r_id
         ,     ROW_NUMBER () OVER ( ORDER BY      s_date
                                   ,                  ROWID
               - ROW_NUMBER () OVER ( PARTITION BY  flag
                                         ORDER BY          s_date
                             ,               ROWID
                           )    AS grp_id
         FROM    table_name
    SELECT       flag
    ,       s_date
    ,       ROW_NUMBER () OVER ( PARTITION BY  flag
                                 ,          grp_id
                          ORDER BY          s_date
                          ,               r_id
                        )      AS d
    FROM      got_grp_id
    ORDER BY  s_date
    ,            grp_id
    ,       d
    ;This assumes that each row can be uniquely idendified, so that the order is unambiguous. In your sample data, there are completely identical rows, so I used ROWID to uniquely identify the rows. Using ROWID assumes that table_name is a real table, not just a result set.
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all the tables involved, and the results you want from that data.
    Explain, using specific examples, how you get those results from that data.
    Always say what version of Oracle you're using.

  • A Job for 'PARTION BY' Analytical Function?

    Hi,
    I'm still a little fuzzy on using partitions but this looks like a possible candidate to me.
    I need to count the number of different customers that visit an office in a single day. If a customer visits an office more than once in a single day that counts as 1.
    Input
    OFFICE CUSTOMER TRAN_DATE
    1     11     1-Apr-09
    1     11     1-Apr-09
    1     11     1-Apr-09
    1     11     2-Apr-09
    2     22     2-Apr-09
    2     22     2-Apr-09
    2     33     2-Apr-09
    select a.office as "OFFICE", a.customer AS "CUSTOMER", a.tran_date AS "TRAN_DATE", COUNT(*)
    FROM
    (SELECT 1 AS "OFFICE", 11 AS "CUSTOMER", '01-APR-2009' AS "TRAN_DATE" FROM DUAL
    UNION ALL
    SELECT 1 , 11 , '01-APR-2009' FROM DUAL
    UNION ALL
    SELECT 1 , 11 , '01-APR-2009' FROM DUAL
    UNION ALL
    SELECT 1 , 11 , '02-APR-2009' FROM DUAL
    UNION ALL
    SELECT 2 , 22 , '02-APR-2009' FROM DUAL
    UNION ALL
    SELECT 2 , 22 , '02-APR-2009' FROM DUAL
    UNION ALL
    SELECT 2 , 33 , '02-APR-2009' FROM DUAL
    ) a;
    Desired Result
    1     1-Apr-09     1
    1     2-Apr-09     1
    2     2-Apr-09     2
    Is this possible with partitions, do I need to use subqueries, or some other methid?
    Thank You in Advance for Your Help,
    Lou
    Edited by: Wind In Face on Apr 15, 2009 1:34 PM

    "I wanted to use PARTITION BY instead of what John suggested because it is my understanding that PARTION BY will be faster"
    It may be, or it may not be. As Frank pointed out analytic functions have their uses, and aggregate functions have theis. In some places, those uses do overlap, but not always. You query is equivalent to mine, that is, it returns the same resultset in this case, however, there are some differences.
    For the relatively small amount of data I generated, it is probably not significant, but the analytic version does two sorts (one unique) while my aggregate version does only one.
    SQL> CREATE TABLE test (office NUMBER, customer NUMBER, tran_dt DATE);
    Table created.
    SQL> INSERT /*+ APPEND */ INTO test
      2  SELECT MOD(rownum, 10)+1, MOD(rownum, 121)+1, TRUNC(sysdate+MOD(rownum, 42))
      3  FROM all_objects;
    18135 rows created.
    SQL> COMMIT;
    Commit complete.
    SQL> SELECT office, tran_dt, COUNT(DISTINCT customer) cust_count
      2  FROM test
      3  GROUP BY office, tran_dt;
    210 rows selected.
    Execution Plan
    Plan hash value: 2407667464
    | Id  | Operation          | Name |
    |   0 | SELECT STATEMENT   |      |
    |   1 |  SORT GROUP BY     |      |
    |   2 |   TABLE ACCESS FULL| TEST |
    Statistics
              0  recursive calls
              0  db block gets
             27  consistent gets
              0  physical reads
              0  redo size
           6061  bytes sent via SQL*Net to client
            631  bytes received via SQL*Net from client
             15  SQL*Net roundtrips to/from client
              1  sorts (memory)
              0  sorts (disk)
            210  rows processed
    SQL> SELECT DISTINCT office office, tran_dt tran_date,
      2         COUNT(DISTINCT customer) OVER(PARTITION BY office, tran_dt) cust_count
      3  FROM test;
    210 rows selected.
    Execution Plan
    Plan hash value: 1303194651
    | Id  | Operation           | Name |
    |   0 | SELECT STATEMENT    |      |
    |   1 |  SORT UNIQUE        |      |
    |   2 |   WINDOW SORT       |      |
    |   3 |    TABLE ACCESS FULL| TEST |
    Statistics
              0  recursive calls
              0  db block gets
             27  consistent gets
              0  physical reads
              0  redo size
           6063  bytes sent via SQL*Net to client
            631  bytes received via SQL*Net from client
             15  SQL*Net roundtrips to/from client
              2  sorts (memory)
              0  sorts (disk)
            210  rows processedFor a larger resultset, this could make a significant difference.
    In general, my preference is use the simplest construct that will work.
    John

  • Should I use Analytic functions ?

    Hello,
    I have a table rci_dates with the following structure (rci_id,visit_id,rci_name,rci_date).
    A sample of data in this table is as given below.
    1,101,'FIRST VISIT', '2010-MAY-01',
    2,101,'FIRST VISIT', '2010-MAY-01'
    3,101,'FIRST VISIT', '2010-MAY-01'
    4,101,'FIRST VISIT', '2010-MAY-01'
    5,102,'SECOND VISIT', '2010-JUN-01',
    6,102,'SECOND VISIT', '2010-JUN-01'
    7,102,'SECOND VISIT', '2010-JUN-01'
    8,102,'SECOND VISIT', '2010-JUL-01'
    I want to write a query which returns me the records which are similar to the record with rc_id =8 since the rci_date is different within the visit_id 102. Where as in Visit_id 101 the rci_dates are all same so it should not be displayed in the output returned by my query.
    How can I do this ? Should I be using analytic functions. Can someone please let me know.
    Thanks

    ok i have created the table and inserted the data. but it appears that the data are the output you are expecting, they all the same visit_id.
    SQL> CREATE TABLE RCI
      2  (RCI_ID NUMBER(10) NOT NULL,
      3   VISIT_ID NUMBER(10) NOT NULL,
      4   RCI_NAME VARCHAR2(20 BYTE) NOT NULL,
      5   DCI_DATE VARCHAR2(8 BYTE));
    Table created
    SQL> INSERT INTO RCI ( RCI_ID, VISIT_ID, RCI_NAME, DCI_DATE ) VALUES ( 14876540, 12140, 'SCREENING', '19000101');
    1 row inserted
    SQL> INSERT INTO RCI ( RCI_ID, VISIT_ID, RCI_NAME, DCI_DATE ) VALUES ( 14876640, 12140, 'SCREENING', '19000101');
    1 row inserted
    SQL> INSERT INTO RCI ( RCI_ID, VISIT_ID, RCI_NAME, DCI_DATE ) VALUES ( 14876740, 12140, 'SCREENING', '19000101');
    1 row inserted
    SQL> INSERT INTO RCI ( RCI_ID, VISIT_ID, RCI_NAME, DCI_DATE ) VALUES ( 14876840, 12140, 'SCREENING', '19000101');
    1 row inserted
    SQL> INSERT INTO RCI ( RCI_ID, VISIT_ID, RCI_NAME, DCI_DATE ) VALUES ( 14876940, 12140, 'SCREENING', '19000101');
    1 row inserted
    SQL> INSERT INTO RCI ( RCI_ID, VISIT_ID, RCI_NAME, DCI_DATE ) VALUES ( 14877040, 12140, 'SCREENING', '19000101');
    1 row inserted
    SQL> INSERT INTO RCI ( RCI_ID, VISIT_ID, RCI_NAME, DCI_DATE ) VALUES ( 14877140, 12140, 'SCREENING', '19000101');
    1 row inserted
    SQL> INSERT INTO RCI ( RCI_ID, VISIT_ID, RCI_NAME, DCI_DATE ) VALUES ( 14877240, 12140, 'SCREENING', '19000101');
    1 row inserted
    SQL> INSERT INTO RCI ( RCI_ID, VISIT_ID, RCI_NAME, DCI_DATE ) VALUES ( 14877240, 12140, 'SCREENING', '19000101');
    1 row inserted
    SQL> INSERT INTO RCI ( RCI_ID, VISIT_ID, RCI_NAME, DCI_DATE ) VALUES ( 14877640, 12140, 'SCREENING', '19000101');
    1 row inserted
    SQL> INSERT INTO RCI ( RCI_ID, VISIT_ID, RCI_NAME, DCI_DATE ) VALUES ( 14877740, 12140, 'SCREENING', '19000101');
    1 row inserted
    SQL> INSERT INTO RCI ( RCI_ID, VISIT_ID, RCI_NAME, DCI_DATE ) VALUES ( 14877840, 12140, 'SCREENING', '19000101');
    1 row inserted
    SQL> INSERT INTO RCI ( RCI_ID, VISIT_ID, RCI_NAME, DCI_DATE ) VALUES ( 14877940, 12140, 'SCREENING', '19000101');
    1 row inserted
    SQL> INSERT INTO RCI ( RCI_ID, VISIT_ID, RCI_NAME, DCI_DATE ) VALUES ( 14878040, 12140, 'SCREENING', '19000101');
    1 row inserted
    SQL> INSERT INTO RCI ( RCI_ID, VISIT_ID, RCI_NAME, DCI_DATE ) VALUES ( 14878140, 12140, 'SCREENING', '19000101');
    1 row inserted
    SQL> INSERT INTO RCI ( RCI_ID, VISIT_ID, RCI_NAME, DCI_DATE ) VALUES ( 14878240, 12140, 'SCREENING', '19000101');
    1 row inserted
    SQL> INSERT INTO RCI ( RCI_ID, VISIT_ID, RCI_NAME, DCI_DATE ) VALUES ( 14878340, 12140, 'SCREENING', '19000101');
    1 row inserted
    SQL> INSERT INTO RCI ( RCI_ID, VISIT_ID, RCI_NAME, DCI_DATE ) VALUES ( 14878440, 12140, 'SCREENING', '19000101');
    1 row inserted
    SQL> INSERT INTO RCI ( RCI_ID, VISIT_ID, RCI_NAME, DCI_DATE ) VALUES ( 14878540, 12140, 'SCREENING', '19000101');
    1 row inserted
    SQL> INSERT INTO RCI ( RCI_ID, VISIT_ID, RCI_NAME, DCI_DATE ) VALUES ( 14877640, 12140, 'SCREENING', '19000101');
    1 row inserted
    SQL> INSERT INTO RCI ( RCI_ID, VISIT_ID, RCI_NAME, DCI_DATE ) VALUES ( 14877740, 12140, 'SCREENING', '19000101');
    1 row inserted
    SQL> INSERT INTO RCI ( RCI_ID, VISIT_ID, RCI_NAME, DCI_DATE ) VALUES ( 14878340, 12140, 'SCREENING', '19000101');
    1 row inserted
    SQL> INSERT INTO RCI ( RCI_ID, VISIT_ID, RCI_NAME, DCI_DATE ) VALUES ( 14878540, 12140, 'SCREENING', '19000101');
    1 row inserted
    SQL> INSERT INTO RCI ( RCI_ID, VISIT_ID, RCI_NAME, DCI_DATE ) VALUES ( 17418240, 12140, 'SCREENING', '20000101');
    1 row inserted
    SQL> INSERT INTO RCI ( RCI_ID, VISIT_ID, RCI_NAME, DCI_DATE ) VALUES ( 17418340, 12140, 'SCREENING', '20000101');
    1 row inserted
    SQL> INSERT INTO RCI ( RCI_ID, VISIT_ID, RCI_NAME, DCI_DATE ) VALUES ( 17418440, 12140, 'SCREENING', '20000101');
    1 row inserted
    SQL> INSERT INTO RCI ( RCI_ID, VISIT_ID, RCI_NAME, DCI_DATE ) VALUES ( 14878240, 12140, 'SCREENING', '20000101');
    1 row inserted
    SQL> INSERT INTO RCI ( RCI_ID, VISIT_ID, RCI_NAME, DCI_DATE ) VALUES ( 18790240, 12140, 'SCREENING', '19000101');
    1 row inserted
    SQL> INSERT INTO RCI ( RCI_ID, VISIT_ID, RCI_NAME, DCI_DATE ) VALUES ( 21724540, 12140, 'SCREENING', '19000101');
    1 row inserted
    SQL> INSERT INTO RCI ( RCI_ID, VISIT_ID, RCI_NAME, DCI_DATE ) VALUES ( 14876540, 12140, 'SCREENING', '20091015');
    1 row inserted
    SQL> commit;
    Commit complete
    SQL> select * from rci;
         RCI_ID    VISIT_ID RCI_NAME             DCI_DATE
       14876540       12140 SCREENING            19000101
       14876640       12140 SCREENING            19000101
       14876740       12140 SCREENING            19000101
       14876840       12140 SCREENING            19000101
       14876940       12140 SCREENING            19000101
       14877040       12140 SCREENING            19000101
       14877140       12140 SCREENING            19000101
       14877240       12140 SCREENING            19000101
       14877240       12140 SCREENING            19000101
       14877640       12140 SCREENING            19000101
       14877740       12140 SCREENING            19000101
       14877840       12140 SCREENING            19000101
       14877940       12140 SCREENING            19000101
       14878040       12140 SCREENING            19000101
       14878140       12140 SCREENING            19000101
       14878240       12140 SCREENING            19000101
       14878340       12140 SCREENING            19000101
       14878440       12140 SCREENING            19000101
       14878540       12140 SCREENING            19000101
       14877640       12140 SCREENING            19000101
       14877740       12140 SCREENING            19000101
       14878340       12140 SCREENING            19000101
       14878540       12140 SCREENING            19000101
       17418240       12140 SCREENING            20000101
       17418340       12140 SCREENING            20000101
       17418440       12140 SCREENING            20000101
       14878240       12140 SCREENING            20000101
       18790240       12140 SCREENING            19000101
       21724540       12140 SCREENING            19000101
       14876540       12140 SCREENING            20091015
    30 rows selected
    SQL> -- using the sample similar code that i have previously posted it returned all the rows.
    SQL> select rci.*
      2    from rci
      3   where rci.visit_id in (select r1.visit_id
      4                            from (select rci.visit_id,
      5                                         count(*) over (partition by rci.visit_id, rci.dci_date order by rci.visit_id) rn
      6                                    from rci) r1
      7                            where r1.rn = 1)
      8  order by rci.rci_id;
         RCI_ID    VISIT_ID RCI_NAME             DCI_DATE
       14876540       12140 SCREENING            20091015
       14876540       12140 SCREENING            19000101
       14876640       12140 SCREENING            19000101
       14876740       12140 SCREENING            19000101
       14876840       12140 SCREENING            19000101
       14876940       12140 SCREENING            19000101
       14877040       12140 SCREENING            19000101
       14877140       12140 SCREENING            19000101
       14877240       12140 SCREENING            19000101
       14877240       12140 SCREENING            19000101
       14877640       12140 SCREENING            19000101
       14877640       12140 SCREENING            19000101
       14877740       12140 SCREENING            19000101
       14877740       12140 SCREENING            19000101
       14877840       12140 SCREENING            19000101
       14877940       12140 SCREENING            19000101
       14878040       12140 SCREENING            19000101
       14878140       12140 SCREENING            19000101
       14878240       12140 SCREENING            19000101
       14878240       12140 SCREENING            20000101
       14878340       12140 SCREENING            19000101
       14878340       12140 SCREENING            19000101
       14878440       12140 SCREENING            19000101
       14878540       12140 SCREENING            19000101
       14878540       12140 SCREENING            19000101
       17418240       12140 SCREENING            20000101
       17418340       12140 SCREENING            20000101
       17418440       12140 SCREENING            20000101
       18790240       12140 SCREENING            19000101
       21724540       12140 SCREENING            19000101
    30 rows selected
    SQL> just as what frank have said it will be helpful if you post a sample output based on the original posting, that is in the first posting you have.

  • Help with Oracle Analytic Function scenario

    Hi,
    I am new to analytic functions and was wondering if someone could help me with the data scenario below. I have a table with the following data
    COLUMN A COLUMN B COLUMN C
    13368834 34323021 100
    13368835 34438258 50
    13368834 34438258 50
    13368835 34323021 100
    The output I want is
    COLUMN A COLUMN B COLUMN C
    13368834 34323021 100
    13368835 34438258 50
    A simple DISTINCT won't give me the desired output so i was wondering if there is any way that I can get the result using ANALYTIC FUNCTIONS and DISTINCT ..
    Any help will be greatly appreciated.
    Thanks.

    Hi,
    Welcome to the forum!
    Whenever you have a question, please post your sample data in a form that people can use to re-create the problem and test their solutions.
    For example:
    CREATE TABLE     table_x
    (      columna     NUMBER
    ,      columnb     NUMBER
    ,      columnc     NUMBER
    INSERT INTO table_x (columna, columnb, columnc) VALUES (13368834, 34323021, 100);
    INSERT INTO table_x (columna, columnb, columnc) VALUES (13368835, 34438258, 50);
    INSERT INTO table_x (columna, columnb, columnc) VALUES (13368834, 34438258, 50);
    INSERT INTO table_x (columna, columnb, columnc) VALUES (13368835, 34323021, 100);Do you want something that works in your version or Oracle? Of course you do! So tell us which version that is.
    How do you get the results that you want? Explain what each row of output represents. It looks like
    the 1st row contains the 1st distinct value from each column (where "first" means descending order for columnc, and ascending order for the others),
    the 2nd row contains the 2nd distinct value,
    the 3rd row contains the 3rd distinct value, and so on.
    If that's what you want, here's one way to get it (in Oracle 9 and up):
    WITH     got_nums     AS
         SELECT     columna, columnb, columnc
         ,     DENSE_RANK () OVER (ORDER BY  columna        )     AS a_num
         ,     DENSE_RANK () OVER (ORDER BY  columnb        )     AS b_num
         ,     DENSE_RANK () OVER (ORDER BY  columnc  DESC)     AS c_num
         FROM     table_x
    SELECT       MAX (a.columna)          AS columna
    ,       MAX (b.columnb)          AS columnb
    ,       MAX (c.columnc)          AS columnc
    FROM              got_nums     a
    FULL OUTER JOIN  got_nums     b     ON     b.b_num     =           a.a_num
    FULL OUTER JOIN  got_nums     c     ON     c.c_num     = COALESCE (a.a_num, b.b_num)
    GROUP BY  COALESCE (a.a_num, b.b_num, c.c_num)
    ORDER BY  COALESCE (a.a_num, b.b_num, c.c_num)
    ;I've been trying to find a good name for this type of query. The best I've heard so far is "Prix Fixe Query", named after the menus where you get a choice of soups (listed in one column), appetizers (in another column), main dishes (in a 3rd column), and so on. The items on the first row don't necessaily have any relationship to each other.
    The solution does not assume that there are the same number of distinct items in each column.
    For example, if you add this row to the sample data:
    INSERT INTO table_x (columna, columnb, columnc) VALUES (13368835, 34323021, 99);which is a copy of the last row, except that there is a completely new value for columnc, then the output is:
    `  COLUMNA    COLUMNB    COLUMNC
      13368834   34323021        100
      13368835   34438258         99
                                  50starting in Oracle 11, you can also do this with an unpivot-pivot query.

  • Need some kind of Analytical Function

    Hi Oracle experts
    I need a little help from you experts. I have a PARTY table as listed below
    The existing data
    Party key     ID_INTERNAL     EID          BID
    1          11111          123
    1          11111          321
    1          22222          321          899
    1          66666          ------          888
    New records comes
    I have to assign a party key to each record based on which attribute is matching
    Now the situation is as new records comes.
    New records comes
    ID_INTERNAL     EID          BID
    22222          555
    44444          555          
    89898          ------          888
    If I match on ID_INTERNAL I may not be able to match ID_INTERNAL 44444 and 89898 and if I match EID or BID the same situation.
    Is thera any analytical function which helps me assigning a party key to all the recoords. ALl the above records should be assigned PARTY KEY 1 only.
    Please help
    Thanks
    Rajesh

    Justin
    My main goal is to assign a party key from existing set of records to the new records which are being selected/inserted. I have to write my algoritum in such a way that the new values should match their value in existing records.
    Example
    my first new record has a value of 11111 under ID_INTERNAL and in the same record it has a value of 555 under EID attribute. so based on matching algoritum for ID INTERNAL it will be assigned existing party key 1.
    Similarly second new record has a value of 87777 under ID INTERNAL and has a value of 555 under EID and this ID INTERNAL does not exists in the target table. but the value of 555 is available under EID attribute so I have to write algoritum based on EID.
    Now the delima is my target table is as follows
    Party key PARTYID PARTYNAME
    1 11111 ITSID
    1 123 EID
    1 321 EID
    Now when new records come I have to write match algortium for ID_INTERNAL to PARTYID for Partyname='ITSID'
    Once matched this record ID INTERNAL=11111 and EID =555 assigned a party key=1. So after first record the output table slooks like
    Party key PARTYID PARTYNAME
    1 11111 ITSID
    1 123 EID
    1 321 EID
    1 555 EID
    Same way for second new record where the values are ID_INTERNAL=87777 and EID=555. I have to write match algortium based on EID because the EID value of 555 already exists in target tabel with party key.
    SO after second record the target table will look like
    Party key PARTYID PARTYNAME
    1 11111 ITSID
    1 123 EID
    1 321 EID
    1 555 EID
    1 87777 ITSID
    So this is how I have to solve this match algoritum.
    Please help me if you need any information I will be glad to provide you all.
    Thanks
    Regards
    Rajesh

  • SSRS Bar Chart grouping date series into Months, setting scaler start and end ranges

    I've been trying to solve this issue for a few days now without writing a sql script to create a "blank" for all of missing data points so that I get a bar for each month.  I have date series (by day) data points grouped by two items
    that creates a set of bar charts.  EG:  one chart per product in the tablix detail grouped to site level.
    My issue is I would like the start and end of the charts to be the same for all charts and the only way I get it to work is with a chart that continues to show each date on the chart. 
    EG:
    I have the graph start and end points set and scaling by month as I would like but each bar is a day instead of aggregating to a month level.   My issue I hope to find a workaround for is if I go to Category Groups and define the grouping
    to group with a year and month function the series is no longer treated as date data and I cannot control scaling.  It works fine if all months have activity, but I can't figure out how to always have all charts start at "May 2012" in this example. 
    The only start and end point that I've been able to get to work once doing this are integer based, eg normal start would be 1 for each graph, but 1 doesn't equate to the same month from chart to chart.
    I hope SSRS can provide the solution.  I do know I can write a query that creates a ZERO value for each month/product/site but I don't want to leave the client with a query like that to support.
    -cybertosis

    Hi cybertosis,
    If I understand correctly, you want to display all month category label in the X-Axis. You have configure the Scalar Axis, however, it cannot display the requirement format.
    In your case, if we want the specific data format, we can configure Number property to set the corresponding Category data format. Please refer to the following steps:
    Right click the X-Axis, select Horizontal Axis Properties.
    Click Number in the left pane. Click Date option in the Category dialog box.
    Then, select Jan 2000 option.
    Please refer to the following screenshot below:
    If there are any misunderstanding, please feel free to let me know.
    Regards,
    Alisa Tang
    If you have any feedback on our support, please click
    here.
    Alisa Tang
    TechNet Community Support

  • Replacing Oracle's FIRST_VALUE and LAST_VALUE analytical functions.

    Hi,
    I am using OBI 10.1.3.2.1 where, I guess, EVALUATE is not available. I would like to know alternatives, esp. to replace Oracle's FIRST_VALUE and LAST_VALUE analytical functions.
    I want to track some changes. For example, there are four methods of travel - Air, Train, Road and Sea. Would like to know traveler's first method of traveling and the last method of traveling in an year. If both of them match then a certain action is taken. If they do not match, then another action is taken.
    I tried as under.
    1. Get Sequence ID for each travel within an year per traveler as Sequence_Id.
    2. Get the Lowest Sequence ID (which should be 1) for travels within an year per traveler as Sequence_LId.
    3. Get the Highest Sequence ID (which could be 1 or greater than 1) for travels within an year per traveler as Sequence_HId.
    4. If Sequence ID = Lowest Sequence ID then display the method of travel as First Method of Travel.
    5. If Sequence ID = Highest Sequence ID then display the method of travel as Latest Method of Travel.
    6. If First Method of Travel = Latest Method of Travel then display Yes/No as Match.
    The issue is cells could be blank in First Method of Travel and Last Method of Travel unless the traveler traveled only once in an year.
    Using Oracle's FIRST_VALUE and LAST_VALUE analytical functions, I can get a result like
    Traveler | Card Issue Date | Journey Date | Method | First Method of Travel | Last Method of Travel | Match?
    ABC | 01/01/2000 | 04/04/2000 | Road | Road | Air | No
    ABC | 01/01/2000 | 15/12/2000 | Air | Road | Air | No
    XYZ | 01/01/2000 | 04/05/2000 | Train | Train | Train | Yes
    XYZ | 01/01/2000 | 04/11/2000 | Train | Train | Train | Yes
    Using OBI Answers, I am getting something like this.
    Traveler | Card Issue Date | Journey Date | Method | First Method of Travel | Last Method of Travel | Match?
    ABC | 01/01/2000 | 04/04/2000 | Road | Road | <BLANK> | No
    ABC | 01/01/2000 | 15/12/2000 | Air | <BLANK> | Air | No
    XYZ | 01/01/2000 | 04/05/2000 | Train | Train | <BLANK> | No
    XYZ | 01/01/2000 | 04/11/2000 | Train | <BLANK> | Train | No
    Above, for XYZ traveler the Match? clearly shows a wrong result (although somehow it's correct for traveler ABC).
    Would appreciate if someone can guide me how to resolve the issue.
    Many thanks,
    Manoj.
    Edited by: mandix on 27-Nov-2009 08:43
    Edited by: mandix on 27-Nov-2009 08:47

    Hi,
    Just to recap, in OBI 10.1.3.2.1, I am trying to find an alternative way to FIRST_VALUE and LAST_VALUE analytical functions used in Oracle. Somehow, I feel it's achievable. I would like to know answers to the following questions.
    1. Is there any way of referring to a cell value and displaying it in other cells for a reference value?
    For example, can I display the First Method of Travel for traveler 'ABC' and 'XYZ' for all the rows returned in the same column, respectively?
    2. I tried RMIN, RMAX functions in the RDP but it does not accept "BY" clause (for example, RMIN(Transaction_Id BY Traveler) to define Lowest Sequence Id per traveler). Am I doing something wrong here? Why can a formula with "BY" clause be defined in Answers but not the RPD? The idea is to use this in Answers. This is in relation to my first question.
    Could someone please let me know?
    I understand that this thread that I have posted is related to something that can be done outside OBI, but still would like to know.
    If anything is not clear please let me know.
    Thanks,
    Manoj.

Maybe you are looking for

  • Problems parsing double quote

    I have been trying to figure out my problem for several hours, but still didn't get it. Hope to get an idea from you guys. My code is as follows: var astr; var outCr ="|"; var outLf = "\u0000"; var cr = "\n"; var lf ="\r"; var ddQuote="""; var dtQuot

  • Validation error when submitting a form

    Hi, My first post so please don't come down on me like a ton of bricks if this is the wrong forum. I created a form in Adobe LiveCycle Designer 7,0,050519,0. Some users could not send the results back via the email button, but others did. That's okay

  • How I will delete on selected records ?

    Hi fiends, I have two database table records in a internal table(  with work area) . There have multiple records with same material number. This records displaying in module pool program. Where I can select individual records. How I will delete on se

  • What is the WinRT equivalent of MediaPlayerLauncher

    WP8 has MediaPlayerLauncher, so what is the WinRT equivalent of MediaPlayerLauncher for WP8.1? Hong

  • Macbook pro using a lot of hard drive space

    I just bought the new macbook pro with the 250 gig hard drive.. but without even transferring anything at all to my new mac from my old.. it already says it only has 178.1 gig's of hard drive space available.. is it seriously already using over 50 gi