FISCPER to Quarter in BW

dear all,
any function module in BW to convert fiscper year period to calendar quater? thanks.
please note i mention function module in BW.

Weird...
Must be versions.
I manage to use it just fine under BW side.
I'm using SAP Netweaver 2004s EHP1 (7.01)
Ok, here's the code of the FM UMC_FISCPER_TO_CALQUARTER under the BI side if you want it to use it:
FUNCTION umc_fiscper_to_calquarter.
*"*"Lokale Schnittstelle:
*"  IMPORTING
*"     REFERENCE(I_PERIV) TYPE  PERIV DEFAULT 'K4'
*"     REFERENCE(I_FISCPER) TYPE  UMC_Y_FISCPER
*"     REFERENCE(I_CALQUARTER_ICHANM) TYPE  UMC_Y_ICHANM OPTIONAL
*"  EXPORTING
*"     REFERENCE(ES_CALQUARTER) TYPE  UMC_YS_DIMVALS
*"  EXCEPTIONS
*"      INVALID
  DATA: ld_gjahr      LIKE t009b-bdatj,
        ld_poper      LIKE t009b-poper,
        ld_date       LIKE sy-datum,
        ld_year(4)    TYPE n,
        ld_month(2)   TYPE n,
        ld_quarter(1) TYPE n.
  ld_gjahr = i_fiscper(4).
  ld_poper = i_fiscper+4.
  CALL FUNCTION 'FIRST_DAY_IN_PERIOD_GET'
    EXPORTING
      i_gjahr              = ld_gjahr
*     I_MONMIT             = 00
      i_periv              = i_periv
      i_poper              = ld_poper
   IMPORTING
     e_date               = ld_date
   EXCEPTIONS
     input_false          = 1
     t009_notfound        = 2
     t009b_notfound       = 3
     OTHERS               = 4.
  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
            RAISING invalid.
  ENDIF.
  ld_year  = ld_date.
  ld_month = ld_date+4(2).
  CASE ld_month.
    WHEN 1 OR 2 OR 3.
      ld_quarter = 1.
    WHEN 4 OR 5 OR 6.
      ld_quarter = 2.
    WHEN 7 OR 8 OR 9.
      ld_quarter = 3.
    WHEN 10 OR 11 OR 12.
      ld_quarter = 4.
  ENDCASE.
  CONCATENATE ld_year ld_quarter INTO es_calquarter-bw_val_nam.
  IF i_calquarter_ichanm IS INITIAL.
    CONCATENATE gc_0calquarter_odbo '.[' es_calquarter-bw_val_nam ']'
      INTO es_calquarter-odbo_val_nam.
  ELSE.
CONCATENATE '[' i_calquarter_ichanm '].[' es_calquarter-bw_val_nam ']'
   INTO es_calquarter-odbo_val_nam.
  ENDIF.
ENDFUNCTION.
Diogo.

