calculate the month to date in Obiee11g

Hello
I use OBIEE11g, im a problem-

Problem: results of the beginning of this month beginning of previous month results vs.
example: If Im in 12 February the calculation is * February 1 to February 12 * also * January 1 to January 12 *.

-Zia

Can you give your month there is calculation please?

It is similar to the AGO (SH. Salesfacts. "" Quantity ", SH. TimesDim. ("" Month ", 1).

Tags: Business Intelligence

Similar Questions

  • How to calculate the month on month growth rates in an OBIEE application?

    Hi all

    I would like to ask for your help on how to calculate the months on growth rate previous/[(last month-previous month) month * 100%] in a query OBIEE. This report should always be calculated for the last 2 months available.

    I have the following query:
    Month0 | Months1. Month2
    Produces a 500 | 100. 200
    Product B 600 | 300. 150

    I would like to add month on month column as follows:
    Month0 | Months1. Month2. Month on Month (%)
    Produces a 500 | 100. 200 | + 100.00%
    Product B 600 | 300. 150. -50.00%

    I tried to add a calculated item, but it failed because I couldn't find a way to not show the column calculated in percent with 2 decimal places. In addition, I would ideally prefer to have an automatic update but as far as I understand it can be done in the automatically calculated item

    I also tried to add a new column to the column area and to filter the results for the last month, then for the previous month and then based on that to calculate the necessary ratio but unfortunately it does not work.

    Thank you in advance your advice

    Hello

    The best way to solve this problem is by using the function Ago. With this, you can create a logical column for the previous month. Then you will have 2 columns available with which you can do your calculations.

    If you want to do this with a calculated item (don't know if formatting will work for you), but you can do the more general calculation using $1 for the $2 for the 2 column and 1 column in your calculation. If ($x) columns will change with the columns in your report.

    Concerning

  • Select records based on the monthly anniversary date

    Hello

    I have a table with a field of date_added and I want to select records from monthly birthday of this field.

    for example. ID, Date_added
    1, DECEMBER 10, 2012
    2, 11 NOVEMBER 2012
    3, 10 MARCH 2012
    4, FEBRUARY 28, 2012
    5, 30 DECEMBER 2012

    So for January 10, 2013, I would like to return the documents 1 and 3 only

    I started watching the extract function, but this little falls down to the records at the end of the month. For example, on 28 February, I also include records where 29, 30 or 31 is the day of date_added. So, in the above table, I won't return documents 4 and 5, but retrieves only returns 4.

    Is there a simple function to make the request of birthday this month - have I missed something very obvious? Or I have to write a query to explicitly dates at the end of the month? So far I have not found a reasonable solution!

    I use 11g

    Thank you

    user11259857 wrote:
    Hi Al,.

    No I don't think that there is a flaw. For example, the 30 Jan is not the last day of the month, but is June 30. Thus, on 30 January I want only to interrogate all the dates falling on the 30th - 28 February, after already being interrogated on the 28 Jan. However, on 30 June, I would query the 30th of each month, as well as the 31 January, March, may, July, Aug, Oct, dec. February is a special case, being both shorter and a leap year

    Thank you

    Richard

    Hi Richard,

    so, we can assume that your needs are:

    If the day is the last day of that month, interview the day of the other months being > = day of the current month.

    That is to say:

    Jan-30 = query only 30 other months
    Jan-31 = query only 31 of the other months

    Feb-28 (non-leap years) = question 28, 29, 30 and 31 other months
    29 February (leap year) = query 29,30,31 to other months

    Mar-30 = query only 30 other months
    Apr-30 = query 30 and 31 other months

    This hypothesis is correct?

    If so, then something like this should work:

    WITH mydates(id, date_added) AS
    (
       SELECT 1, TO_DATE('10-DEC-2012', 'DD-MON-YYYY') FROM DUAL UNION ALL
       SELECT 2, TO_DATE('11-NOV-2012', 'DD-MON-YYYY') FROM DUAL UNION ALL
       SELECT 3, TO_DATE('10-MAR-2012', 'DD-MON-YYYY') FROM DUAL UNION ALL
       SELECT 4, TO_DATE('28-FEB-2012', 'DD-MON-YYYY') FROM DUAL UNION ALL
       SELECT 5, TO_DATE('30-DEC-2012', 'DD-MON-YYYY') FROM DUAL
    )
    SELECT id, date_added
      FROM mydates
     WHERE (:input_date = LAST_DAY(:input_date) AND TO_CHAR(:input_date,'DD') <= TO_CHAR(date_added, 'DD'))
        OR TO_CHAR(:input_date,'DD') = TO_CHAR(date_added, 'DD');
    
    with input_date = 28/02/2013
    
    id   date_added
    4    28/02/2012
    5    30/12/2012
    

    Kind regards.
    Al

    Published by: Alberto Faenza on 10 January 2013 15:21
    Added example

  • Calculate the difference of date in milliseconds

    Hi all

    Version:-Oracle Database 10 g Enterprise Edition release 10.2.0.3.0

    Requirement:-to calculate the difference between current systimestamp and January 1, 1970 with milliseconds up to precision (we need this to store in other tables)

    The query I gave below it gives a value of up to 1 sec accuracy

    Select (sysdate - to_date (January 1, 1970 00:00:00 ',' DD-MON-YYYY HH24;)) SS')) * (24 * 60 * 60 * 1000) double;

    Output
    1261545437000

    After 1 second
    1261545439000 and so on

    I can the difference in accuracy to the millisecond
    select (sysdate - to_date('01-JAN-1970','DD-MON-YYYY')) * (24 * 60 * 60 * 1000)+to_number(to_char(systimestamp,'FF3')) from dual;
    

    Max

    Published by: Massimo Ruocchio on December 23, 2009 12:19
    Fix

  • Calculate the months

    Hi, could someone help me calculate months in OBIEE, for example:

    Start date end date duration in months

    1.1.2009 31.10.2010 20

    What kind of formula or a function I use in the column: duration in months?

    TIMESTAMPDIFF (sql_tsi_month, col1, col2)

    See you soon,.

    http://cool-bi.com

  • sum of the months of data first weeks

    1 January 09 5
    January 2 09 3
    January 3 09 2
    :
    :
    :
    1 February 09 1
    February 2 09 1
    February 3 09 1
    4 February 09 1
    5 February 09 1
    6 February 09 1
    February 7 09 1

    For any date in January I should get the sum of the values of the next month first week i, e 1 February to 7 February 09 09
    for example, 01 - jan - 09 = 7
    :
    :
    29 jan - 09 = 7
    It will be better if you give the query I have terms of

    Sum (a) over (partition by order b by c lie between the interval Trunc (Trunc (sysdate, 'MONTH') + 1, 'MONTH') day following and '7' next day)

    Hello

    When you use a DATE column, specify the RANGE as a number of days:

    SELECT  SUM (a) OVER ( PARTITION BY     b
                                   ORDER BY          c
                     RANGE BETWEEN     ADD_MONTHS (TRUNC (c, 'MM'), 1)           - c  FOLLOWING
                              AND     ADD_MONTHS (TRUNC (c, 'MM'), 1) + 6.99999 - c  FOLLOWING  -- Not 7, as origninally posted
                   )  AS next_month_week_1_a
    

    Published by: Frank Kulash, March 11, 2009 12:41

    Fixed bug reported by Blushadow.

  • How to calculate the rate of data transfer if I know that the total number of samples/s?

    I'm looking to set a PXI system for measurement of County at high speed, routes, while that controlled remotely via MXI - 4.  How can I be sure that the controller is capable of rapid data transfer quite seen the number of channels and frequencies of sampling provided?

    I think I figured this out, but maybe someone can save me.  For the task at hand, I will have a PXI-4496 and four PXI - 6143 s all 32768 samples/s sampling.  4496 is 24-bit, and 6143 is 16-bit.  Thus,.

    bits of samples/s/channel x 24 16 channels x 32768/8 = 1 048 576 bytes / s

    +

    32 x 32768 samples/s/channel x 16 bits/8 channels = 2,097152 bytes/sec

    =

    3 145 728 bytes/s, or exactly 3 MB/s.

  • Calculate the Date of the next

    Hello

    I have two dates:

    Start date: December 18, 2007
    End date: December 18, 2012

    I would like to calculate the next payment date, using the example above, it would be December 18, 2010.

    How can I achieve this in SQL by using the current date / month, keeping in mind, if sysdate is past the date, then the next payment date will follow month.

    Thank you

    Published by: sliderrules on December 15, 2010 08:50

    Hello

    Assuiming the due date is the same day of the month (if possible) as start_date:

    SELECT  start_date
    ,     ADD_MONTHS ( start_date
                 , CEIL ( MONTHS_BETWEEN ( SYSDATE     -- or maybe SYSDATE + 1
                                         , start_date
                                )
                     )
                 )  AS next_payment_date
    FROM    table_x
    ;
    

    If you happen to run it on December 18, the expiry date should be December 18 or January 18?
    The code above returns on 18 December. If you want Jnauary 18, replace SYSDATE SYSDATE + 1.

    Assuiming that the due date is the same day of the month (if possible) as end_date, you could do something similar with the help of end_date.
    Whatever it is, only one of the columns plays a role in this problem? What results would you if, for example. start_date was January 1, 2010 and July 20, 2012 end_date?

    I hope that answers your question.
    If not, post a small example of data (CREATE TABLE and INSERT statements) and also publish outcomes from these data. For the results, after what you want if it was executed on 15 December 2010 at noon.
    Explain, using specific examples, how you get these results from these data.
    Always tell what version of Oracle you are using.

  • calculate the time in seconds, the day of the year and year

    I have a data file where they record three columns, the seconds elapsed since midnight, day of the year and the year.  I am creating a timestamp of LabVIEW from these three numbers.  Of seconds elapsed since midnight, I can create seconds, minutes and hours.  If I feed in a cluster of time with the day of the year and the year, the timestamp of output is 0.  Does not work.  Although an input of the day of the year element, the Date and time with seconds function apparently requires day for months and months to work.

    The only solution I can imagine at this stage is to calculate the month and the day of the day of the year, which would imply a choice of the month table and a check of the leap year.

    Smart solutions, I'm missing?

    DaveT

    Dave,

    I found a Julian Georgian so far.

  • How do I know the amount of data to be persisted?

    Hi all

    I am building an application that also has a Jabber client. I want to keep the history of cats, but I don't know how much data persists.

    Is there a guide on how to calculate the amount of data to be persisted?

    I'm working with JDE Plugin on Eclipse 3.4 4.5, develop for "BOLD" and curve.

    Thank you

    -fr4gus

    You're not really serialization or deserialization anything. Simply read the lines of the file in your data structure and come back when you want to write again outside the disk.

  • How to calculate the number of days/weeks/months between 2 dates?

    Hello

    I would like to know how to calculate the number of days/weeks/months between 2 dates in OBIEE 11 g, for example, I have 26/05/2013 and 19/05/2013, then I want to get 7 days.

    Thank you!
    Jamie

    Hi Jamie,

    Through this links...

    http://www.bravesoft.com/blog/?p=682
    http://twobiee.blogspot.in/2012/01/working-with-date-differences.html

    Mark as correct it allows u...
    Thank you...

  • calculate a date field first of the month

    I need to calculate a date field using date of hire as a base date, and it should return the first of the month following 30 days of date of hire.  (date of rental + 30 days then first of the month following that date).

    Hello margery497,

    In this scenario, you can create a text field 1 with validation as a calculated field and can add now() formula inside. Then, in the text field 2, you can add the now() + 30 formula and save it with the calculated field.

    Here is the reference for validating field:

    http://helpx.Adobe.com/EchoSign/KB/form-fields---validations.html

    Kind regards

    -Usman

  • How to calculate the first day of the month following in BI Publisher

    I need to be able to calculate the first day of the month of a date field in a BI Publisher model. The field name is COL_CLM_180 and contains a date in the format "YYYY-MM-DD". I have found so far any documentation that still gives me an idea of what to do.

    Any help or advice would be appreciated

    Hi - thank you very much for your help. Your last answer got me going in the right direction and I indeed was dense. I don't know why I don't think to the calculation in the original query. I put the statement: TRUNC (ADD_MONTHS(A.COL_CLM_180,1), 'MM') in a column in the query of conduct and it has worked flawlessly. Thank you - thank you - thank you.

  • to calculate the days of sheets each month

    Hi all

    I need a query which can get leaves from an employee of days each month.

    Example:

    1.

    If an employee has leave of date_start = 15 January 2014 ', date_end = 30 January 2014 "which is in the same month, then it will be"

    Duration = 15-30 + 1 = 16 days

    Total_days_in_jan = 31 days

    Calculation of salary leave will be amount = (: base +: housing) * (: duration) / (Total_days_in_jan)

    = (1000 + 2000) * 16/31

    ' 2. If his two month date_start = 15 January 2014 ', date_end = 10 February 2014.

    I wrote code that works perfect below

    If to_char(:date_start,'mm') = to_char(:date_end,'mm') then

    v_mon_days: = TO_CHAR (last_day (TO_DATE(:date_start,'DD-MON-YYYY')), 'DD');

    v_tot: = (nvl(:BASIC1,0) + nvl (:FUJ_LIVING,0)) *(:Duration_)/v_mon_days;

    elsif to_char(:date_start,'mm') <>to_char(:date_end,'mm') then

    v_mon_days_st_dt: = TO_CHAR (last_day(:date_start), 'DD');

    v_mon_days_en_dt: = TO_CHAR (last_day(:date_end), 'DD');

    v_lv_days_st_dt: = last_day(:date_start) -: date_start + 1;

    v_lv_days_en_dt: =: date_end - trunc(:date_end,'mm') + 1;

    v_tot_st_dt: = (nvl(:BASIC1,0) + nvl(:FUJ_LIVING,0)) * (v_lv_days_st_dt) / v_mon_days_st_dt;

    v_tot_en_dt: = (nvl(:BASIC1,0) + nvl(:FUJ_LIVING,0)) * (v_lv_days_en_dt) / v_mon_days_en_dt; 

    v_tot: = nvl(v_tot_st_dt,0) + nvl(v_tot_en_dt,0);

    end if;

    Return round (v_tot);

    3. If the 3 months off, say date_start = 24-may-2014 date_end = July 2, 2014.

    I need some help here... what happens if the 4 month also leave...

    Please suggest.

    Kind regards

    Afzal.

    Hi Roger, Etbin

    Thanks for your replies.

    I found the solution on the month to display between two dates.

    To calculate that I used the loop as below

    declare

    ST DATE: =: date_start;--TO_DATE('24-MAY-2014','DD-MON-YYYY');

    ED DATE: =: date_end;--TO_DATE('02-JUL-2014','DD-MON-YYYY');

    number of v_t_amount;

    CURSOR C1 IS

    SELECT more GRAND (ST, ADD_MONTHS (TRUNC (st, 'MONTH'), (LEVEL - 1))) dt.

    LESS (ed,

    LAST_DAY (ADD_MONTHS (TRUNC (st, 'MONTH'), (LEVEL - 1)))

    ) ld

    OF THE DOUBLE

    CONNECT BY LEVEL<>

    MONTHS_BETWEEN (TRUNC (ed, 'MONTH'), TRUNC (st, 'MONTH'))

    + 1

    ORDER BY 1;

    V_AMOUNT NUMBER: = 0;

    V_T_AMOUNT NUMBER: = 0;

    NUMBER OF V_DAYS;

    BEGIN

    FOR I IN C1 LOOP

    V_AMOUNT: = (nvl(:SALARY_DIFF,0) + nvl(:SPECIAL_ALLOWANCE,0) + nvl(:CF_OTHERS,0)

    + NVL(:Computer,0) + nvl(:PHONE_ALLOW,0) + nvl(:WORK_NATURAL,0)

    (+ nvl(:TRANSPORTATION,0) * (i.1d - i.dt + 1) / TO_CHAR (LAST_DAY (i.1d), 'dd'));

    V_T_AMOUNT: = V_AMOUNT;

    end loop;

    end if;

    dbms_output.put_line (v_t_amount);

    end;

  • To calculate the amount on the basis of the date of

    Hello

    We must consider the functionality of oracle when it sees in 365 days a year. (for leap years 366 days)

    calendar year of 365 days. calendar year of 12 months. Months will track the number of calendar days in the month. For example the Feb has 28 days and Oct. has 31 days.

    Example:

    For the period from 27/06/12 to 20/08/12

    Annual amount of $3214.

    Calculation

    $3214 / 12 months = $267,83 per month

    For June, $267,83 / 30 days in a month = $8.93 daily rate

    6/27-6/30 is 4 days of service.  x 4 = $35,72 $8.93

    7/1-7/31 is considered to be a full month. = $267,83

    For August, 8/1 /-8/20 is considered to be 20 days. Per day = 267.83 / 31 = 8.64

    20 days = $172.79

    TOTAL = $476,34

    Please help me on how to do the following calculations.

    Concerning

    Suresh

    Another solution, works better than the previous:

    with the data as

    (

    Select to_date (June 27, 2013 ',' DD/MM/YYYY ') from_dt, to_date (August 20, 2013 ',' DD/MM/YYYY ') to_dt, amt double 3214

    )

    Select sum (DM)

    de)

    Select from_dt, to_dt, start_dt, last_dt,

    (last_dt - start_dt + 1) *--> multiply applicable days of the month at the daily amount, calculated below

    Sum)

    round)

    (amt/12) /--> calculate a monthly amount

    TO_CHAR)

    LAST_DAY (curr_dt)

    , 'DD '.

    )--> Find last day of the month and divide the monthly amount with the last day and calculate the daily amount

    2

    )--> Around the daily amount to 2 decimal places

    ) on sm--> sum the amount daily (partition to_char (curr_dt, 'MM'))

    de)

    Select from_dt, to_dt, TN,

    less (add_months (from_dt, level - 1), to_dt) curr_dt,.

    decode (level 1, less (add_months (from_dt, level - 1), to_dt), trunc (less (add_months (from_dt, level - 1), to_dt), 'MM')) start_dt;

    less (last_day (add_months (from_Dt, level - 1)), to_dt) last_dt

    from the data

    connect by level<= months_between(trunc(to_dt,="" 'mm'),="" trunc(from_dt,="" 'mm'))="" +="">

    )

    );

    SUM (DM)

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

    476.36

    This avoids looping of data for all of the Dates if opposed to a loop for each month, which increases its performance. See plans to explain to the two queries:

    explain plan for

    with the data as

    (

    Select to_date (June 27, 2013 ',' DD/MM/YYYY ') from_dt, to_date (August 20, 2013 ',' DD/MM/YYYY ') to_dt, amt double 3214

    ),

    div_data as

    (

    Select from_dt, to_dt, annual_amount from the amt Tower (amt/12, 2) monthly_amount

    from the data

    )

    Select sum (per_day_amt)

    de)

    Select to_char (level - 1, 'Lun' + from_dt) curr_dt,.

    sum (round (monthly_amount/to_number (substr (to_char (last_day (level - 1 + from_dt), 'DDMMYYYY'), 1, 2)), 2)) per_day_amt

    of div_data

    connect by level<= (to_dt="" -="" from_dt)="" +="">

    To_char Group (level - 1, 'Lun' + from_dt)

    );

    Hash value of plan: 1042012692

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

    | ID | Operation | Name                        | Lines | Bytes | Cost (% CPU). Time |

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

    |   0 | SELECT STATEMENT |                             |     1.    13.     5 (20) | 00:00:01 |

    |   1.  TRANSFORMATION OF THE TEMPORARY TABLE.                             |       |       |            |          |

    |   2.   LOAD SELECT ACE |                             |       |       |            |          |

    |   3.    QUICK DOUBLE |                             |     1.       |     2 (0) | 00:00:01 |

    |   4.   GLOBAL TRI |                             |     1.    13.            |          |

    |   5.    VIEW                          |                             |     1.    13.     3 (34) | 00:00:01 |

    |   6.     HASH GROUP BY.                             |     1.    16.     3 (34) | 00:00:01 |

    |*  7 |      CONNECT TO WITHOUT FILTERING.                             |       |       |            |          |

    |   8.       COUNT                      |                             |       |       |            |          |

    |   9.        VIEW                      |                             |     1.    16.     2 (0) | 00:00:01 |

    |  10.         TABLE ACCESS FULL | SYS_TEMP_0FD9D86CF_5F8521E2 |     1.    44.     2 (0) | 00:00:01 |

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

    Information of predicates (identified by the operation identity card):

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

    7 filter (LEVEL<>

    explain plan for

    with the data as

    (

    Select to_date (June 27, 2013 ',' DD/MM/YYYY ') from_dt, to_date (August 20, 2013 ',' DD/MM/YYYY ') to_dt, amt double 3214

    )

    Select sum (DM)

    de)

    Select from_dt, to_dt, start_dt, last_dt,

    (last_dt-start_dt + 1) * sum (round ((amt/12)/to_char (last_day (curr_dt), 'JJ') 2)), in the sm (partition to_char (curr_dt, 'MM'))

    de)

    Select from_dt, to_dt, TN,

    less (add_months (from_dt, level - 1), to_dt) curr_dt,.

    decode (level 1, less (add_months (from_dt, level - 1), to_dt), trunc (less (add_months (from_dt, level - 1), to_dt), 'MM')) start_dt;

    less (last_day (add_months (from_Dt, level - 1)), to_dt) last_dt

    from the data

    connect by level<= months_between(trunc(to_dt,="" 'mm'),="" trunc(from_dt,="" 'mm'))="" +="">

    )

    );

    Hash value of plan: 1669308594

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

    | ID | Operation | Name | Lines | Bytes | Cost (% CPU). Time |

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

    |   0 | SELECT STATEMENT |      |     1.    13.     3 (34) | 00:00:01 |

    |   1.  GLOBAL TRI |      |     1.    13.            |          |

    |   2.   VIEW                           |      |     1.    13.     3 (34) | 00:00:01 |

    |   3.    KIND OF WINDOW.      |     1.    30.     3 (34) | 00:00:01 |

    |   4.     VIEW                         |      |     1.    30.     2 (0) | 00:00:01 |

    |*  5 |      CONNECT TO WITHOUT FILTERING.      |       |       |            |          |

    |   6.       QUICK DOUBLE |      |     1.       |     2 (0) | 00:00:01 |

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

    Information of predicates (identified by the operation identity card):

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

    5 filter (LEVEL<>

    Post edited by: PurveshK
    Updated with explanation.

Maybe you are looking for

  • Why the address bar does not appear?

    It has disappeared from my start page

  • Satellite Pro L870 - 17 X: lines black vertical and split after waking up screen

    Any help appreciated My new machine Windows 8 often, but not always, shows a screen divided with vertical black lines after waking up. When I say split screen, I mean that it seems that the screen "rolled" to the right, with the third party right of

  • Reset License monitoring ReadyNAS

    I have a ReadyNAS Ultra 4 Plus that I bought used. I was interested in the monitoring of a baby monitor software. Apparently, this unit has already expired the 30 day trial and I cannot understand how to enable a monitoring Home license (free license

  • Where is Active Desktop?

    What happened to Active Desktop, very useful (and not present on linux) existing features for Win98... 2K... XP? I really miss this feature and regret my old windows xp just because of this. Hope to see him return to seven?

  • How can I solve the impossible printing problem

    Hello I have printer HP Deskjet 3050 a J611 series (network), I bought the day of thanxgiving I installed and it was working good but last few days printer is not working when I print everything but they give me a msg on cannot print PL give me answe