(Number of Days )as Input in the Query

Dear Guys,
                I am working on the "Slow Moving Item(MC46)" report in BW.We need "No.of Days Not consumed" in the Input selection screen in the BW Query.So how to create "Input Variable" as "Number of Days" in the Query design.We tried creating a variable upon "Calday"but the data type allowed is either"Date or Calendar Day",but we want the data type in "Numeric"...It would be fantastic ,if someone could take time to help us out..............
Manythanks
Arun

Hi obuli,
Based on Condtion or Exception on keyfigure object, you can create a formula variable with Number type.
Hope it helps
Regards,
Arun.M.D

Similar Messages

  • Usage reports - Can we increase the number of days to show in the daily report?

    Hello Friends,
    When I navigate to site setting >Popularity trends>Usage report and generate the excel report, I get to see the Dialy report and Monthly report.
    In Dialy report I can see only for 14 days, which I would like to alter to show me 30 days of data rather.
    Can you please let me know how to do this and/or whether is this possible.
    Regards,
    praj

    Hi Praj,
    In Usage report, number of days is determined by RecentPopularityTimeFrame property, and it is 14 by default. You could change the recent time period to be anything between 1 and 14 days.
    http://blogs.technet.com/b/tothesharepoint/archive/2014/01/28/view-and-configure-usage-analytics-reports-in-sharepoint-server-2013.aspx
    If you would like to get report for more days, I’d recommend you use audit log for site collection. Customize the audit log period to 30 days or more. For more information:
    http://office.microsoft.com/en-in/sharepoint-help/configure-audit-settings-for-a-site-collection-HA102866204.aspx
    Regards,
    Rebecca Tu
    TechNet Community Support

  • Calculating the number of days based on transaction in Query

    Hi friends,
    I would be greatful if u can help me out. I have got a situtation where in i need to take the day when the transaction has occured otherwise i dont need to take that day. For example if one transaction occurs on 1st , i need to take that day and if the transaction dosent occur then i need to ignore it. If there is one transaction or multiple transactions i need to take the day only once.
    Like transaction has happened on 1st Jan so it will be considered,
    on 2nd the transaction dosent happen so i need to ignore it
      on 3rd there is a transaction so its taken.
    So its like 1st - 1
                   2nd - 0
                   3rd - 1
    So total will be 2.
    Transactions are being taken from a cube. Kindly let me know as to how to do this in query.
    Thanks,
    Kapil

    PLease give us some more inputs.. requirement is not clear.
    Do u have 0calday in ur Cube?
    Khaja

  • Missing Some Select input options the Query

    Hello all,
    Normally when i excute a query, it will ask for date range and year, fiscal period etc input options which i have to input to execute a given query. But  for one of the BWuser(sales guy) iam unable to see the fields, can anyone guess what cud be the problem. do you think its something to do with the BW authorization? any ideas to solve the problem are appreciated.
    Thanks
    SP

    Hi, you need to force the variables to be asked.
    Add &variable_screen=X at the end of the URL of the report. Check if then the values are requested.
    Hope this helps.
    Regards,
    Diego

  • How to get the number of days

    hai bloggers,
    see we have 365 days per year for first half we are going to have 180+ days (if we select first half as the prompt and we select week number as prompt and the last date of that particular week should show in the report)and number of days upto that date or week also should display...if we select second half and week number of that particular half it should show number of days upto that week and highest date of that week number of days should count from 1 to 180+ only mean (july 1 st is 1 st day)
    thanks

    You need to use timestampdiff function for calculating number of days. One of the way to calculate is like this
    case when "Time"."Calendar Half Year" = 1 then timestampdiff(SQL_TSI_DAY,CAST(EVALUATE('TO_DATE(%1,%2)','01-01'||'@{YEAR}{2010}','DD-MM-YYYY') AS DATE),CAST(EVALUATE('TO_DATE(%1,%2)','30-06'||'@{YEAR}{2010}','DD-MM-YYYY') AS DATE)) else timestampdiff(SQL_TSI_DAY,CAST(EVALUATE('TO_DATE(%1,%2)','01-07'||'@{YEAR}{2010}','DD-MM-YYYY') AS DATE),CAST(EVALUATE('TO_DATE(%1,%2)','31-12'||'@{YEAR}{2010}','DD-MM-YYYY') AS DATE)) end
    If you want calculate between 1st day of the half and last date of a week then use following
    case when "Time"."Calendar Half Year" = 1 then timestampdiff(SQL_TSI_DAY,CAST(EVALUATE('TO_DATE(%1,%2)','01-01'||'@{YEAR}{2010}','DD-MM-YYYY') AS DATE),MAX(MAX("Time"."Calendar Date"))) else timestampdiff(SQL_TSI_DAY,CAST(EVALUATE('TO_DATE(%1,%2)','01-07'||'@{YEAR}{2010}','DD-MM-YYYY') AS DATE),MAX(MAX("Time"."Calendar Date"))) end
    Hope it will answer your question
    Thanks,
    Phani.

  • How do i setup Mail account on my mac book like in mobile phone? I.e. Don't want to store the mails/attachments on pc, however need the latest emails for given number of days?

    How do i setup Mail account on my mac book like in mobile phone? I.e. Don't want to store the mails/attachments on pc, however need the latest emails for given number of days?
    This helps the storage and purpose of email as well. I could always log into online email account to find history of emails.
    Thanks
    Chai

    How do i setup Mail account on my mac book like in mobile phone? I.e. Don't want to store the mails/attachments on pc, however need the latest emails for given number of days?
    This helps the storage and purpose of email as well. I could always log into online email account to find history of emails.
    Thanks
    Chai

  • Program or FM to convert number of days into a CalDay format (ddmmyyy)

    Hi ABAP friends,
    I input calendar day values via a popup calendar from a spreadsheet to BW. So, the values that are populated in BW are the numbers, and not the date.
    For ex. when user selects a calendar day for ex. 11-April-2010, the value in excel is stored as 40279 (which is the number of days starting from 01-Jan-1900) and this is the value that gets stored in BW once we save the data.
    I'm looking for a function module or method or whatever that converts the above number (40279) into CalDay and writes it to the 0CALDAY infoobject ???
    Please help,
    Thanks,
    Venkat

    Thanks Pranaam.
    Two things:
    1. I cannot find this FM. It says FM doesn't exist. SE37 -->  HR_HK_DIFF_BT_2_DATES
    2. My requirement is actually reverse as you explained. I can certainly hard code the starting date: 01011900, but here the input should be the number of days. and I need the date (date2 in your ex.) based on the no. of days entered.
    I found another FM which does exist in my BW system. That is: FIMA_DAYS_AND_MONTHS_AND_YEARS
    Based on "From" & "To" dates, it outputs the number of days.
    But my requirement is:
    Based on the starting date (i.e. always 01011900) and number of days, it should give me the "To" date value.

  • How to avoid crosstab - Show number of days according to groups

    Morning all,
    I think you all would agree with me that even having crosstab as a great tool in Crystal 2008, there are still quite allot of limitations to it.
    I have created a report using crosstab which shows number of days and jobs according to those days grouped by account number, product code, sales area. This report is working fine until my director asked me to further group those days according to sub categories of lenses.
    For example
    Crosstab shows
    Number of days - Day 1,day 2, day 3
    Number of jobs - 111----123--1213
    Percentage - -
    12%---34% 60%
    Now if you look at the example it says day 1, 111 jobs went out. What the director would like to see is those jobs being sub divided into types of lenses.
    So out of 111 jobs, 25 would be Finished lenses, 30 could be uncut lenses and so on.
    The new report should be like this
    Number of days -
    Day1---Day2---Day3
    Number of Jobs:-
    Finished -
    25--34-----23
    Uncut--3045-----23
    AR--7056-----76
    Total----125135----122
    Percentage:-
    Finished -
    25%--34%-----23%
    Uncut--30%45%-----23%
    AR--70%56%-----76%
    Total----100%100%----100%
    Now if we look at the above criteria it seems that I have to use groups even further down the report where I am using crosstab at the moment. This means I have to get rid of the crosstab and run a report manually.
    However the big question is, how to get the report calculating number of days and jobs according to customer account number, product code and sales area manually?
    I tried the following formula but this requires to write way too many formulas, for example some of the jobs have taken more than 60 days and if i use this formula I have to write 60 formulas for number of days which is not feasable.
    **//provided by IIbas in another forum**
    whileprintingrecords;
    numbervar day0;
    numbervar day1;
    numbervar day2;
    if {@workingdays} = 0 then
    day0 := day0 + 1 else
    if {@workingdays} = 1 then
    day1 := day1 + 1 else
    if {@workingdays} = 2 then
    day2 := day2 + 1 else //up to the maximum number of days.
    Then in the report footer, reference the days in separate formulas, and identify them with text boxes, e.g.,
    //{@day0};
    whileprintingrecords;
    numbervar day0;
    I can sort out the Finished, uncut,AR by grouping them however I am wondering how to create a manual running total of jobs complying with number of days without using crosstab.
    Any ideas?
    Many thanks
    Regards
    Jehanzeb

    no answer closing

  • Number of Days in Date and 7pm anomaly

    I have found a bizarre behavior with find the number of days for a date( since Jan. 1, 1970 ). I needed a way to calculate the number of days between two dates. I did this by using the getTime() method on the dates, then dividing them by one day in milliseconds (86400000). I then cast them to an int to trucate the decimals. This gave the number of days since Jan 1, 1970. I then subtracted the two 'number of days' values to get the number of days between the 2 dates.
    This was working fine until we ran into a problem of it returning one day to many in a seemingly random pattern. The problem ended up being that after 7pm dividing a date in milliseconds form by a day in milliseconds would return one more day, than if the date was before 7pm.
    example:
    November 1, 2004 00:00:00 = 1099288800000ms = 12723.25 days = 12723 truncated
    November 1, 2004 19:00:00 = 1099357200000ms = 12724.04 days = 12724 truncated
    Why is this? Why is 12am Nov 1 not an even number of days? Supposedly the Date class starts from Jan 1, 1970 00:00:00. If everyday is 86400000ms then this behavior shouldn't happen. Does anyone know why this anomaly happens?

    You need to take into account time zone. If you are at GMT+0 there is no problem (unless you switch to daylight sayings :)
    For example you can take a System.currentTimeMillis() and send it anywhere in the world and it would display locally with the right time.
    I guess you are at -5 hours from GMT. (Eastern time of the US/Canada timezone). The Date object makes corrections for timezone.
    So in England, the time would have been 0 at Jan 1 1970, 00:00:00
    Another thing you may need to worry about is daylight savings changes, which again are handled by the Date object.
    The simplest thing to do is use the Date object. If this is a performance issue you can do some tricks to reduce the impact. e.g. store the default Timezone and Local locale as constants and use these to build the Date object.

  • How to calculate the number of days worked for a given period

    I need to calculate the number of days worked by contractor employees for a time period to be entered by a user. I am building a query on an infoset which contains employee information including contract start date and contract end date for the employee.
    Ideally I'd like the user to enter the time period which should be reported on e.g. 01.08.2009 to 31.08.2009
    The report should then identify all the contractor employees which were working during this period and to work out how many days they worked during this period. Obviously the contract start and end dates could fall both inside and outside the reporting period.
    Can this be done and if so, do you have any suggestions as to how to do it?
    Thanks.

    hi
    So here you will first have to load the master data table employee in one internal table and read this table with the variables entries.
    Your code in the reporting exit should look like that.
    bye
    data : wa_employee type /bi0/pemployee.
    When 'ZDATE1'
    if i_step = 2.
    LOOP AT i_t_var_range INTO loc_var_range WHERE vnam = 'ZDATE2'.
    clear l_s_range.
    clear wa_employee
    1- select the entries from table employees
    select single employee dateto datefrom
    from /bi0/pemployee
    into corresponding fields of wa_employee
    where dateto le loc_var_range-low
    and datefrom ge loc_var_range-high.
    if sy-subrc eq 0.
    CALL FUNCTION 'FIMA_DAYS_BETWEEN_TWO_DATES'
       EXPORTING
           i_datum_von  = wa_employee-datefrom
           i_kz_ult_von = 'X'
           i_datum_bis  = wa_employee-dateto
           i_kz_ult_bis = 'X'
           i_szbmeth    = '1'
       IMPORTING
          e_tage       = no_days.
           l_s_range-low  = no_days.
           l_s_range-sign = 'I'.
           l_s_range-opt  = 'EQ'.
          APPEND l_s_range TO e_t_range.
              ENDIF.
            ENDIF.
    endloop.
    ENDIF.
    Boujema

  • FM to get the number of days in Year,month and days by giving number of day

    Hi ALL,
    This is quit differnt.
    I need to give input the 'start date' and the 'number of days' and get the total days from the start date in year,month and day format.
    for example.
    start date :01.01.2009
    number of days as 32
    then i should get
    years:0
    months :1
    days :1
    Pleas help me out.

    hi Anusha,
    first u pass the date and the days to the following fm you will get the result date....
    data:date type sy-datum,
          r_date(10) type c.
    date = sy-datum.
    CALL FUNCTION 'CALCULATE_DATE'
    EXPORTING
       DAYS              = '32'
       MONTHS            = '0'
       START_DATE        = date
    IMPORTING
       RESULT_DATE       = r_date
    write:/ r_date.
    then you need to pass the result date and the date to the following fm to get the required output...
    CALL FUNCTION 'HR_HK_DIFF_BT_2_DATES'
        EXPORTING
          date1                   = r_date
          date2                   = date
        IMPORTING
          years                   = v_years
         months                 = v_months
        days                     = v_days
        EXCEPTIONS
          invalid_dates_specified = 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.
    here u will get the difference in days,  months and year...
    i hope u wil get help from this...
    regards
    Ashu  Singh

  • How to automatically update the Expiry Date's number of days

    My web app input form is an event submission form. Users enter the event title, event date and other details, etc. I've figured out how to get the "expiry days" in the form and it be hidden but i can't figure out how to calculate this:
    (today's date) - (event date) + 1 day = number of days to expire and then set the expiry days to that value upon submission.
    I have tried writing the js but am getting no where, has anyone out there already accomplished this? I've researched and researched and find a million things on calculating the number of days but can't get one of them to work for my situation here... any help would be greatly appreciated!!

    Hi Murtuza,
    You can use function module BAPI_ISUACCOUNT_CHANGE.
    Pass dunning lock details in parameter TCTRACLOCKDETAIL. This function module only create and delete locks.
    So, you need to pass existing lock details (from table DFKKLOCKS) with PROCESSING_MODE = 04 (delete) and append another value with changed expiry date with PROCESSING_MODE = 01 (Create).
    This will also help in maintain lock history too.
    Hope this helps.
    Regards,
    Avinash

  • FM which gives the date if we add 'x' number of days to the current date.

    Hi all,
    can you plz tell me the FM which will give me the exact date if i add some ' X ' number of days to the present date.
    in detail -->my inputs would be    1)DATE
                                                    2)no of days
    i need--> the exact date which comes after those days get added to the given date.
    PLZ HELP ASAP.
    Rgds,
    REDDY.

    Hi,
    You can use FM RP_CALC_DATE_IN_INTERVAL.
    data: wa_date  like sy-datum.
    *Add 21 days to current date.
    call function 'RP_CALC_DATE_IN_INTERVAL'
             exporting
                  date      = sy-datum
                  days      = 21
                  months    = 0
                  signum    = '+'
                  years     = 0
             importing
                  calc_date = wa_date.
    write: / wa_date.
    Regards,
    Ferry Lianto

  • Determine the number of days in a False period in a Temporal Boolean

    Hi all,
    I need to determiine the number of days based on a condition that lies on the gaps between the periods.
    My input consists of multiple periods. The length of the gap is the condition to determine the start date for summation. However, there can be multimple gaps between my instances that satisfy this condition and I need the last one that satisfies it.
    For example:
    period 1: 1-1-1990 until 31-12-1992
    period 2: 1-1-1994 until 31-12-1996
    period 3: 1-1-1998 until 31-12-1999
    period 4: 1-6-2000 until 31-12-2009
    The condition for the start date is the last gap greater than 1 year. In this example, the start date should be the start date of period 3: 1-1-1998, because this is the period after the last gap >= 1 year. Period 2 also has a previous gap of >= 1 year, but this period should NOT be selected.
    My first idea was to use a TBR function: to determine relevant periods (based on the gaps before and after), calculate the amount of days per relevant period and add those up. However, if I want to do that I need to calculate the number of days in the gaps and I don't see how to do that, since I cannot determine a day difference across periods (end date period 1 until start date period 2).
    Any help/ other solution ideas?
    Kind regards, Els

    This was an interesting puzzle which you can solve from a couple of different angles.
    Firstly, you can use inferred relationships to infer a relationship "the following periods" (ie. the periods that follow the current one). My rules looked like this:
    the period (the other period) is a member of the following periods if
       the other period start date > the period start date
    the period’s next start date = InstanceMinimum(the following periods, the period start date)From here it should be easy to see if there was a gap of more than a year, and find the most recent period after a year-long gap. Of course you need to deal with the situation of the last period, when there is no 'next' period, presumably you would use the date of assessment in that case, but I'll leave that as an exercise for the reader.
    A completely different way of doing it is to use the TemporalConsecutiveDays function to find a date where a gap of 365 days exists, then select periods in which there is a gap immediately before the start of that period. Here are some rules that :
    there is a period that applies if
       ExistsScope(the periods)
          TemporalOnOrAfter(the period start date) and
          TemporalOnOrBefore(the period end date)
    there is a year-long gap if
       TemporalConsecutiveDays(365, 365, there is not a period that applies)
    the period starts after a year-long gap if
       ValueAt(the period start date, there is a year-long gap)
    the start date for calculation = InstanceMaximumIf(the periods, the period start date, the period starts after a year-long gap)Hopefully one of these is suitable for your needs.
    cheers,
    Steve.

  • Count the number of days in the selected range using Customer exit

    Hi Experts,
    we have requirment where user is asking to add a column to report, which will have 'count of days for which key figure is having values' for each of the months and the Header would be 'Day Count'
    Please let me know if its possible using Customer exit?

    Hi,
    In our report we have two characteristics site no. and product and we have 6 key figures of type quantity and Input for the report is Fiscal year/period
    So in the report Key figures are populated with values for respective site no. and product combination
    Now the user wants new column in report which will have header u2018Day countu2019 and it should Simply count the number of days in the selected range that have a volume different than 0 for key figure
    Please let me know if more details are required

Maybe you are looking for