Bex Query - Months & Weeks

I want to create a graph in Bex Wad that shows key figures in Months & Weeks. Can this be done? For example in my graph I want the previous 6 months of key figures but for future key figures (it's forecast data) I want to show it in weekly time buckets. At the moment I have it in my head that I have the key figures as rows on a query and the calweek as the column. This will display the data for the time period I filter in on in weeks. How do I then introduce the previous months so I can then do the graph?

Hi Joel.
You need to use a structure for your time buckets to achieve this, because as you noticed, you can't show months when the object you have in the columns is weeks.
So you need to know how far back and how far ahead in time you are going to go with this query/graph. You then have to create a selection in a structure for each of the required time buckets. The easiest will probably be if you can convince the user that the total time horizon is always based on the current date, because then you can use exit variables for your historic months based on the system date and likewise for your future weeks. If the user wants to input fx a week, it becomes more tricky, because some weeks belong to 2 different months and so you would need to know if the offset in time should be based on the start of the chosen week or the end.
If you can get away with changing the requirement a little so that the historic months are not actually months but based on say 4 week intervals, you can do without exit variables and just use the regular offset functionality on variable for weeks.
Good luck!
Jacob

Similar Messages

  • OLAP Universes - Based on BEx Query - Month and Previous Month Functions

    Hi,
      I created a Universe based on SAP BEx queries and I like to create a filter so that I use in Web Intelligence report to run for "Previous Month" data always. There are "Date" filelds in BEx Query(No Month info only date data). I have no knowledge of SAP BEx Queries and new to OLAP universes. Could you help.
    How to create filter that show Previous Month.
    Nanda Kishore
    Edited by: Nanda Kishore B on Dec 26, 2010 6:15 AM

    The easiest way  (but NOT the most efficient one) is to create a local variable (Dimension) in your report with the following code:
    =if (Month(CurrentDate())=1 AND Month([[MyDate]])=12 AND Year([[MyDate]])=(Year(CurrentDate())-1)) OR (Month(CurrentDate())>1 AND   Month([[MyDate]])=(Month(CurrentDate())-1)) then 1 else 0
    where MyDate is the field from your query containing the data information
    Activate the report filter area in your report design panel by pressing the Report filter icon and drag and drop your variable there and apply it to the entire report. Filter value 1 and you will get the data for the previous month.
    Keep in mind that this approach is not optimal especially if you do have many rows of data delivered to your WebI report because filtering takes place only AFTER the data is retrieved. The Best practice here is to work with BEx variables.
    How many rows of data does your WebI report normally fetches?
    Regards,
    Stratos

  • BEX Query for Week, MTD, YTD  for Sales data

    Hi,
    I want to display the sales data for current  Calender day, Cal week, Cal Month to date, Cal Year to Date and also for previous year Cal month, Previous Year Calender Year to Date data.
    Structure is like this. for displaying Sales data. No variables are used on selection screen regarding below structure.
    Calender Day I CalWeek I CalMonth(current) I CalMonth(previous Year) I YTD(current) I YTD(previous Year)
    Please suggest me I used the variable 0P_HAPCY is enough or I have to do any other setups.
    Message was edited by:
            Kaveri

    Kaveri,
         I think 0P_HAPCY doesn't work for all the columns. Well when the user enters date it will also have the year and month right? So what is the relevance of year entered by teh user.
    For the data for calender day, you can get directly from the user entry.
    For calweek data you need to derive week from the calday enetered by the user using customer exit.
    Similarly for month to date, and year to date.
    Use offsets on customer exit variables for previous year calmonth and previous year yera to date data.
    Hope this helps you...

  • Rolling month for webi report using Univ based on BEX Query

    Dear Experts,
    I'm new to OLAP universes.
    We have a requirements of having last 12 months rolling  for given measure(Key figure) in webi report using Univ based on Bex Query.
    We require a calmonth (time dimension) object  (restricted for last 12 months) where user can drag and drop on column section of cross-tab table.  User should drag more than one Key figure ( for ex. sales rev and & qty sold) for each month
    Could you please provide me the solution to do this?
    Thanks
    Akshara

    Hi Henry,
    Thank  you for your response.
    BEx query has not been created yet. we need to create accordingly and require your help in creating the same.
    Regarding reporting requirements,  User wants to have adhoc reporting  with rolling months ( 12 months or 6 months) functionality. Users want to link any KF to this rolling months dimension.
    If we can't have this, what is the alternative that we can propose to user.
    Thanks
    Akshara.

  • Problem with bex query listing sales "this month" and "same month last year

    Hi,
    I've created a query in BW BEx, where I have a mandatory variable for 0calmonth, and I list 0material and sales (in volume, liter). And I have a restricted key figure giving me sales (volume in liter) restricted with 0calmonth = variable - 12, to give me the sale for the same month the user select, previous year.
    This seems to be working, the sum is correct, but when adding up the number for the sales in the month previous year, the numbers does not fit the sum in the end.
    I think the report only lists materials with sales the month selected in the variable, if a material has not been sold that month, but in the same month last year, it's not listed in the reports, but it's added in the sum in the end.
    Example.
    We have three records like this:
    material - calmonth - volume
    101 - 01.2010 - 5
    101 - 01.2011 - 8
    201 - 01.2010 - 7
    The report will give the following (calmonth variable = 01.2011)
    Material - volume this month - volume same month last year
    101 - 8 - 5
    Sum 8 - 12
    Any way to solve this issue? We noticed because we run BO - Webi on top of the BEx query, and BO sum's the values per material, and in webi the report would give us the sum 8 and 5.
    Any input is appreciated.
    Regards,
    Øystein

    Hi,
    thanks for your reply.
    The error is that the report only seems to list materials that has been sold "this month", and if the same material was sold the same month last year, it will also list the volume for this.
    But if the material is only sold in the same month last year, it's not listed in the report, but it's calculated into the sum at the end.
    The report is listing material, which is why the error presents itself, as you said
    Getting 8 minus 12 is correct unless you drill down by material. In that case, it should be 8 minus 5 and 0 minus 7.
    The row with 0 - 7 is not shown, and my guess is that the report will only list materials that has sales this month (which has been selected in the variable)
    Regards,
    Øystein
    Edited by: Oystein Gundersen on Mar 21, 2011 4:36 PM

  • Bex Query report error in cal month /year column

    Hi Experts,
    We have a bex query on virtual provider with only one column in it i.e 'cal year / month'( This virtual provider ahs been created from planning area). I'm having the problem with this column.
    In the excel output of this report the cal year /month is displaying as follows.
    01/0000 02/0000 03/0000 04/0000 05/0000 06/0000 07/0000 08/0000 09/0000 08/2008 09/2008 10/2008 11/2008 12/2008 01/2009 02/2009 03/2009 04/2009 05/2009 03/2010 04/2010 05/2010 06/2010 07/2010 08/2010 09/2010 10/2010 11/2010 12/2010 01/2011 02/2011 03/2011 04/2011 05/2011 06/2011 07/2011 08/2011 09/2011 10/2011 11/2011 12/2011 01/2012 02/2012 03/2012 04/2012 05/2012 06/2012 07/2012 08/2012
    I'm not getting why the first 9 columns its displaying as 01/0000 02/0000 03/0000 04/0000 05/0000 06/0000 07/0000 08/0000 09/0000 .
    It should display as
    08/2008 09/2008 10/2008 11/2008 12/2008 01/2009 02/2009 03/2009 04/2009 05/2009
    06/2009 07/2009 08/2009 09/2009 10/2009 11/2009 12/2009 01/2010 02/2010 03/2010 04/2010 05/2010 06/2010 07/2010 08/2010 09/2010 10/2010 11/2010 12/2010 01/2011 02/2011 03/2011 04/2011 05/2011 06/2011 07/2011 08/2011 09/2011 10/2011 11/2011 12/2011 01/2012 02/2012 03/2012 04/2012 05/2012 06/2012 07/2012 08/2012
    My data source is fetching the correct data including this cal year/ month.
    Thanks in advance for your help.
    Regards,
    Brahma Reddy

    I assume you are running Crystal for enterprise 4.0 SP02 Patch 08 !!
    According to OSS note 1651521 , This issue has been fixed in FP3 which is planned to be released in first quarter of 2012 !!!!!! ouch !!!!! 
    I am facing same issue , Pls let me know if you already solved it.
    Regards,
    Miraj Desai.
    Edited by: Anne Howard on Nov 29, 2011 6:58 AM

  • How set current month in Voyager using BEX Query 7.0

    Hi:
      I have a voyager workspace connected a SAP BI Query 7.0. My query shows information since 2007 to 2009
      How I can set current month in characteristics defined in slice section? I tried to use a exit variable in proposed values query section but it doesn't works, when I use filter section in my BEX query it show only  information for 1 month.
    Thanks
    Marta Díaz

    Hi,
    From the problem report i understand that you want to open the Voyager workspace with all the data, but want to analyze for only the current month. 
    You can achieve it in the following manner.
    a) Open the Voyager report.
    b) Click on the member selector of the slice.
    c) Deselect the default member and then select the current month.
    d) Click on OK button.
    This should show you the data for only the current month.
    If you want to make use of exit variable by using the SAP query designer then try using the current calendars month variable.
    You can also refer from the discussion below in the thread to create a variable.
    Dafault value previous month in BEx
    Hope this helps.
    Thanks

  • Best practice for multiple instances of the same BEX query

    Hi there,
    I'm wondering what's the best way to use multiple instances of the same BEX query. Let me explain what I mean:
    I have a dashboard with different queries feeding different period of time such as: week to date, month to date and so on. One query for each since it is based on a user exit.
    For each query I want to show different data in different sections of my dashboard. Per example: sales per directors or sales per customer group, sales per day, sales per week and the like.I tried to connect a simple bar chart via a direct connection but with no success due to the multiple lines generated by the addition of the sales director, customer group, week number and so on.
    My question is about the way to connect the different queries efficiently in order to show the different data while avoiding multiple useless lines.
    The image above shows the query browser where, per example, for a Month to date query there will be mutiple line for each week as well as one line for each director. If, for two different components, I want to show data per week and data per director or other representation what is the best practice:
    Add another instance of the same query and only put the week information and another one will only the director info?
    Should I bind those to the excel file and use formulas to make final calculations?
    Will there be a performance issues for adding different instances of the same query
    I have 6 different queries (read 6 user exit that filters time via user exit).
    Depending on the best practices there might be 4 instances for each for a total of 24 instances in the query browser.
    I hope my question is clear enough, if not please do not hesitate I'll clarify as much as possible.
    Regards,
    Steve

    Hi Steve,
    Might be trying for solution for a long time, If i understood your question clear let me clarify you few points.
    You are trying to access the bex query which is designed with the exit's in the background based on the logic and trying to call the entire dimensions and key-figures in a single connection. Then you are trying to map those data in the charts.
    Steve, try to make more connections based upon the logic and split them. use the same query but split them by sales per customer group, sales per day, sales per week by making three different connections and try. You can merge the prompts from all connections.
    Hope this Helps!!!
    Sorry if i misunderstood your question.
    --SumanT

  • Variable Selections in BEx Query Variants

    I am trying to save a variant for a BEx query that uses a floating date range.  I want the date range to move with the calendar.  I r/3 this is done with the variable selection.  In BW 3.5, I don't see how this is possible.  I only see options for TVARVC which are user exit selections.  Can someone point me in the right direction.
    Regards,
    Kevin B

    Hi Kevin
    Your requirment is that date range should move with calendar (ex. In first week , the date range should be from 1 to 7 of the current month & in  second week the date range should be from 1 to 15 of current month) ...if it is like this then you can go ahead with - create a variable and do the coding with sydatum (system date ) and embed the required logic. But if your requirement is completely random then you can not use this.
    Hope this helps
    Regards
    Pradip
    (Rewarding points is the way of saying thanks on SDN !!)

  • Bex query - templets

    Hi,
    Can anyone give me some examples or templets of Bex query for Auto mobile service industry please.
    Queries like  Inventory maintenance, Consumption of Parts each vehicle at the time of service, Number of Vehicles a service engineer attended per day/ week/ month,  etc.
    Please give me some details about it.
    Regards

    The best place to start for looking at query templates for IS-AU, would be the SAP Help Portal at:
    [http://help.sap.com/saphelp_nw70/helpdata/en/f4/1e453cabf4ef6fe10000000a114084/frameset.htm]
    Sequenced JIT Calls
    Vehicles Fitted
    Components Groups (various)
    Variant Frequency
    Components Called
    Production Planning Backflush
    Goods Issues / Goods Receipts / Scrap (various)
    Reporting Point (various)
    Component Consumption (various)
    Activity Consumption (various)
    Production Variances (various)
    Vehicle Management System
    Supply Analysis
    Stock Analysis
    Vehicle Availability
    Top 10 Sellers
    Partner and Vehicle Relationship Analysis
    Business Partners (various)
    Vehciles (various)
    Warranty Analytics
    Claims (various)
    Failures (various)
    Recalls (various)

  • Report on BEx query with 2 structures (one in rows and one in columns)

    Hi, experts! I have to make Crystall report on BEx query with 2 structures, one in columns (with KF's), and one in rows. Is it possible to create such report? Because when I create such report, I cant see fields in structures, only characteristics fields.
    Ok, I found samr problem in another thread. Sorry.
    Edited by: Mikhail Sychev on Dec 5, 2009 9:53 PM

    Hey Flora,
    Happy to hear that its working now.
    Answering your question, again its upto the connection and report format you are using. Based on your question i hope you your report output should be like this.
    You cannot map to two labels for the series, again this report format is possible only in cross tab through Webi. I would suggest you to concatenate the material and month in a dimension in webi like below.
    I have done the concatenation in excel level, i would suggest you to do that in webi. Try to reduce the formula as much in excel.
    or
    If you are using Query browser connection, then i would suggest you to create a separate report which will display the actual vs plan material wise, here you need to pass the material as a prompt.
    Hope this helps in clear, please revert me for any clarification.

  • Get number of month, week and date between 2 dates

    Hi all,
    Is it possible to display number of month, week and days between 2 dates? either by using only SQL query or through PL/SQL...
    Input:
    From date: 01-Oct-2010
    To date: 19-Oct-2010
    I want output as below (Assuming the week starts from Monday to Sunday in oracle).
    01-Oct-2010 -- (Since this is in mid of the week)
    02-Oct-2010 -- (Since this is in mid of the week)
    03-Oct-2010 -- (Since this is in mid of the week)
    40 -- (Oct 4 to Oct 10 falls in 40th week of the year)
    41 -- (Oct 11 to Oct 17 falls in 41th week of the year)
    18-Oct-2010 -- (Since this is in mid of the week)
    19-Oct-2010 -- (Since this is in mid of the week)
    Note: If there is one full month between the given date, then the month number should be displayed.
    After the month, the remaining date comprised with one full week, then the week number of the year should
    be displayed. After displaying the week, the remaining dates should be displayed as it is..
    Appreciate your help..
    Thanks.
    Rajan.

    I suppose if it's just like a calendar type information you want then something like...
    SQL> break on month skip 1
    SQL> set linesize 200
    SQL> set pagesize 2000
    SQL> column month format a20
    SQL> column week format a4
    SQL> with req as (select '&Required_Year_YYYY' as yr from dual)
      2      ,offset as (select case when to_char(trunc(to_date(yr,'YYYY'),'YYYY'),'IW') in ('52','53') then 1 else 0 end as offset from req
      3  select lpad( Month, 20-(20-length(month))/2 ) month,
      4         '('||week||')' as week, "Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"
      5  from (
      6    select to_char(dt,'fmMonth YYYY') month,
      7    case when to_char(dt, 'mm') = '12' and to_char(dt,'iw') = '01' and offset = 0 then '53'
      8         when to_char(dt, 'mm') = '12' and to_char(dt,'iw') = '01' and offset = 1 then '54'
      9         when to_char(dt, 'mm') = '01' and to_char(dt,'iw') in ('52','53') then '1'
    10         else to_char(to_number(to_char(dt,'iw'))+offset) end as week,
    11    max(decode(to_char(dt,'d'),'1',lpad(to_char(dt,'fmdd'),2))) "Mo",
    12    max(decode(to_char(dt,'d'),'2',lpad(to_char(dt,'fmdd'),2))) "Tu",
    13    max(decode(to_char(dt,'d'),'3',lpad(to_char(dt,'fmdd'),2))) "We",
    14    max(decode(to_char(dt,'d'),'4',lpad(to_char(dt,'fmdd'),2))) "Th",
    15    max(decode(to_char(dt,'d'),'5',lpad(to_char(dt,'fmdd'),2))) "Fr",
    16    max(decode(to_char(dt,'d'),'6',lpad(to_char(dt,'fmdd'),2))) "Sa",
    17    max(decode(to_char(dt,'d'),'7',lpad(to_char(dt,'fmdd'),2))) "Su"
    18    from ( select trunc(to_date(req.yr,'YYYY'),'y')-1+rownum dt
    19           from all_objects, req
    20           where rownum <= add_months(trunc(to_date(req.yr,'YYYY'),'y'),12) - trunc(to_date(req.yr,'YYYY'),'y') )
    21        ,offset
    22    group by to_char(dt,'fmMonth YYYY'),     case when to_char(dt, 'mm') = '12' and to_char(dt,'iw') = '01' and offset = 0 then '53'
    23                                                  when to_char(dt, 'mm') = '12' and to_char(dt,'iw') = '01' and offset = 1 then '54'
    24                                                  when to_char(dt, 'mm') = '01' and to_char(dt,'iw') in ('52','53') then '1'
    25                                                  else to_char(to_number(to_char(dt,'iw'))+offset) end
    26    ) x
    27  order by to_date( month, 'Month YYYY' ), to_number(x.week)
    28  /
    Enter value for required_year_yyyy: 2010
    old   1: with req as (select '&Required_Year_YYYY' as yr from dual)
    new   1: with req as (select '2010' as yr from dual)
    MONTH                WEEK Mo Tu We Th Fr Sa Su
        January 2010     (1)               1  2  3
                         (2)   4  5  6  7  8  9 10
                         (3)  11 12 13 14 15 16 17
                         (4)  18 19 20 21 22 23 24
                         (5)  25 26 27 28 29 30 31
       February 2010     (6)   1  2  3  4  5  6  7
                         (7)   8  9 10 11 12 13 14
                         (8)  15 16 17 18 19 20 21
                         (9)  22 23 24 25 26 27 28
         March 2010      (10)  1  2  3  4  5  6  7
                         (11)  8  9 10 11 12 13 14
                         (12) 15 16 17 18 19 20 21
                         (13) 22 23 24 25 26 27 28
                         (14) 29 30 31
         April 2010      (14)           1  2  3  4
                         (15)  5  6  7  8  9 10 11
                         (16) 12 13 14 15 16 17 18
                         (17) 19 20 21 22 23 24 25
                         (18) 26 27 28 29 30
          May 2010       (18)                 1  2
                         (19)  3  4  5  6  7  8  9
                         (20) 10 11 12 13 14 15 16
                         (21) 17 18 19 20 21 22 23
                         (22) 24 25 26 27 28 29 30
                         (23) 31
         June 2010       (23)     1  2  3  4  5  6
                         (24)  7  8  9 10 11 12 13
                         (25) 14 15 16 17 18 19 20
                         (26) 21 22 23 24 25 26 27
                         (27) 28 29 30
         July 2010       (27)           1  2  3  4
                         (28)  5  6  7  8  9 10 11
                         (29) 12 13 14 15 16 17 18
                         (30) 19 20 21 22 23 24 25
                         (31) 26 27 28 29 30 31
        August 2010      (31)                    1
                         (32)  2  3  4  5  6  7  8
                         (33)  9 10 11 12 13 14 15
                         (34) 16 17 18 19 20 21 22
                         (35) 23 24 25 26 27 28 29
                         (36) 30 31
       September 2010    (36)        1  2  3  4  5
                         (37)  6  7  8  9 10 11 12
                         (38) 13 14 15 16 17 18 19
                         (39) 20 21 22 23 24 25 26
                         (40) 27 28 29 30
        October 2010     (40)              1  2  3
                         (41)  4  5  6  7  8  9 10
                         (42) 11 12 13 14 15 16 17
                         (43) 18 19 20 21 22 23 24
                         (44) 25 26 27 28 29 30 31
       November 2010     (45)  1  2  3  4  5  6  7
                         (46)  8  9 10 11 12 13 14
                         (47) 15 16 17 18 19 20 21
                         (48) 22 23 24 25 26 27 28
                         (49) 29 30
       December 2010     (49)        1  2  3  4  5
                         (50)  6  7  8  9 10 11 12
                         (51) 13 14 15 16 17 18 19
                         (52) 20 21 22 23 24 25 26
                         (53) 27 28 29 30 31
    61 rows selected.
    SQL>

  • Crystal reports - Create Report from SAP Bex Query

    I have installed the Crystal reports 2008 for a trial period and the sap integration kit. I have created a new report from a sap query and I am trying to format the report. I would like the columns headings be similar to Bex query - Current Month Jan 2009 which includes the selection parameter of month. I have tried with no sucess. Any help will be appreciated

    Ingo
    in crystal reports the variables are available in the field explorer. However when I drag the date selection to the report (in design mode) i get the foloowing ?[0I_CALMO], but when I execute the report I don't get any values. I also tried to create a formula but could not access the parameter for month year. Is there documentation on how to do this?
    Thanks for your help.

  • Cumulative Quantities in a BEx Query

    Hi Friends,
    I have to get the Cumulative Values for a Key Fig Actual Quantity in a BEx Query.
    The scenario is as follows:
    I have the following data in the cube:
    YearWeek       ActQuantity
      200601                     35
      200602                     40
      200651                      30
      200652                      35
      200701                      20
      200702                      35
      200703                      45 
      200747                      30
      200748                      45
      200749                      40
      200750                      25
      200751                      40
      200752                      35
      200801                      40
      200802                      35
      etc.,
    The Report Req is as follows:
       The user will enter any range (Eg: 200748 - 200802)
    and he wants to see the report as follows:
    YearWeek ActQnty  CumQnty
                                   (Cumltd from 1st wk of the year)
    200748                    45             2500  (2455 + 45)
    200749                    40             2540  (2500 + 40)
    200750                    25             2565
    200751                    40             2605
    200752                    35             2640
    200801                    40                40 (since it is 1st week)
    200802                    35               75
    Important thing is the report should show the quantities only for that period (weeks), the user entered. But the cumulative values must be from the first week of that calender year.
    Thanks for any help/suggestion.
    Regards,
    Ranjith

    Hi Rakesh,
       Actually the user enters two values (eg: 200740 - 200748) and he wants to see the actual quantities and cumulative quantities only for the weeks between the user entered i.e., between 200740 and 200748.
      But when I execute the query with user exit variable I defined, I am getting actual quantities and cumulative quantities from 200701 to 200748. The values are correct but I want to restrict this report only to the period between 200740 and 200748.
      The user entry range may also cross between two different years (eg: 200748 - 200812)
    Thanks for your help.
    Ranjith

  • Crystal report showing Incorrect data against Bex Query

    I have created Crystal report on top of Bex Query, I have not done any calculations in the report, just dragging structure and key figure in the report, ran for one month, when I compare with Bex Query with same period, it is showing incorrect data.
    I don't know what can be wrong here?
    We are Business Objects 3.1 SP3.
    Thanks,
    Ravi

    HI,
    I would suggest you trace the workflow in Web INtelligence according to these notes:
    Tracing:
    Unix : Note 1235111
    Windows : Note 1260004
    and then post a link for downloading the trace files here.
    regards
    Ingo

Maybe you are looking for