Month variable

Post Author: gronkette
CA Forum: Formula
I need to create a formula that extracts the number of days in a month / 365 - the month would be the variable.
So if = Feb. 2, 2007, then my variable = 28 and my formula would be month/365
I'm using CRXI
thanks!

Post Author: synapsevampire
CA Forum: Formula
v361: cdlastdayofmonth is a repository function, not a standard Crystal function.
gronkette: Try the following to get the number of days in the year:
day(dateserial(year(),month()+1),1)-1)
Not sure what the /365 is about, I guess the percentage of the year...but you're not allowing for leap years.
if day(dateserial(year(),3,1)-1) = 29 thenday(dateserial(year(),month()+1),1)-1)/366elseday(dateserial(year(),month()+1),1)-1)/365
-k

Similar Messages

  • Need help on Creating YTD for a month variable in WEBi...

    Dear Experts,
    I am using BO4.1. I am creating a WEBi report where I have a month variable which shows months in the below format
                                                                                                                                             I need to create YTD for the year ...Please help me .. this has to be displayed in chart.. So using the sum(No.Of.Ans ) doesnt work in chart.
    Please suggest any other ideas...

    Hi Bala,
    Create a variable at universe level,and assigned table must be the table from which you are getting month.
    Now take the object "YTD" into second query
    Merge the Month object and YTD object
    Create a variable for balance,
    =If [month]="YTD" then sum([balance]) else [balance]
    Noe you will get the required output as your requirement,
    Regards,
    Samatha B

  • Need to Create a Last 12 Months Variable for Custom Dimension

    Hi everybody
    Once again, I need your good help for an issue I'm facing. In one of our Cube, we have some Date Dimension sthat we've created ourselves (a ZCXXXXX dimension). For one Dimension, Ii need to create a variable that is giving me, automaticaly, the Last 12 Months excluding Current Month (same as the 0CML12LM provided by SAP) without any manual entry done by the user via the Variable Entry Screen.
    I don't want to use offset because I don't want to allow any Manual intervention for my users because it is a report start via RRI.
    Please let me know if you are aware on how to do this!
    Thanks
    Eric L.

    Hi Arun
    My problem is that my report is counting Incident per supplier per Month.  We have a Key Figure that is doing the Total of incident with a Vendor Variable.  So, for a given supplier, if there is no incident for the Incident Month, it won't display in the Result Page.  Also, My report is dynamic so I'can not fix a Structure.  On the other hand, I never used Strucutre, so I'm not really aware on how using this and if it will answer my need.
    If you can give me more details, maybe I'll be able if a Structure is my solution.
    Regards
    Eric L.

  • Calendar Year/Month Variable & Filtering

    Hello Experts,
    I have a problem with a web template that I cannot solve.
    I have a web page containing one table and one generic navigation block.  They both have the same query behind them.  Calendar Year/Month is a free characteristic.  I have a variable on this characteristic which restricts to current calendar month.  However, I still want users to be able to go back and select a previous calendar month if they wish, but with the variable on it selecting current month it wont let me select any other month in the filter.
    How can I resolve this?

    Hi Olivier,
    This solution helps a little but I dont think my customer would like to have to enter a date each time they open the web page.  They want to default to the current month automatically and then be able to change to another month.
    I dont think they will like a popup each time.  Can this be avoided?
    Thanks,
    Sean.

  • Customer Exit Variable on Cal Year/Month Error

    Hi Experts
    My requirment is to develop a Restricted Keyfigure...
    The restriction is based on 0Calmonth (Calendar Year/Month)
    The sales from beginning of calendar year up to last "closed" month in a Calendar.
    Ex: in June i want to see 01.01.2009 to 31.05.2009 data.
    in October i want to see 01.01.2009 to 30.09.2009 data.
    When user execute the report
    in Jan 2010 i want to see 0 as there is no closed month in that particular year.
    in Fed 2010 i want to see 01.01.2010 to 31.01.2010 data.
    For that purpose i created a variable
    Customer Exit on calendar Year/Month
    Variable represents : Interval
    Variable is : Mandatory
    Variable is Ready for Input (Uncheck)
    in CMOD...i had written The below Code
    WHEN 'ZYCCM' . "Current Year Culm. to Last Closed Month
    DATA :Month(2) type c,
    Start_Month like rsd_c_timnm-calmonth,
    End_Month like rsd_c_timnm-calmonth.
    Month = sy-datum+4(2).
    if Month = '01'.
    Start_Month = '000000'.
    End_Month = '000000'.
    Else.
    concatenate sy-datum(4)'01' into Start_Month.
    End_Month = sy-datum(6) - 1.
    Endif.
    CLEAR L_S_RANGE.
    L_S_RANGE-SIGN = 'I'.
    L_S_RANGE-OPT = 'BT'.
    L_S_RANGE-LOW = Start_Month.
    L_S_RANGE-HIGH = End_Month.
    When i execute the report i am getting an error
    "No Value Could be determined for Variable ZYCCM"
    Please update what went wrong and how to Correct error

    Hi
    Thanks for the update..
    Modified code as below
    WHEN 'ZYCCM' . "Current Year Culm. to Last Closed Month
    DATA :Month(2) type c,
    Start_Month like rsd_c_timnm-calmonth,
    End_Month like rsd_c_timnm-calmonth.
    Month = sy-datum+4(2).
    if Month = '01'.
    Start_Month = '000000'.
    End_Month = '000000'.
    Else.
    concatenate sy-datum(4)'01' into Start_Month.
    End_Month = sy-datum(6) - 1.
    Endif.
    CLEAR L_S_RANGE.
    L_S_RANGE-LOW = Start_Month.
    L_S_RANGE-HIGH = End_Month.
    L_S_RANGE-SIGN = 'I'.
    L_S_RANGE-OPT = 'BT'.
    APPEND l_s_range TO e_t_range.
    But when i executed the report....the report is executed sucessfully but the restriction applied to only Jan 2009
    When i saw the KF definition in RSRT 
    I EQ JAN 2009
    I am expecting
    BT JAN2009 APRIL2009
    Please help
    Tahnks

  • Information Broadcasting: Monthly Reporting with variable dates

    Dear all,
    we have created a lot of reports with RD and have pubished the reports in the portal. Our reports have a lot of selection screens. Now we would like to use information broadcasting. We have already created information broadcasting settings. We have maintained fix variants for our reporting
    For example:
    Variant x1
    Organization: C110
    Scenario:       Actual
    Date:             is filled by the user Exit
    Now we tried to shedule the report. We are using Variant x1 to find the correct selection. The problem is, that we have already saved a fix date in the variant (for example 01.01.2008), because the field is obligatory.
    The User-Exit for the variables works with step 1, but the problem ist, that the variant x1 is overwriting our User-Exit value.
    How can I avoid, that the Variant is not overwriting the User-Exit. Of course for reporting without variant, the manual entry has priority before the user exit.
    Thanks for a soon feedback.
    XmxhX

    hi,
    in order to update months, firstly create variants for the reports. Then implement the below program modifying the users inputs. For current month or last month you have to hard something like sy-datum(6), an you have to hard code the field name for the month variable that you use in query.
    Below program is for BI 7.0, you can also check the document. It also contains a method for bw 3.5 variants.
    You can schedule this program in a process chain or make variations of this as needed.
    [How To… Troubleshoot Information Broadcasting (BEx Workbooks)|http://www.sapadvisors.com/resources/HowtoInformationBroadcasting.pdf]
    *& Report Z_MASS_VARIANT_MAINTENANCE *
    *& Program to mass update BEx Variants within SAP NetWeaver 2004s *
    REPORT Z_MASS_VARIANT_MAINTENANCE.
    parameter variable like RSRVARIANT-VARI.
    parameter vname like RSRVARIANT-VNAM.
    parameter sign_01 like RSRVARIANT-SIGN.
    parameter opt_01 like RSRVARIANT-OPT.
    parameter low_01 like RSRVARIANT-LOW.
    parameter high_01 like RSRVARIANT-HIGH.
    tables: RSRVARIANT.
    select * from RSRVARIANT.
    if rsrvariant-VARI = variable AND rsrvariant-vnam = vname.
    rsrvariant-SIGN = sign_01.
    rsrvariant-OPT = opt_01.
    rsrvariant-LOW = low_01.
    rsrvariant-HIGH = high_01.
    elseif rsrvariant-vnam = vname.
    rsrvariant-SIGN = sign_01.
    rsrvariant-OPT = opt_01.
    rsrvariant-LOW = low_01.
    rsrvariant-HIGH = high_01.
    endif.
    update rsrvariant.
    if sy-subrc 0. insert rsrvariant. endif.
    endselect.
    RSRVARIANT-VNAM must be your month variable.
    RSRVARIANT-LOW and HIGH must be your automatic month like sy-datum(6)
    regards,

  • User Exit Variable for Infoprovider based on month characterstic in query

    Hi,
    I am financial reporting with reports created on a mulit-provider over a plan & Actual cube.  Along the top of the report is a structure which has amongst other restricitions a column for each month, i.e columns 1 to 12. 
    Currently we are in month 9, so the report should show data from the Actual infoprovider for months 1 to 9, but data from the plan infoproviders for 10 to 12.  My question is how should the variable be coded for the infoprovider which will return a value based on the month characteristic in each columns selection.  I understand how I can look at say the current system date, derive the month and return the plan/actual value for the correct infoprovider based on the current month.  But I need to create a variable which will look at the month value which is in each column selection in the query itself.
    Many thanks,
    Richard

    we recently had this kind of reporting requirement. only difference being week instead of month.
    you need to create 12 variables for actual month columns and 12 for budget.
    now you will write a code to address all the variables. in following format :-
    when var1.         "suppose var1 represents month 1 of actual columns
    1. derive month from date.
    2. if month <= i_vnam+3(1)                         "get the number from var and compare
                  set the  variable value as the month number of that year for e.g
                  concatenate year i_vnam+3(1)      into        l_s_range-low       
        else
                  set the variable value way back in past which will not have any data.
    above logic will cause values in following fashion
    if this month is 3 and year is 2008
    var1 = 200801
    var2 = 200802
    var3 = 200803
    var4 = 199001
    var5 = 199001
    etc.
    In the query all columns will be set with the property = hide if not values are present. so if 199001 is set in the variable then it will be collapsed.
    same way logic for variables in budget column can be written which will set all the month variables which are less than
    current month to 199001 (just in reverse fashion of above mentioned logic.)

  • How to use one variable as a default value for another variable?

    Hi Experts,
    Is it possible to use one variable as a default value for another variable?
    For example:
    Variable 1 = current calendar year month
    Variable 2 = mandatory input ready variable for calendar year month
    I want to use variable 1 as default value for variable 2, but also have the ability to change the month if required.
    Thanks!
    Kathryn

    u can use replacement path variable
    in that case u can replace the values of 1 variable with the another variable...
    but  u cannot do this setting
    u cannot make variable 2 as mandatory
    u cannot enter value for variable 2
    because by default it will take the value of variable 1
    u have to make follow settings
    variable 2
    name , technical name
    processing by = replacement path
    infoobject = ocalmonth
    next tab
    replaced by another variable
    variable name
    offset start , offset lenght
    save and hit okey

  • How to get current month from BI 7

    Dear Expert,
    I am working on a BI 7 report and I need to restrict a key figure using the current month and previous month.
    Could you help me to find out how to do so?
    Thank you very much!
    Arthur

    if you want to make  2 diff rest key figures.
    check if you have current month variable under cal.month ,  if not create a variable( single, not range ) for current month
    and make a new selection take key fig and rest with current month. 
    and make a new selection and take the key fig and restrict with  current month variable keep off set as -1
    if you want to make only one restricted key fig  which shows both current and previous then.
    create a variable as range and write a exit code from  sy-datum ( take month and year ) as the high value and substract one and make it as low value.
    Hope this helps

  • Display year and month in webi report

    Hi
    I have requirement like below.
    If user select year in prompt for example user select 2011
    i have 2 columns in a report pY-2,   pY-1
    These above columns will display 2009  , 2010 along with the current month.Month will be same as current month.
    For suppose user select 2009 and(assume current month is JULY)The above columns will display like below.
    pY-2                     pY-1
    July-2007            July-2008
    Please suggest me how we can achieve this?
    Best Regards,
    Abhi

    Because you have a requirement to display data for current month you will have to add at least one new restricted key figure to BEx query that you plan to use for report. Restricted key figure should use BEx SAP exist variable that limits data to current month. It might require that you will need to enable one or two BI Content variables that SAP provides with SAP BW installation. There are at least two types of current month variables - current fiscal month or current calendar month. Another possibility for restricted key figure is to use your own BEx exit variable
    Afterwards you have few options;
    - develop crosstab report to display pY-1, pY-2 data;
    - add two more restricted key figures to BEx query to display pY-1 and pY-2 columns; this will require you to add new BEx input variable to BEx query
    - create WEBI measure variables to display pY-1 and pY-2 columns based on WEBI prompt

  • Customer Exit Variable not working in BO-Webi Report

    Hi All,
    I have created a universe based on Bex Query.
    Bex query consists of a customer exit variable on Calendar year/month where in it will populate current calendar year month by default while executing the query. It works fine while executing in SAP BI Bex Analyser.
    I have created a universe based on the query. For Calender year/Month i got L00, L01, LOV values in universe.
    Based on the universe I have created a Webi report. I did not specify calendar year/month as query filters. While directly executing the Webi report, I get the calendar year/month variable screen. But the value for it not populated based on customer Exit code written in BI.
    What has to be done to get the customer exit values in variable screen.
    Thanks for your understanding.
    -- Selva

    Since you have customer exit variable in your bex query, it will be like a global filter in your universe.
    Execute the webi report and check whether you are getting only current month data.
    --- Thanks

  • How to use the value of a variable to set another variable

    Hello Experts,
    Is it possible to access the value of variable set by the user and set the default value of another variable using the user entered value for the first variable? Example:
    Date variable
    Week variable
    Month variable
    User enters one of those and the other two are automatically prefilled with the correct values?
    Thanks
    Rado

    Hi Rado,
    Gothrough following code
    Which reads year from user input and converts it to factory calendar week , following which you should able to convert user inputs to required parameters.
    DATA:  v_year1 TYPE i,
            v_int   TYPE i,
            v_week1 TYPE kweek,
            v_qurt  TYPE i,
            v_perd  TYPE /bi0/oifiscper,
            v_iweek TYPE i,
            v_periv TYPE periv VALUE 'Z4'.
    DATA : v_vweeks  TYPE /bi0/oicalweek,
            v_vperd   TYPE /bi0/oifiscper,
            v_vperiv  TYPE /bi0/oifiscvarnt VALUE 'Z4'.
    DATA : vit_weeks LIKE /bi0/scalweek OCCURS 0 WITH HEADER LINE.
    DATA : v_perd1   TYPE umc_y_fiscper,
            v_weeks   TYPE umc_ys_dimvals,
            v_pweeks  TYPE i.
    CASE i_vnam.
       WHEN 'WPIYWEEK'.                "Variable name of char. in Bex
    *Check for Step 2 (After user gives inputs on selection screen)
         CHECK i_step = c_after.                                "Step:2
         CLEAR :  v_year1,
                  v_week1,
                  v_iweek.
    *Read the value of variable which used has entered on sel. screen
         READ TABLE i_t_var_range INTO wa_var_range
                                     WITH KEY vnam = 'WPIFYEAR'.
         v_year1 = wa_var_range-low.
         CALL FUNCTION 'TIME_GET_LAST_WEEK'
           EXPORTING
             if_year     = v_year1
           IMPORTING
             ef_week     = v_week1
           EXCEPTIONS
             fatal_error = 1
             OTHERS      = 2.
         IF sy-subrc <> 0.
    *           MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *           WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
         ENDIF.
    *Get the no. of week from YYYYWW format
         v_iweek = v_week1+4(2).
         l_s_range-low  = v_iweek.
         l_s_range-sign = c_include.
         l_s_range-opt  = c_equal.
         APPEND l_s_range TO e_t_range.  "This is the output structure in which u have to add the result
    Endcase.
    Hope that helps.
    Regards
    Mr Kapadia
    Assigning points is the way to say thanks in SDN.

  • Problem to transfer Variable value to Dashboard A to Dashboard B

    Hi,buddies:
         I have a scenario that I have to jump from Total Dashboard(we call it A) to Detail Dashboard(we call it B),I work with Xcelsius directly connect to BW through SAP NetWeaver BW connection ,I can transfer Variable values to B through URL with command like this:
         http://hqbd6.sinopec.com:50000/irj/servlet/prt/portal/prtroot/pcd!3aportal_content!2fcom.sap.pct!2fplatform_add_ons!2fcom.sap.ip.bi!2fiViews!2fcom.sap.ip.bi.bex?DASHBOARD=R2JN_DASHTESTB
    &BI_COMMAND_1-BI_COMMAND_TYPE=SET_VARIABLES_STATE
    &BI_COMMAND_1-VARIABLE_VALUES-VARIABLE_VALUE_1-VARIABLE=G1CALMONTH_DZ_MIS
    &BI_COMMAND_1-VARIABLE_VALUES-VARIABLE_VALUE_1-VARIABLE_TYPE=VARIABLE_INPUT_STRING
    &BI_COMMAND_1-VARIABLE_VALUES-VARIABLE_VALUE_1-VARIABLE_TYPE-VARIABLE_INPUT_STRING=2011.07
    But at this condition,The variables of Dashboard B are not bound to any cell because they will be set at run time with values passed in the URL.
    My question is can I get the Variable value from the URL in the Xcelsius Designer and put it into a specified cell and link this cell with the query,so that even jump to Dashboard B I can still change the variable values.
    Best Regards
    Martin Xie
    Edited by: Martin Xie Ai Hua on Mar 9, 2012 7:48 AM

    Let me explain the issue in detail.
    In Query Designer, both the year and  month variables are defined by user exit function to read current year and month and can be modified  during the query runtime.
    In WAD, Query1 is  used  to be a table with a table interface to hyperlink a chart which is defined by Query2 with the same variable value of Query1.
    During the runtime of template, if I change the variable value of Query1 , I want the variable of Query2 to be changed automatically with the same new value.
    So in the table interface of Query1 , I write the ABAP code in "SE24" and related source code to the variable is following:
    concatenate
    'function fire_urlJGSP_Col(filter) {'
    Cl_rsr_www_renderer=>c_lf
    'chart_url="' url '" + "&CMD=LDOC'
    '&TEMPLATE_ID=GCCHART_9' "WEB ID of the work book
    '&PAGEID=Graphics'       "Name of the view
    '&CMD=PROCESS_VARIABLES&SUBCMD=VAR_SUBMIT&VAR_NAME=Z2MYEAR&VAR_VALUE_EXT=" + filter'
    Cl_rsr_www_renderer=>c_lf
    'openWindow(chart_url,"chart_window","dependent=yes","600",'
    '"450","true")'
    Cl_rsr_www_renderer=>c_lf
    into l_coding.
    In this way , I can only transfer the year variable value from Query1 to Query2 and not two variables .
    So , how  shall I do to transer the two variable value in the same?

  • Question on Variant configure - Calculate Number of Month Range

    Hi,
    I'm a new learner for BI module. I have a question on calculate the number of month. Hope I can get answer from you. Thanks.
    According to below description, I get wrong display of number of month in Analyer.
    =============================
    Description:
    To list the number of months in the interval in the report, define a new calculated key figure on query level named Number of Month using a new formula variable:
    a) From the context menu for the Key Figure structure, choose New Formula.
    Then choose Edit from the context menu of the new formula. Enter the description Number of Month.
    b) In the Available Operands field, from the context menu for Formula Variables, choose New Variable. Then choose Edit from the context menu of the new variable.
    c) On the General tab page, enter:
    Description: GR## Number of Months
    Variable name: BW513Q##
    Processing by: Replacement Path
    Ref. Characteristic: Cal. year/month
    d) On the Replacement Path tab page, select:
    Replace Variable With: InfoObject
    Variable Represents: Key
    Use Interval: Difference
    e) On the Currency/Unit tab page, the Dimension is set as Number.
    f) Choose OK.
    After configure when I input 2001/06 - 2001/07, in the Analyzer it shows 200107.0000000 rather than 2. May I know where is wrong?
    ============================
    Number of Months
    200,107.0000000
    200,107.0000000
    200,107.0000000
    200,107.0000000
    ============================
    Regards,
    Leon

    Hi Mayank,
    Thanks for your help. This is the way to get the number but weird thing is in below sdn link we can found one example that shows the number can be got from an interval of January to March. ?
    Link:
    http://help.sap.com/saphelp_nw04/helpdata/en/03/6ba03cc24efd1de10000000a114084/frameset.htm
    For Intervals Use
    ·        From-value
    ·        To-value
    ·        Difference
    If the replacement value called is an interval, you use this setting to specify whether the lower interval limit (from value) or the upper interval limit (to value) is used as the replacement value.
    For formula variable, you can also choose the interval difference as the replacement value. Using this setting, you can easily calculate the difference of period boundaries. The interval difference is the from value minus the to value plus 1. For example, the period January to March gives a result of 3 (the to value 3, minus the from value 1, plus 1)
    Hope anyone could give me an answer.
    Thanks,
    Leon

  • Variable offset not working

    Hello Experts -
    I have a structure and a variable with single-value entry. The variable is on 0CALMONTH.
    If user input 06/2007, I wanted to see information for 06/2007, 05/2007, 04/2007. I'm using a variable offset. But my report output is always for 06/2007. I have data for 05/2007 and 04/2007 also.
    In the column header, it shows 04/2007, 05/2007 and 06/2007 but there's not data.
    Can someone please help me with this? What am I doing wrong?

    If you can see the offset result in header then it will surely work for data also.
    If u have a key figure amount.
    Then you need to restrict this figure for user inputed months variable - offset.  i.e different restricted figures for different months.
    I hope this is clear to you, if not then do let me know.
    Thanks
    Dipika

Maybe you are looking for

  • How to store the zip file in oracle table?

    hi, How to store the zip file in oracle table ? is it possible to unzip and read the file ? Thanks Rangan S

  • Forms Configuration(very urgent)

    can anyone explain about workingDirectory parameter in forms configuration file(formsweb.cfg). what is the impact of this setting over forms configuration?

  • Graphic Image for Folder Image in Finder

    I have created a few folders in finder\applications to group apps together.  For example, I have created a folder for iLife apps.  When I open Applications, the iLife group shows as a plain folder image labeled iLife.  I would like to customize the f

  • Converting a layer on the main timeline into a movieclip

    I'm not really sure how to properly describe this so please bear with me. Say you create an animated action on your main timeline with a symbol. Then you decide you want to take that action and put it into a movie clip so that it migrates across the

  • Hp laserjet 200. Random blank pages. Jibberish. USB not recognized.

    I am posting this for a friend. The printer is one year old. They ended up buying a new computer and the same problems happen on Windows Vista AND Windows 8.1. Please advise! We were away for a week. It printed strange gibberish each day we were gone