Similar Messages

  • Quarter Problem

    Hai all,
    I got struck in a Variable range for Quarter.
       If user gives Feb 2008, then I need Variable range
    from Jan 2008 to March 2008(end of current Quarter).
    If user gives May 2008,then I need variable range
    from Jan 2008 to june 2008.
    How we can proceed without customer exits.
    Rajesh

    Hi ,
    Check this.............
    http://help.sap.com/saphelp_nw04/helpdata/en/ba/12533d6dd60610e10000000a114084/frameset.htm
    /people/ed.herrmann/blog/2007/01/16/simplify-your-bw-enhancements-for-global-reporting-variables
    check this code also..........
    data : l_fiscvar type PERIV,
    l_fiscper type UMC_Y_FISCPER,
    l_quarter like UMC_YS_DIMVALS.
    l_fiscvar = TRAN_STRUCTURE-fiscvarnt.
    (infoobject 0fiscvarnt)
    by default fiscal variant = K4 if not specified
    l_fiscper = TRAN_STRUCTURE-fiscper.
    call function 'UMC_FISCPER_TO_CALQUARTER'
    exporting
    I_PERIV = l_fiscvar
    I_FISCPER = l_fiscper
    importing
    ES_CALQUARTER = l_quarter.
    RESULT = l_quarter.

  • Current calday or fiscal period to fiscal quarter

    Dear Experts,
    Is sy-datum calendar day date or fiscal day date?
    How to derive the fiscal period or quarter from sy-datum?
    Is there a function module to use to convert from current day (either fiscal day or calendar day) to derive the current Fiscal Quarter?
    I am not sure which function module can be used. Unable to find in the forum as well.
    Please could you provide me some clues?
    Thanks.
    Best regards
    Bass

    hi Steve,
    try function module 'UMC_FISCPER_TO_CALQUARTER'.
    following is sample code in transfer rules, in update rules use COMM_STRUCTURE for TRAN_STRUCTURE.
    hope this helps.
    data : l_fiscvar type PERIV,
    l_fiscper type UMC_Y_FISCPER,
    l_quarter like UMC_YS_DIMVALS.
    l_fiscvar = TRAN_STRUCTURE-fiscvarnt.
    (infoobject 0fiscvarnt)
    by default fiscal variant = K4 if not specified
    l_fiscper = TRAN_STRUCTURE-fiscper.
    call function 'UMC_FISCPER_TO_CALQUARTER'
    exporting
    I_PERIV = l_fiscvar
    I_FISCPER = l_fiscper
    importing
    ES_CALQUARTER = l_quarter.
    RESULT = l_quarter.
    ABAP Code Needed to convert Fiscal Period/Year to Quarter
    hope this helps.

  • Help needed in getting the previous Quarter Data

    Hello folks,
    I have this procedure where i have to modify the current procedure in the following manner:
    I need to get rid of the variables p_start and p_end so that i cannot see them in the crystal report and include the Frequency in the procedure to get the Data based on the Dates.
    and Main requirement is" If the Frequency is Quarterly " it should get the previous quarter Data, if "Frequency is monthly" it should return the previous month data.Can anyone please let me know where shud i make changes. Am including the procedure for refernce. Any help is appreciated
    Thanks a millioin,
    CREATE OR REPLACE PROCEDURE hcsc_recovery_report_h(report_record in out cr_return_types.gen_cursor,
    p_start       string,
    p_end         string)
    IS
    v_startdate date;
    v_enddate date;
    BEGIN
    v_startdate := to_date(p_start, 'YYYY/MM');
    v_enddate := last_day(to_date(p_end, 'YYYY/MM'));
    open report_record for
    select --distinct r.recovery_id
    r.event_id,
    r.event_case_id,
    c.client_id,
    c.client_code,
    c.client_name,
    b.branch_group_code,
    b.branch_group_description,
    g.employer_group_code,
    g.employer_group_name,
    e.client_policy_identifier,
    e.date_of_incident,
    e.event_type_code,
    sum(nvl(r.amount, 0)) as amt_received,
    nvl(sum(case
    when r.amount >= 0 then
    rd.fees
    else
    rd.fees * (-1)
    end),
    0) as fees,
    ec.close_date, *001* commented
    (case
    when ec.close_date <= to_date(to_char(v_enddate, 'MMDDRRRR') || '235959',
    'MMDDRRRR HH24MISS') then
    ec.close_date
    else
    null
    end) as close_date, --*001*  added
    get_case_value(ec.event_id, ec.event_case_id, v_enddate) as case_value,
    nvl(etl.fee_percent_flag, 'N') workmans_comp,
    max(to_char(r.recovery_date, 'FMMonthYYYY')) Year_Month,
    max(to_char(r.recovery_date, 'YYYYMM')) Y_M,
    max(to_date(to_char(r.recovery_date, 'MMYYYY'), 'MM/YYYY')) date_MY
    from recovery r,
    recovery_detail rd,
    event e,
    client c,
    branch_group b,
    employer_group g,
    event_case ec,
    event_type_lookup etl
    where r.event_id = e.event_id
    and r.event_case_id = ec.event_case_id
    and ec.event_id = e.event_id
    and rd.recovery_id(+) = r.recovery_id
    and r.recovery_date between v_startdate and
    to_date(to_char(v_enddate, 'MMDDRRRR') || '235959',
    'MMDDRRRR HH24MISS')
    and e.client_id = c.client_id
    and g.client_id = c.client_id
    and b.client_id = c.client_id
    and g.employer_group_id(+) = e.employer_group_id
    and b.branch_group_id(+) = g.branch_group_id
    and e.event_type_code = etl.event_type_code -- SST 130852 04/14/09
    group by r.event_id,
    r.event_case_id,
    c.client_id,
    c.client_code,
    c.client_name,
    b.branch_group_code,
    b.branch_group_description,
    g.employer_group_code,
    g.employer_group_name,
    e.client_policy_identifier,
    e.date_of_incident,
    e.event_type_code,
    ec.close_date,
    get_case_value(ec.event_id, ec.event_case_id, v_enddate),
    nvl(etl.fee_percent_flag, 'N')
    having sum(nvl(r.amount, 0)) <> 0
    order by c.client_code,
    b.branch_group_code,
    g.employer_group_code,
    r.event_case_id;
    Edited by: user11961230 on Oct 20, 2009 9:02 AM

    user11961230 wrote:
    1. I want to get rid of the p_start and p_end. So how do i declare the v_startdate and v_enddate in the following part?
    v_startdate := to_date(p_start, 'YYYY/MM');
    v_enddate := last_day(to_date(p_end, 'YYYY/MM'));I'm not sure what you mean by "declare".
    In PL/SQL, "declare" means state (at the beginning of a block) that there will be a certain variable with a certain name (such as v_startdate) and datatype (such as DATE). You're already declaring the variables v_startdate and v_enddate correctly, right before the BEGIN statement.
    Declaring a variable is not the same as initializing it, that is, giving it a value for the first time. Your next question seems to be about initializing..
    2. where exactly shud i include the logic that u have mentioned. sorry a dumb questionIn place of the two assignment statments that reference p_start and p_end.
    3. This time am gonna use frequency instead of report_type so that i will get rid of the p_start and p_end from the procedure.Do you mean you want to pass an argument (called frequency) that tells if you want a quarterly or a mionthly report, just like the variable report_type in my example?
    If so, replace report_type in my example with frequency.
    I think you want something like this:
    CREATE OR REPLACE PROCEDURE hcsc_recovery_report_h
    (      report_record         in out     cr_return_types.gen_cursor
    ,      frequency         IN           VARCHAR2
    IS
         -- Declare local variables:
         v_startdate     date;
         v_enddate      date;
    BEGIN
         -- Initialize v_startdate and v_enddate, depending on frequency
         IF  frequency = 'QUARTERLY'
         THEN
              v_startdate := TRUNC ( ADD_MONTHS (SYSDATE, -3)
                                           , 'Q'
              v_enddate := TRUNC (SYSDATE, 'Q');
         ELSIF  frequency = 'MONTHLY'
         THEN
              v_startdate := TRUNC ( ADD_MONTHS (SYSDATE, -1)
                             , 'MM'
              v_enddate := TRUNC (SYSDATE, 'MM');
         END IF;
         --   Subtract one second from v_enddate
              v_enddate := v_enddate - ( 1
                                            / (24 * 60 * 60)
         open report_record for
         select --distinct r.recovery_id
                r.event_id,
         and     r.recovery_date  BETWEEN  v_startdate     
                         AND       v_enddate
         ...When you post formatted text on this site (and code should always be formatted), type these 6 characters:
    (small letters only, inside curly brackets) before and after sections of formatted text, to preserve spacing.
    Edited by: Frank Kulash on Oct 20, 2009 2:37 PM
    Changed query to use BETWEEN                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • FR : How to change from monthly to YTD or quarter data in the same report

    Hi,
    We have several basic reports with 12 month in columns with monthly figures. We would like to try to improve these reports with 2 options (and not creating new reports):
    - For each month, we would like to choose between monthly & year to date figures. (we do not have a view dimension with YTD member)
    - In our period dimension we also have quarter members. How to choose between displaying month or quarter with the prompts ? (ie without having to select each month one by one)
    Does it is possible to do this with FR without adding a new dimension for monthly or YTD data?
    thanks!
    Tipiak

    Hi Tipiak,
    In order to show YTD Actual figure for the selected month, I was doing something like that
    - Add a hidden col from Jan to Run Time period selected.
    - Add a visible formula col and add the formula showing the total of the hidden col.
    Your requirement seems more complex but you might meet some part as an initial step maybe...
    Regards,
    Ahmet

  • Fiscal year period quarter in purchasing cube

    *Dear friends,*
    *I want to make one query on the basis of fiscal year  Qurterly . So please what is infobject in purchasing data cube is useful for making this query. Please guide me*
    *Thanks and Regards*
    *Anil*

    Hi,
    due to the fact that you dont want to use the quarter of the calendar year, you should build up an appropriate one and add it to the cube. Also you should fill it by formula or routine.

  • Asset Acquisitions (Mid-Quarter-Convention) Report

    Hello All,
    I am executing the report S_ALR_87012047 by which i am getting the US tax report in List form(display) and also i am giving the sort version as 7, by which i am getting the report in List format.
    But my query is i am able to see the US Tax report given in SAP Press release book as Grid Display and it is according to the Quarter wise they have displayed the report. Anyone help me out to display the report in Grid and with Quarter wise.
    For the above do i need to create a layout?
    Regards
    VEnk@

    The reports are based on complete fiscal year.
    You can have a look to the transaction:
    ARQ0 - Ad Hoc Reports
    The reports 27 and 28
    Then you can combine a standard report with this in EXCEL

  • Asset acquisition - mid quarter convention - USA

    Hi all,
    please help!
    I am worknig on MACRS depreciation for Asset.
    THe point is: we have different depreciation keys which must be applied depending if more then 40% of the all amount of asset of the year was acquired in the last quarter of the year.
    Question: since I can set as a default only one depreciation key, how can I switch it in the case that at the end of the year more then the 40% was acquired in the last quarter of the year? Must it be done manually or there is an automatic step in the system?
    Please help me
    Valeria

    Hi Valeria,
    As you rightly said, the decision to switch the key to a mid-quarter will be determined only at the end of the last quarter. When you have to change the key based on such determination, you can create a simple substitution rule for the depreciation key for the relevant depn, areas. Then, create a worklist for all the assets that fall under the mid-quarter convention by company code and use the substitution rule. Run a recalculate depreciation AFAR and new depreciation values will take effect.
    Thanks,
    Jagdish

  • Mid quarter depreciation without setting the mid period

    Hello All,
    Thank you for taking time to read my question.
    When AA went live, half monthly data for the company code was not maintained (while it should have been maintained 15 as the mid period). Since the half period is not configured, I am not able to set the mid month setting in OAVH. Now the taxes are calculated with an additional 15 days when specifying mid quarter when using period method control 005. The company code went live last year October and SAP will not allow updating the mid period from blank to 15.
    Have anyone dealt with such a situation? I planned on defining a new period control key and assign it to a custom period method control. But still not able to get the depreciation value correct to the mid quarter.
    Any help is greatly appreciated.
    AM

    What do you mean without mid period setting? Is this OAVH? Anyway, you can try this.
    Use of Half Months in the Company Code
    In this step, you determine the company codes in which you want to use half periods. In this way, you can calculate depreciation in these company codes on the basis of half months or half periods.  Using this method, you can work with 24 periods in Asset Accounting, although the fiscal year version in Financial Accounting has only 12 normal periods (without using a different fiscal year version for Asset Accounting).
    You should be aware, however, that the specifications for periods in the transactions in Asset Accounting (such as, useful life) have to be based on whole periods (12).
    Example
    Half periods are, for example, necessary to represent the "mid quarter/month rule". This is a version widely used in the U.S.A. With this rule, it is important for the determination of depreciation whether an acquisition takes place in the first or the second half of a period.
    Caution
    When you specify the use of half periods in the definition of an asset company code, half periods are automatically specified in all other company codes that use this fiscal year version.
    You cannot use half periods with non-calendar fiscal months.
    You cannot take back the use of half periods once the specification has been made.  It is noted internally by the system in the asset master records.
    Requirements
    The number of the posting periods in the fiscal year version used must correspond to the number of calendar months (12).
    Activities
    1. Specify the use of half periods by entering the date (for example, the 15th) for the middle of the period for the company codes.
    2. If you have defined period controls yourself
    (see Period Control),
    you must provide for the use of half periods in their assignment rules. For monthly and quarterly periods, corresponding period controls have already been created as standard in the system.
    Thanks!
    Jhero

  • Payroll scheme - quarter and semi-annual payments

    Hi.
    I have the following questions concerning Payroll scheme I am working on.
    How can I check the following conditions?
    1. A wage type (WT) for quarter payment has not to be paid to a worker if he was hired during the last month of a quarter. For example, a worker was hired in September 01, 2011 - thus, in September a WT shouldn't be paid to him, 'cause September is the last month of a 3rd quarter.
    2. Another WT for semi-annual payment has not to be payed to a worker if he has been hired during the last 2 months of a half year period. For example, the worker was hired in November 01, 2011 - thus, in November and December a WT for semi-annual payment shoudn't be paid to him.
    Please, give me any tips to solve the issue, thank you.

    rkvarma,
    with which function will I be able to determine the months to start from?
    I want to make the following:
    - for quarter payments - to determine months 3, 6, 9, 12, and if employees were hired during these months, then the WT shouldn't be paid.
    - for semi-annual payments - to determine months 5,6 and 11,12, and if employees were hired during these months, then the WT shouldn't be paid.
    How to do this?

  • HT1212 My ipad mini has been crashing a lot recently so I started a system reset. However, it's now stuck with the progress bar less than a quarter gone: this has been the case for several days now. I have tried resetting from itunes but it needs the pass

    Now it's stuck with the progress bar less than a quarter full. I have also tried resetting through itunes which works right up to the point where itunes states that it needs the passcode to be inputted into the ipad to connect to it. At which point it then sticks at the same progress bar point. HELP!! please, this ipad is really important to my work.

    Well the term "hotlined" I have never heard before. In any case many states (like NY) just passed regulatory powers to the State Public Service Commission of which it may be called something different in your state. You could file a complaint with them. Or file a complaint with your state attorney generals office, they also take on wireless providers.
    The problem here is the staff you speak to are poorly trained, in days gone by it took one call to them and they pulled up your account and see the error and had the authority to remove any errors. They did not remove legitimate account actions, but used their heads instead of putting a customer off or worse lying to the customer.
    Its a shame you have to go through what you going through.
    Good Luck

  • Balance sheet required for current quarter and previous quarter

    Hi Guys,
                 I am using 0FIGL_C10 cube for balance sheet report,i need to create balances for current quarter and previous quarter.
    user will enter the fisper, based on fisper it has to show the current quarter and previous quarter balance.
    how to calculate the quarter using fisper.

    you can use offset with ranges.
    or
    just offset of -1 , -2 & -3 seperately in 3 selections and add it in one column in formula (this will give u current quarter).
    similarly offset of -4, -5 , -6 will give u previous quarter result.
    total of 6 selection and 2 formulas. hide all selections from display.

  • Queries for current Qtr and prior quarter

    If I select one date in dashboard prompt in one column I want to display current quarter revenue and prior Qtr revenue.
    Could anyone give me the queries for the current Qtr and prior Qtr?
    So I will going to use presentation variable from the dashboard prompts

    obiee-date-expressions-reference
    Date Calculation OBIEE Expression Explanation :
    First Day of the Previous Year
    TIMESTAMPADD( SQL_TSI_YEAR , -1, TIMESTAMPADD( SQL_TSI_DAY , EXTRACT( DAY_OF_YEAR FROM CURRENT_DATE) * -(1) + 1, CURRENT_DATE)) From right to left the first TIMESTAMPADD returns the first day of the current year. The second TIMESTAMPADD removes a year from the returned date for the First Day of the Previous Year.
    First Day of the Current Year
    TIMESTAMPADD( SQL_TSI_DAY , EXTRACT( DAY_OF_YEAR FROM CURRENT_DATE) * -(1) + 1, CURRENT_DATE) This calculation returns the first day of the year by deducting one less than the total number of days in the year.
    First Day of the Next Year
    TIMESTAMPADD( SQL_TSI_YEAR , 1, TIMESTAMPADD( SQL_TSI_DAY , EXTRACT( DAY_OF_YEAR FROM CURRENT_DATE) * -(1) + 1, CURRENT_DATE)) From right to left the first TIMESTAMPADD returns the first day of the current year. The second TIMESTAMPADD adds a year to the date returned which will give the first day of the next year.
    First Day of the Previous Month
    TIMESTAMPADD(SQL_TSI_MONTH, -1, TIMESTAMPADD( SQL_TSI_DAY , DAYOFMONTH( CURRENT_DATE) * -(1) + 1, CURRENT_DATE)) From right to left the first TIMESTAMPADD returns the first day of the Current Month. The second TIMESTAMPADD then subtracts one month from the first day of the Current Month arriving to the First Day of the previous month.
    First Day of the Current Month
    TIMESTAMPADD( SQL_TSI_DAY , DAYOFMONTH( CURRENT_DATE) * -(1) + 1, CURRENT_DATE) This expression gets the current day of the month and subtracts one less than the current day to arrive at the first day of the month.
    First Day of the Next Month
    TIMESTAMPADD(SQL_TSI_MONTH, 1, TIMESTAMPADD( SQL_TSI_DAY , DAYOFMONTH( CURRENT_DATE) * -(1) + 1, CURRENT_DATE)) From right to left the first TIMESTAMPADD returns the first day of the Current Month. The second TIMESTAMPADD then adds one month from the first day of the Current Month arriving to the First Day of the next month.
    First Day of Current Quarter
    TIMESTAMPADD( SQL_TSI_DAY , DAY_OF_QUARTER( CURRENT_DATE) * -(1) + 1, CURRENT_DATE) This was included to show the calculations discussed above can be used with other functions. This is the same expression as the one that returns the first day of the current month except this one uses the DAY_OF_QUARTER property to return the first day of the current quarter.
    Last Day of the Previous Month
    TIMESTAMPADD( SQL_TSI_DAY , -(1), TIMESTAMPADD( SQL_TSI_DAY , DAYOFMONTH( CURRENT_DATE) * -(1) + 1, CURRENT_DATE)) From right to left the first TIMESTAMPADD returns the first day of the Current Month. The second TIMESTAMPADD subtracts a month to arrive at the first day of the previous month.
    Last Day of Current Month
    TIMESTAMPADD( SQL_TSI_DAY , -(1), TIMESTAMPADD( SQL_TSI_MONTH , 1, TIMESTAMPADD( SQL_TSI_DAY , DAYOFMONTH( CURRENT_DATE) * -(1) + 1, CURRENT_DATE))) From right to left the first TIMESTAMPADD finds the first day of the current Month. The second TIMESTAMPADD adds one month to the date to arrive at the first day of the next month. The final TIMESTAMPADD subtracts one day from the returned date to arrive at the last day of the Current Month.
    Last Day of the Next Month
    TIMESTAMPADD( SQL_TSI_DAY , -(1), TIMESTAMPADD( SQL_TSI_MONTH , 2, TIMESTAMPADD( SQL_TSI_DAY , DAYOFMONTH( CURRENT_DATE) * -(1) + 1, CURRENT_DATE))) From right to left the first TIMESTAMPADD finds the first day of the current Month. The second TIMESTAMPADD adds two months to the date to arrive at the first day of month after next. The final TIMESTAMPADD subtracts one day from the returned date to arrive at the last day of the Next Month.
    Last Day of Previous Year
    TIMESTAMPADD( SQL_TSI_DAY , -1, TIMESTAMPADD( SQL_TSI_DAY , EXTRACT( DAY_OF_YEAR FROM CURRENT_DATE) * -(1) + 1,
    CURRENT_DATE)) From right to left the first TIMESTAMPADD returns the first day of the current year. The second TIMESTAMPADD subtracts one day to arrive at December 31st of the previous year.
    Last Day of Current Year
    TIMESTAMPADD(SQL_TSI_YEAR, 1, TIMESTAMPADD( SQL_TSI_DAY , -1, TIMESTAMPADD( SQL_TSI_DAY , EXTRACT( DAY_OF_YEAR FROM CURRENT_DATE) * -(1) + 1, CURRENT_DATE))) From right to left the first TIMESTAMPADD returns the first day of the current year. The second TIMESTAMPADD deducts one day to arrive at December 31 of the previous year. The third TIMESTAMPADD adds a single year to the date to arrive at December 31 of the Current Year.
    Last Day of the Next Year
    TIMESTAMPADD(SQL_TSI_YEAR, 2, TIMESTAMPADD( SQL_TSI_DAY , -1, TIMESTAMPADD( SQL_TSI_DAY , EXTRACT( DAY_OF_YEAR FROM CURRENT_DATE) * -(1) + 1, CURRENT_DATE))) From right to left the first TIMESTAMPADD returns the first day of the current year. The second TIMESTAMPADD deducts one day to arrive at December 31 of the previous year. The third TIMESTAMPADD adds 2 years to the date to arrive at December 31 of the Next Year.
    Last Day of Current Quarter
    TIMESTAMPADD( SQL_TSI_DAY , -(1), TIMESTAMPADD( SQL_TSI_QUARTER , 1, TIMESTAMPADD( SQL_TSI_DAY , DAY_OF_QUARTER( CURRENT_DATE) * -(1) + 1, CURRENT_DATE))) Demonstrated using Quarters. From right to left the first TIMESTAMPADD returns the first day of the Current Quarter. The second TIMESTAMPADD returns the first day of the next quarter. The final TIMESTAMPADD subtracts a single day from the date to arrive at the last day of the Current Quarter.
    Number of days between First Day of Year and Last Day of Current Month TIMESTAMPDIFF(SQL_TSI_DAY, CAST('2010/01/01 00:00:00' AS DATE), TIMESTAMPADD( SQL_TSI_DAY , -(1), TIMESTAMPADD( SQL_TSI_MONTH , 1, TIMESTAMPADD( SQL_TSI_DAY , DAYOFMONTH( CURRENT_DATE) * -(1) + 1, CURRENT_DATE)))) For simplicity I hard coded the January 1, 2010 date and CAST it to a date. I could have used the First Day of the Current Year calculation but didn’t want to over clutter the example. The second part of the TIMESTAMPDIFF uses Last Day of the Current Month calculation to force the TIMESTAMPDIFF to calculate the number of days between the first day of the year and the last day of the current month.
    =============
    FYI, let say some example,
    Last day of previous Quarter:
    "GPC_DataMart"."GPC_DataMart"."dbo"."LQ_Position"."Business_Date"=TIMESTAMPADD( SQL_TSI_DAY , -(1), TIMESTAMPADD( SQL_TSI_DAY , DAY_OF_QUARTER( "GPC_DataMart"."GPC_DataMart"."dbo"."MT_BUSINESS_DATE"."Business_Date") * -(1) + 1, "GPC_DataMart"."GPC_DataMart"."dbo"."MT_BUSINESS_DATE"."Business_Date"))
    Last month last day:
    "GPC_DataMart"."GPC_DataMart"."dbo"."LM_Position"."Business_Date"=
    TIMESTAMPADD( SQL_TSI_DAY , -(1), TIMESTAMPADD( SQL_TSI_DAY , DAYOFMONTH( "GPC_DataMart"."GPC_DataMart"."dbo"."MT_BUSINESS_DATE"."Business_Date") * -(1) + 1, "GPC_DataMart"."GPC_DataMart"."dbo"."MT_BUSINESS_DATE"."Business_Date"))
    Last year Last day
    "GPC_DataMart"."GPC_DataMart"."dbo"."LY_Position"."Business_Date"=
    TIMESTAMPADD( SQL_TSI_DAY , -1, TIMESTAMPADD( SQL_TSI_DAY , EXTRACT( DAY_OF_YEAR FROM "GPC_DataMart"."GPC_DataMart"."dbo"."MT_BUSINESS_DATE"."Business_Date") * -(1) + 1, "GPC_DataMart"."GPC_DataMart"."dbo"."MT_BUSINESS_DATE"."Business_Date"))
    Thanks and Regards,
    Deva
    http://obieeelegant.blogspot.com/2011/06/obiee-date-expressions-reference.html

  • Calculation of total depending upon the quarter selected

    Dear All,
    User want to see the quarterly total of all the amount.
    Key figure struture in report is:-
    Quarter
    Actual amount
    plan amount
    variance
    This will display the result for every quarter. Now user want to see the quarter total.
    I can achieve this by making the property of CALQUARTER to suppress results never. This will give me output at the end of everyquarter. But i have variance field in my report whichi is giving a problem.
    Say for 1st three posting period the variance is 100 respectively then the quarterly variace is coming as 300 total. I dont want this . I want to apply formula here.
    formula=(( actual variacne - plan variance)/plan variacne)*100.
    How can i achieve this in BEx?
    Thanks & Rgds,
    Anup

    Hi Moorthy,
    variance is a formula.
    Quarter object used in hte key figure struture is a characteristics so i can't specify calculate result as total it only applies to key figures. For characteristics there is an option called Normailze to :- 'No normalization, Query result, Overall result, and Resul'. I dont know if we can use any of these???
    Suppress results never will automatically take the summation only.
    Thanks & Regards,
    Anup

  • Re: i was charging my iphone 3GS yesterday in electricity when once it turned off suddenly while it was in quarter battery. I tried charging it again but it didint open, i tried to plug it into my laptop but itunes didnt recognize it and it doesnt work.

    Re: i was charging my iphone 3GS yesterday in electricity when once it turned off suddenly while it was in quarter battery. I tried charging it again but it didint open, i tried to plug it into my laptop but itunes didnt recognize it and it doesnt work.

    Hello candymerna,
    At this point I would recommeng resetting the device if if will not turn on.
    Resetting your device
    Press and hold the Sleep/Wake button and the Home button together for at least ten seconds, until the Apple logo appears.
    From: iPhone, iPad, iPod touch: Turning off and on (restarting) and resetting
              http://support.apple.com/kb/ht1430
    If it does turn on, but will not charge then take a look at this part of the article iPhone: Hardware troubleshooting found http://support.apple.com/kb/ts2802
    Power/Battery
    Battery does not charge from the USB power adapter
    Important: Only original iPhone can be charged from a FireWire-based power source. If iPhone is connected to a computer that's turned off or is in sleep or standby mode, the battery may drain.
    Verify that the outlet being used is working.
    Try another USB power adapter if available.
    If no other USB power adapter is available, try connecting to a high-power USB 2.0 port (not a keyboard). The computer must be turned on and not in sleep or standby mode.
    Try another USB cable if available.
    Also refer to iPhone and iPod touch: Charging the battery.
    If it is charging, but not recognized in iTunes take a look at one of these articles depending on your Operating System.
    iOS: Device not recognized in iTunes for Windows
    http://support.apple.com/kb/TS1538
    or
    iOS: Device not recognized in iTunes for Mac OS X
    http://support.apple.com/kb/ts1591
    Cheers,
    Sterling

Maybe you are looking for

  • "Best practice" for components calling components on different panels.

    I'm very new to Swing. I have been learning from tutorials, but these are always relatively simple interfaces , in which every component and container is initialised and added in the constructor of a main JFrame (extension) object. I would assume tha

  • Problem with SOAP Servlet

    Hi, I have a SOAP servlet, but It is the fist SOAPServlet as I use. I think that the vsd that developper of SOAP servlet provide is ok. But, I do not understand which is the XML that I could provide to it. It is posible that I have a problem with XML

  • How to use the check box?

    How is the check box to be used? If I have 10,000 songs in my itunes library and have 1,000 of them checked, how can I place all 1,000 checked songs into a new playlist that I have created just for them. They are not located together in my library so

  • Contacts from iphone

    How do I get my contacts from my iPhone to my new MacBook Pro?

  • CS4 Info Palette

    I just upgraded to Photoshop CS4 from CS3 at work.We print solely to a Lightjet 430 in RGB. We are constantly sent flattened images that contain a clients logo that must match a specific PMS color. My method is to marque the logo, set a color sample