Query for calculating financialyear

help me to write a query  which will check if the record createdon
is within  the current financialyear  i.e. June 2014- July 2015
RecordCreatedon
logic
2014-10-28
yes
2014- 12-15
Yes
2012- 01-19
No
Note  : query for calculating financialyear should be hardcoded .

It looks like your sample data range is wrong "June 2014- July 2015"
To get an idea, I consider June 2014 - May 2015 as financial year, try the below:
create Table test_Table (RecordCreatedon date)
Insert into test_table values('2014-10-28'),('2014- 12-15'),('2014- 06-01'),('2014- 05-30')
,('2015- 02-28'),('2015- 05-30'),('2015- 06-01')
Select *,
case when year(Dateadd(month,-5,RecordCreatedon) )=YEAR(getdate()) Then 'yes' else 'no' end Logic
From test_Table
Drop table test_Table

Similar Messages

  • Query for calculating raw material requirements for the remaining quantities in sale order.

    Dear SAP Experts,
    Clients requirement :
                                         Client wish to know the quantities of raw materials needs to run the production order inorder to complete the remaining quantities in sale order.
    Need Clarification:
                                  I"m using the below query for this requirement. I wish to know whether this query suits for my clients requirement or not. If its so, I need to know how to group by T4.[Code] (Raw material Name)   and need to get the sum of    T4.[Quantity]  (BOM quantity)      and  (T1.[OpenQty]*T4.[Quantity]) as TOTALQTY under each raw material group
    SELECT T0.[DocNum], T0.[DocDate], T0.[CardCode],T0.[CardName], T1.[ItemCode], T1.[Dscription], T1.[Quantity] as salesorderQty , T1.[OpenQty], T2.onhand, T4.[Code] as Raw material Name,T4.[Quantity] as BOMQTY,  (T1.[OpenQty]*T4.[Quantity]) as TOTALQTY FROM ORDR T0  INNER JOIN RDR1 T1 ON T0.[DocEntry] = T1.[DocEntry] INNER JOIN OITM T2 ON T1.[ItemCode] = T2.[ItemCode] INNER JOIN OITT T3 ON T2.[ItemCode] = T3.[Code] INNER JOIN ITT1 T4 ON T3.[Code] = T4.[Father] WHERE  T0.[DocStatus] ='o' 

    You're posting in the Portuguese B1 space.
    You might want to post in the English one: SAP Business One Application

  • FMS Query for Calculation

    Hi Experts,
    I would like to write a FMS  query to allow for auto calculation based on the Inputs of 2 other fields before Adding the Sales Order.
    For example. A query on Sales Order where I have Item ABCD  and Quantity 200.
    I have a UDF named Abatement where the value is fixed 35%. And other is Assessable Value fixed with MRP Price say 350
    And based on the result should be given in Assessable Value field.
    Formula is  Assessable Value fixed  350 then Abatement  35 %  = 122.50 and then 350-122.50 =      227.50  should be displayed in the Assessable value field.
    Kindly provide me the solution for the query.
    Regards
    Amol

    Hi,
    Try this:
    SELECT  ((select $[RDR1.U_AssessableValue]) - ((select $[RDR1.U_Abatement]) * ((select $[RDR1.U_AssessableValue])/100)))
    Please post screen shot sale order window with UDF filed and values.
    Thanks & Regards,
    Nagarajan

  • Query for calculation in ALV Total

    HI All,
    I am using Sub_tot = "X" & do_sum="X" to get the subtotals & Totals for different columns Using REUSE_ALV_LIST_DISPLAY.
    I am calculating percentage in column "C" depending on result of Column "A" & Column "B", which is also achieved.
    My requirement is, Percentage in Total column to be calculated with use of TOTAL OF COLUMN "A" & TOTAL OF COLUMN "B". Because simply totaling all the values of percentage column will not work.
    Any Pointers will be helpful.
    Thanks In advance.
    Regards,
    Siddhesh Sanghvi.

    hi ,
       this is another example  for displaying the subtotals in many times ...
    report  zvg_alv_slist2                          .
    type-pools: slis.
    G L O B A L   I N T E R N  A L   T A B L E S
    data: gt_fieldcat type slis_t_fieldcat_alv,
          gs_layout   type slis_layout_alv,
          gt_events   type slis_t_event.
    data: it_sort type slis_t_sortinfo_alv ,
          wa_sort type slis_sortinfo_alv .
    data: gs_print type slis_print_alv.
    data: begin of it_sflight occurs 0,
            carrid     like sflight-carrid,
            connid     like sflight-connid,
            fldate     like sflight-fldate,
            price      like sflight-price,
            planetype  like sflight-planetype,
            seatsmax   like sflight-seatsmax,
            seatsocc   like sflight-seatsocc,
            paymentsum like sflight-paymentsum,
         end of it_sflight.
    *DATA: GI_SFLIGHT LIKE STANDARD TABLE OF ST_SFLIGHT.
    data: g_repid like sy-repid.
    data: gt_list_top_of_page type slis_t_listheader.
    data: v_total(5).
    start-of-selection.
      g_repid = sy-repid.
      perform init_fieldcat  using gt_fieldcat[].
      perform build_eventtab using gt_events[].
      perform build_comment  using gt_list_top_of_page[].
      perform get_data.
      perform set_layout using gs_layout.
    SORTING
      clear wa_sort.
      wa_sort-fieldname = 'CARRID'.
      wa_sort-up = 'X'.
      wa_sort-group = '*'.
      wa_sort-subtot = 'X'.
      append wa_sort to it_sort.
      clear wa_sort.
      wa_sort-fieldname = 'CONNID'.
      wa_sort-up = 'X'.
      wa_sort-group = 'UL'.
      wa_sort-subtot = 'X'.
      append wa_sort to it_sort.
    DISPLAY LIST
      call function 'REUSE_ALV_LIST_DISPLAY'
        exporting
          i_interface_check       = ' '
          i_callback_program      = g_repid
          i_callback_user_command = 'USER_COMMAND'
          is_layout               = gs_layout
          it_fieldcat             = gt_fieldcat[]
          it_sort                 = it_sort[]
          it_events               = gt_events
          is_print                = gs_print
        tables
          t_outtab                = it_sflight
        exceptions
          program_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.
    *&      Form  INIT_FIELDCAT
    form init_fieldcat using    p_gt_fieldcat type slis_t_fieldcat_alv.
      data: ls_fieldcat type slis_fieldcat_alv,
            l_index type sy-tabix.
      data :rep like sy-repid.
      rep = sy-repid.
      call function 'REUSE_ALV_FIELDCATALOG_MERGE'
        exporting
          i_program_name         = rep
          i_internal_tabname     = 'IT_SFLIGHT'
          i_inclname             = rep
        changing
          ct_fieldcat            = gt_fieldcat
        exceptions
          inconsistent_interface = 1
          program_error          = 2
          others                 = 3.
      if sy-subrc <> 0.
        message id sy-msgid type 'S' number sy-msgno
             with sy-msgv1 sy-msgv2 sy-msgv3 sy-subrc.
      endif.
      sort gt_fieldcat by col_pos.
      loop at gt_fieldcat into ls_fieldcat.
        l_index = sy-tabix.
        if ls_fieldcat-fieldname = 'PRICE'.
          ls_fieldcat-do_sum = 'X'.
          ls_fieldcat-sp_group = 'X'.
          modify gt_fieldcat from ls_fieldcat index l_index .
        endif.
      endloop.
    endform.                    " INIT_FIELDCAT
    *&      Form  BUILD_EVENTTAB
    form build_eventtab using  p_gt_events type slis_t_event.
      data: ls_event type slis_alv_event.
      clear ls_event.
      ls_event-name = slis_ev_top_of_page.
      ls_event-form = 'XTOP_OF_PAGE'.
      append ls_event to p_gt_events.
      clear ls_event.
      ls_event-name = slis_ev_top_of_list.
      ls_event-form = 'XTOP_OF_LIST'.
      append ls_event to p_gt_events.
      clear ls_event.
      clear ls_event.
      ls_event-name = slis_ev_end_of_page.
      ls_event-form = 'XEND_OF_PAGE'.
      append ls_event to p_gt_events.
      ls_event-name = slis_ev_end_of_list.
      ls_event-form = 'XEND_OF_LIST'.
      append ls_event to p_gt_events.
      clear ls_event.
    endform.                    " BUILD_EVENTTAB
    *&      Form  BUILD_COMMENT
    form build_comment using   p_gt_list_top_of_page type slis_t_listheader.
      data: ls_line type slis_listheader.
      ls_line-typ = 'H'." = Header, S = Selection, A = Action
      ls_line-key = 'KEY'.
      ls_line-info = 'INFO'.
      append ls_line to p_gt_list_top_of_page.
    endform.                    " BUILD_COMMENT
    *&      Form  SELECTION
    form get_data..
    data: l_rows type i value 3.
    Read data from table SFLIGHT
      select carrid
             connid
             fldate
             price
             planetype
             seatsmax
             seatsocc
             paymentsum
         from sflight
         into table it_sflight.
        up to l_rows rows.
      sort it_sflight.
    endform.                    " SELECTION
    *&      Form  SET_LAYOUT
    form set_layout using  p_gs_layout type slis_layout_alv.
    *  P_GS_LAYOUT-F2CODE            = P_F2CODE.
      p_gs_layout-zebra          = 'X'.
      p_gs_layout-colwidth_optimize = 'X'.
      p_gs_layout-no_input          = 'X'.
      p_gs_layout-no_colhead        = space.
      p_gs_layout-totals_text       = 'Total Price'.
      p_gs_layout-subtotals_text    = 'Sub Total'.
      p_gs_layout-totals_only       = 'X'.
      p_gs_layout-key_hotspot       = 'X'.
      p_gs_layout-detail_popup      = 'X'.
      p_gs_layout-no_subtotals      = space.
      p_gs_layout-expand_all        = 'X'.
      p_gs_layout-group_buttons     = 'X'."space.
    endform.                    " SET_LAYOUT
          FORM XTOP_OF_PAGE                                             *
    form xtop_of_page.
    data : lv_page(5),
            lv_text(20).
      MOVE SY-PAGNO TO LV_PAGE.
      write:/  'X_TOP_OF_PAGE'.
    endform.                    "xtop_of_page
          FORM XTOP_OF_LIST                                             *
    form xtop_of_list.
      write:/  'X_TOP_OF_LIST'.
    endform.                    "xtop_of_list
          FORM XEND_OF_PAGE                                             *
    form xend_of_page.
      write:/  'X_END_OF_PAGE'.
    endform.                    "xend_of_page
          FORM XEND_OF_LIST                                             *
    form xend_of_list.
      write:/  'X_END_OF_LIST'.
      data : lv_page(5),
             lv_text(20).
      data : l_lines type i,
             l_line  type i.
      clear v_total.
      write sy-pagno to v_total left-justified.
    export v_total to memory id 'V_TOTAL'.
      do sy-pagno times.
        lv_page = sy-index.
        concatenate 'Page' lv_page 'of' v_total
             into lv_text separated by space.
        if sy-index = 1.
          read line 2 of page sy-index.
        else.
          read line 1 of page sy-index.
       endif.
        sy-lisel+60(20) = lv_text.
          modify current line .
      enddo.
    endform.                    "xend_of_list
          USER_COMMAND                                             *
    form user_command  using r_ucomm like sy-ucomm
                              rs_selfield type slis_selfield.
      case r_ucomm.
        when 'EXIT'.
          leave to screen 0.
        when '&IC1'.
          data: text(256),text1(6),text2(5).
          move rs_selfield-tabindex to text1.
          move rs_selfield-sumindex to text2.
          concatenate  'Double clicked on (field:'
                        rs_selfield-fieldname
                        'Value:'
                        rs_selfield-value
                        text1
                        text2
                        into text
                        separated by space.
          call function 'POPUP_TO_DISPLAY_TEXT'
            exporting
              textline1 = text.
      endcase.
    endform.                    "user_command
    regards,
    venkat.

  • Currency Translation for Calculated Key figures

    Hello Friends I want to use the Currency Translation for Calculated Key figures.
    But when I go to Query and go to conversion tab it is always greyed out. Does that mean we can set the fixed conversion type for calculated key figures. like ZSAD Total debit - credit -flow value.
    What is the way to do fixed currency translation in query for calculated key figures.
    All the below is done now just want to specify this in query but I can'nt since it is greyed out.
    All the below is done
    I have created a Currency Translation Type " FiscperConversion" "ZVHGR" now this has Exchange Rate Type from Variable "ZVARN" (Which is a variable single value manual input on 0RTYPE Infoobject for exchange rate.)
    2. Now Currency Tab: Target Currency is selected from Variable placed in the Report. ZRPVAR.
    3. Now the Variable Time Reference is used. Standard Infoobject 0FISCPER
    which is beginning of period.

    Hi soniya
    Your calculated KF is result of some calculation ...so system will not allow u to do any translation on it...to get CT on CKF you should do it on base key figure...still if you wish to do then you can create a formula variable having processing type a customer exit...write code in cmod to rad exchange rate and multiply ur CKF by this formula variable....
    Thanks
    Tripple k

  • How to calculate and save planning data in bex input-ready query using keyfigures for calculation from different infoproviders

    Hi Dear All,
    We have two real time infocubes and two aggregation levels based on these cubes in one multiprovider
    first cube1 is like
    char1| char2| keyfig_coefficient(single value for each combination of char1 and char2)
    same aggregation level1
    (we have input query to fill coefficients by one responsible user)
    second cube2 is like
    char1| char2| keyfig_quantity| keyfig_result
    same aggregation level2
    Input ready query should be like (for all other users of different org units)
    char1|char2|keyfig_coeff| keyfig_quant(for input) | keyfig_result = keyfig_coeff*keyfig_quant(calculated value, should be saved to cube2)
    And we don't have pregenerated lines in cube2, users have to add new lines themselves by wad.
    Question is, what is the optimal (easiest) way to make calculation and save result data to cube2 where keyfigures for calculation should be used from different infoproviders. I need just a hint.
    Appreciate any help.
    Nadya.

    I found decision, agregation levels sould be based on multiprovider, not included.

  • Help needed in query for Materialized View

    Hi,
    I want to create a materialized view which has some precalcultaed values.
    I have four dimension tables out of which one is a Time Dimension table with levels as Year->Quarter->Month.
    The precalculations are the moving averages and cummulative values of Sales Amt on the dimension values over a period of 4 Months.
    The dimension tables are Clients, Products, Channel, Time.
    Fact Table is Sales_Fact which will have the sales amount for different members of the dimension.
    Since my fact table is very huge, i want to create a materialized view where i could store the required calculated measures, here Moving Average of Sales Amt for each Client, Product, Channel dimensions over a period of 4 Months.
    Can anybody help with writing the query for this..Any help in this regard will be appreciated..
    Please give me suggestions for this..

    Check this link.
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14223/aggreg.htm#sthref1612
    Regards
    Raj

  • Attributes to be used for calculation

    Hi Experts,
    I have a requirement for master data attribute calculation i.e. Vendor payment term's attributes like no of days. This needs to be used in a query for some calculation purpose. I wanted to know if the attributes of a master data can be used in the coulmns for calculation?
    Thanks.
    Points would be assigned

    Hi Shridevi,
    Thanks a lot this was very helpful and i am able to use the formula for calculation.
    I just wanted a simple information. I have three key fig f1 f2 & f3 and i want a formula to check
    if f1 is empty then
    formula = f3-f2
    else
    formula = f3-f1.
    Just wanted to know if this could be done in a formula or will i have to write some kind of exit?
    Thanks.

  • How to disable Query for single controls in a Form Applet?

    Hi All,
    this should be so simple, but seems like I don't get it at the moment.
    I have a Form Applet in HI Mode and want to disable the possibility to Query on certain fields. these are Calculated fields and querying will most likely crash the application due to heavy performance impact. They should be for displaying only. How to do that? I have searched for Applet Control User Properties and such stuff but couldn't find one.
    Thx

    Hi Siebelade thanks for your reply,
    in the meantime I managed to do it using a BusComp Field User Property called "DisableSearch". If you set this to "TRUE" for the desired fields, the user will receive an error message when trying to query for these fields.
    Benny

  • Can any one send select query for this?

    Hi,
    can any one plese send select query for the following query.please send as early as possible.
    Loop through the I_BSID internal table to fill records in I_OUTPUT.Combine data from I_BSID, I_KNKK, I_KNKK_KNKLI, I_KNA1 and I_KNVV into I_OUTPUT based on the linking conditions .Field Description Source are
    I_OUTPUT-BUKRS     Company code     I_BSID-BUKRS
    I_OUTPUT-KUNNR     Customer number     I_BSID-KUNNR
    I_OUTPUT-NAME1     Customer Name     I_KNA1-NAME1
    I_OUTPUT-KNKLI     Credit account     I_KNKK-KNKLI
    I_OUTPUT-KDGRP     Customer Group     I_KNKK-KDGRP
    I_OUTPUT-KLIMK     Credit Limit     I_KNKK_KNKLI-KLIMK
    I_OUTPUT-KVGR1     Business Unit     I_KNVV-KVGR1
    I_OUTPUT-REBZG     Invoice Number     I_BSID-REBZG
    I_OUTPUT-BLDAT     Invoice Date     I_BSID-BLDAT
    I_OUTPUT-WAERS     Document Currency     I_BSID-WAERS
    I_OUTPUT-DUE_DATE     Due Date     Based on below
    Calculation
      Get the Payment terms days combining I_BSID and I_T052 based on the linking conditions mentioned above.    Note : a) Baseline Date : If baseline date I_BSID-ZFBDT is blank , use the Document Date.b) Payment Term Days :If I_BSID-ZBD3T is not blank, take this as Payment Term Days for Due date calculation.
                       If I_BSID-ZBD3T is Blank, then get payment term days from I_T052 based on I_BSID-ZTERM. If there are more than one record in I_T052 for the given Payment term, get the day part from baseline date and select the first record where the day limit I_T052-ZTAGG is greater than the day part.If I_BSID-ZBD3T is blank and I_BSID-ZTERM is also blank, then take Y000 (Due Immediately) as Payment term and proceed with the above logic. Set the payment term field blank while printing.
    Calculate Due date : For Debits, Determine Due Date = Baseline Date + Payment term Days(not discount days)                                                          For  Credits  Due date = Baseline date.Then, move the amount I_BSID-DMBTR to respective buckets (Not yet Due, Current Due, Past due 1-30, Past Due 31-60 etc.)  Based on the due date.
    Thanks&Regards,
    praveen kumar.A

    HI,
    To get Open Items you can use Function module:
    data:i_items TYPE STANDARD TABLE OF rfpos.
    CALL FUNCTION 'CUSTOMER_OPEN_ITEMS'
    EXPORTING
    bukrs = p_bukrs
    kunnr = wa_customer-kunnr
    TABLES
    t_postab = i_items
    EXCEPTIONS
    no_open_items = 1
    OTHERS = 2.
    Table I_items will have all the open items for that Customer in the given company code.
    Well for Clear Items: Try
    GET_CLEARED_ITEMS or FMITPOFM_CLEARED_ITEMS_GET.
    Hope it helps.
    Manish

  • Select Query for Report

    Hi All
    I have a table called Agent. Each Agent processes requests.
    So accordingly Request is another table.
    Now the Agent can process the request successfully, fail or it could be
    in progress.
    So accordingly I have a status column in the Request table which can have the following values
    New - when the request is allocated to the agent
    Open- When the agent opens the request
    Action- when the agent acted upon the request
    Sold - when the agent was successful in processing the request
    Fail - when the agent could not process the request
    In the Request table there is column called requestDate which is the
    date when the Request was first inserted (i.e when its New)
    Now whenever the agent acts upon the request from the front end
    the status change is logged in a RequestLog table.
    So when the agent changes the status to Open, an entry is logged into
    RequestLog table.
    So when the agent open the request an entry in the RequestLog table
    would go with the status as open , the reference of the requestId &
    the date on which the status is changed
    Similar entries will be logged for each request when the agent acts on
    the respective requests like if its Sold then the status will be sold,
    the date of sale & the corresponding request Id will be logged into the
    RequestLog table.
    In the Request table the status will be changed to "Open" or "Sold" but the
    requestDate will not change & it will remain the date when it was inserted
    Now I want to generate a Report which shows the list of all agents within a state
    with all total number of requests they have handled, how many are in Opened status,
    how many are in Sold status & how many are in Fail status. I also have to show the
    average time(in days) it took for each agent to Open the request, make the sale or qualify it
    as Fail. This average time I want it for an agent & not request specific.
    & In the end I have to show the grand total of all the requests handled by all the agents,
    grand total of opened status requests,grand total of Sold status requests,grand total of Fail status requests as well as the total average time it took to Open ,total average time it took to sale & total average time it takes to Fail
    I have dabbled with simple SQL but not a complex report type like above. So I would need help from all you experts.
    Here is what I plan to do
    my from clause would include the Agent, Request, RequestLog table
    where Request.requestdate between <fromDate> and <toDate>
    group by agent.agentname,
    Select would have count(agent.requestid),
    Now how do i show the list of Open requests, sold requests & fail requests in different columns since all these values are in the same column.
    Also I am aware of the average fnction but I need help on how to use the same in such a scenario.
    Do post your thoughts on the same.
    Regards

    Hi All
    I have made some queries to fetch the Report data. I would want you to post your comments on the same.
    This is my first query which returns the total count of request per dealer, how much are in open, sent & dead state & total per status.
    select AGENT.COMPANY_NAME,count(REQUEST.REQUEST_ID) TOTAL ,
    sum(decode(REQUEST.status,'Open',1,0)) OPEN,
    sum(decode(REQUEST.status,'Sent',1,0)) SENT,
    sum(decode(REQUEST.status,'Dead',1,0)) DEAD
    from AGENT, REQUEST
    where
    AGENT.STATE='ACT'
    and REQUEST.REQUEST_TYPE='B'
    and REQUEST.CONFIRMATION='Y'
    and AGENT.DEALER_ID = REQUEST.DEALER_NUMBER
    group by grouping sets(AGENT.COMPANY_NAME, ())
    Then I have to retrieve the average number of days it takes to change the request to Open, average number of days it takes to change the request to Sent & average number of days it takes to change the request to Dead
    per Agent. The base date is stored in REQUEST table (request_date column) & the subsequent change of status is stored in activity_date column
    of ACTIVITY table
    Here is what I do get the average number of days it takes to change the status for the Agent
    select AGENT.COMPANY_NAME,
    avg( decode (REQUEST.status,'Open',ACTIVITY.ACTIVITY_DATE - REQUEST.REQUEST_DATE,0)) AVG_OPEN,
    avg( decode (REQUEST.status,'Sent',ACTIVITY.ACTIVITY_DATE - REQUEST.REQUEST_DATE,0)) AVG_SENT,
    avg( decode (REQUEST.status,'Dead',ACTIVITY.ACTIVITY_DATE - REQUEST.REQUEST_DATE,0)) AVG_DEAD
    from REQUEST, ACTIVITY, AGENT
    where
    AGENT.STATE='ACT'
    and REQUEST.REQUEST_TYPE='B'
    and REQUEST.CONFIRMATION='Y '
    and REQUEST.dealer_number = AGENT.DEALER_ID
    and REQUEST.STATUS = ACTIVITY.STATUS
    group by grouping sets(AGENT.COMPANY_NAME, ())
    I hope this is the right way for calculating average number of days
    Since most part of the queries is the same
    I tried to merge both the queries into one because I need to render the report in that fashion. But the moment I merge the query its giving absurd results.
    Do post your thoughts on the same
    Regards

  • Query for geetiing no.of working days

    Hi All,
    How can we write a query for geetiing no.of working days in Oracle Apps.
    Basically we need to mention no.of working days in the Work-Flow Form but not the no.of days.
    So how can we write a query for getting no.of working days.and Where can we get the tables?
    Is there any need of calendar in WIP(Work in Process) Module?
    Can any one please help me out.
    Thanks in Advance,
    Dhana

    Hi,
    Please see if these documents help.
    Note: 43276.1 - Calculating the Number of Working Days
    Note: 1018913.102 - How to Find Number of Days - Valid Working Days - Between Two Dates
    Regards,
    Hussein

  • Query for Info Provider

    How to create query for infoprovider ? I have selection criteria, calculation and result screen for queries taken from one reference query. I am new to this part so dont know which transaction we will use to create query. Is it APO part or BI/BW part ?

    I have to create queries for info provider. I have one reference query. I have to create similar selection screen as that of reference query for new query. Calculation which needs to be included in query is provided also result screen for query is given.
    how to create query in APO using above input? Which transaction do we use to create query ?
    I heard about BEx query analyzer which is there in BI for query creation . Is similar BEx functionality is available in APO ? If yes , what is t-code used for that? I know one tcode - RSRT with which I can see existing reference query selection? Is there similar tcode for query creation also in APO?

  • Query  for moving average

    Hi ,
    I need query for moving average the same as B1 calculate it.
    Idan

    Hi Idan,
    Moving Average Rate Calculation
    Moving Average Rate = Daily Receipt Value / Daily Receipt Qty
    This Rate generate on daily bases.
    Its called in SAP as Lastevaluated Price
    Thanks,
    Srujal Patel

  • MDX Query to Calculated member

    Hi All,
    I have a MDX query which works fine, when converting the query to Calculated member, I get the same result for all the rows of a dimension.
    select {[Measures].[Contents]} on 0,
    ([Dim Products].[Product Alias].[Product Alias].members,
    (filter ([Dim Products].[Product ID].members,
    instr(left([Dim Productss].[Product ID].currentmember.member_Key,3),'112')>0))) on 1
    from
    <<CubeName>>
    Calculated Member:
    SUM(filter ([Dim Products].[Product ID].members,
    instr(left([Dim Products].[Product ID].currentmember.member_Key,3),'112')>0),[Measures].[Contents])
    When I drag the dimension product, the calculated member showing the same result for all the products. Can anyone let me know the syntax error here.

    Hi SQL GUN,
    For me it works :
    WITH MEMBER [Last3MonthsInternetSales] AS 
    AGGREGATE
    LastPeriods(-3, ClosingPeriod([Date].[Calendar].[Month], [Date].[Calendar].[Month].&[2005]&[12])), 
    [Measures].[Internet Sales Amount]
    SET MySet AS
    {[Date].[Calendar].[Month].&[2005]&[09],
    [Date].[Calendar].[Month].&[2005]&[10],
    [Date].[Calendar].[Month].&[2005]&[11],
    [Date].[Calendar].[Month].&[2005]&[12],
    [Date].[Calendar].[Month].&[2006]&[01],
    [Date].[Calendar].[Month].&[2006]&[02]}
    SELECT
    [Measures].[Internet Sales Amount],
    [Last3MonthsInternetSales]
    } ON COLUMNS,
    MySet
    } ON ROWS
    FROM [Adventure Works]
    Are u sure your query is correct. I think you might have a [Fiscal Month Num of Year] too much in your (). I'm not sure, but are u dragging the correct level of hierarchy ? Also in the part ON ROWS you seem to take a lot of levels with you.
    Why for example take .allmembers when you only want the actual last 3 of your currentmember?
    Can u check again?

Maybe you are looking for