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

Similar Messages

  • Error querying OLAP universe based on BEx query

    Hi all,
    I have a problem extracting larger (more than 80 000 rows) amounts of data through querying an OLAP universe with WebI.
    The error is:
    Query 1 - NAME_OF_THE_QUERY
    A database error occurred. The database error text is: Error in MDDataSetBW.GetCellData. &INCLUDE INCL_INSTALLATION_ERROR. (WIS 10901)
    The error occurs when I define larger scope of analysis in the query (four levels). With more modest scope (three levels or less) it's working OK. I need larger data set (more than 200 000 rows) to be populated at night through scheduling the report. We can't afford shrink the scope of analysis because it will hit the BW server during the day when it's needed by other users.
    Besides this the speed of the report refresh is very slow - more than 3 minutes per just 400 rows of data. I'm still unable to identify the source of the problem with this slowdown. Executing the same query over the web through the SAP BW BEx Viewer is much much faster - just 3 seconds. Maybe the reason for this is that the BEx viewer aggregates data on the higher level of the hierarchy rather than down to transaction level (like we do by expanding the scope of analysis).
    Anyway, if anyone have ideas about the error above I'll be very grateful if you share your thoughts. Thanks!
    Our environment:
    BO EDGE BI 3.1, standard
    SAP BW 3.0
    SAP Integration Kit (all transports installed)
    BW user with full access

    Ingo,
    Could you point me to an official SAP document regarding the 1 million cells limitation, which describes the exact version and patch level for SAP BW which removes this limitation? It will be very helpful for me because I have to convince the client to migrate BW from 3.0 to 7.01 if it will solve this limitation.
    Thank you in advance!
    Ivan
    BTW I have installed SP2 + FP2.1 and now the SAP integration is not functional, but I have opened another thread for this problem.

  • Olap Universe Based on BEx Query - Cascading Prompt

    I need to get two prompts: 1) Division 2) Group. Division has to be selected first and then Group. I understand I have to create cascading prompt. In the universe, in default hierarchy, group stands before before division. I have created a custon hierarchy like: Division, Group. I used Tools -> List of Values ->Create cascading list of values and then selected the right dimensions and then clicked on Generate LOVs. Then I have exported it to the repository. But I cannot see any reflection at the report level. So, some questions came in my mind:
    1) Where can I check in the universe whether my cascading prompt has been created or not ?
    2) I am using L01 Dimension. But underneath, there are two dimensions called LovDivision and LoVDivisionBase which are in Italic. I believe integration kit creates this. It is the same as Group. So, my question is: Am I selecting the right dimesnsions ? Or, should I select those in Italic.
    3) Actually, these two prompts (variables) [along with others] are already created in BEx which I can see in my report. My plan is, if my cascading prompts work, I will tell the BW developer to remove those two. Do you think that these existing prompts are creating any problem.
    I would really appreciate your response.

    Hi
    1) Where can I check in the universe whether my cascading prompt has been created or not ?
    Have you entered the cascading object in the  webi query condition.At the run time  it will generate  hierarchy in the tree structure.
    2) I am using L01 Dimension. But underneath, there are two dimensions called LovDivision and LoVDivisionBase which are in Italic. I believe integration kit creates this. It is the same as Group. So, my question is: Am I selecting the right dimensions ? Or, should I select those in Italic.
    correct you are using right objects L01.By mdx driver it will create by default L00 and L01 objects.neglect the Lo00 objects.You can  hide them in the universe or go to refresh structure and their is option to replace L00 definition with some other definition.
    3) Actually, these two prompts (variables) along with others are already created in BEx which I can see in my report. My plan is, if my cascading prompts work, I will tell the BW developer to remove those two. Do you think that these existing prompts are creating any problem.
    By default  when you are creating universe based on the mdx drivers it will convert Bex query filters in the universe condition as mandatory filter  and applied on the full universe.
    You can go to the universe condition and open the condition and unchecked the option  from their and after that these will not prompt in the webi query.
    Thanks,
    Amit

  • Parameter for Current Month and Previous Month

    I'm trying to create a parameter for current month and previous month based on the ex_date, but not sure what i'm doing wrong. 
    where ex_date = @SelectDate
    I created a second dataset below for the values in the parameters.
    SELECT Month(CURRENT_TIMESTAMP) AS 'Month', 'Current Month' as 'Current Month'
    union all
    SELECT Month(CURRENT_TIMESTAMP)-1 AS Month, 'Previous Month' as 'Previous Month'
    Results
    Month Current Month
    3 Current Month
    2 Previous Month
    Once I preview it I get "Conversion failed when converting date and/ or time from character string" I changed the data type to "date/Time" but that did not make a difference. The date is convert (varchar(10), ex_date, 101) so looks like
    11/12/2014. 
    I've also tried expressions like =month(now()) to pull current month with same error so i'm not sure what i'm doing wrong. Any ideas?

    i tired this real simple report
     in the first dataset - my main report query - select name from sysdatabases where month(crdate())=@month
    in the second dataset - select month(getdate()) as Month1
    in the parameters - choose int data type and available values - select the second data set
    in the first data set- add this parameter..( i am assumming you know this, since you have done)
    in the preview you should get the drop down with current month number - 3
    and if you run the report, it will display the database names that were created in march. remember we are no checking year, so will get all that were created in march across the years.
    Hope it Helps!!
    I'm looking to have the dropdown say "Previous Month" and "Current Month" as a option. I know how to get the information in SQL, but not sure how this translates or put into a parameter.
    Current Month
    list_date BETWEEN
    DATEADD(MONTH, DATEDIFF(MONTH, 0, GETDATE()), 0)
    AND
    DATEADD(MONTH, DATEDIFF(MONTH, 0, GETDATE()) + 1, 0)
    Previous Month
    list_date between
    CONVERT(varchar,dateadd(d,-(day(dateadd(m,-1,getdate()-2))),dateadd(m,-1,getdate()-1)),106) /* Last Month */
    and
    CONVERT(varchar,dateadd(d,-(day(getdate())),getdate()),106)

  • Records for parameter month and previous month

    Hi,
    I have a request where the user parameter is calender year month (YYYYMM).I need to show the records of both the entered month and previous month.
    For ex: if the user enters 201107, I need to show the records of 201107 and 201106.
    Also,I am not using dashboards.
    Any suggestion...
    Thanks

    No, I don't see this as a solution. A session prompt can only be overridden by using a Request Variable, but they are found in Dashboard prompts which you have excluded as a solution. Therefore, any session variable you set would be "hard-coded" eliminating end-user interaction. Sorry.
    You will need to deploy dashboards for this. I will also add this: eliminating dashboards really restricts the power of OBI because it makes it difficult to implement interactive reports such as the one you are building. Perhaps you should use this example as a push to consider adding the value of dashboards to your environment.
    As this is useful information to others, please mark applicable posts that resolved your question. Thanks.

  • OLAP universe on top Bex query

    Hi all,
    I have a Bex query with a single mandatory Hierarchy variable. This hierarchy variable was created over GL Account infoobject. I have to different active hierarchies.
    I generated a OLAP universe based on this Bex query.
    The problem is it doesn´t generate any sub-class for hierarchy and for level objects.
    I can't see any filter in OLAP universe GL account dimension.
    Any ideas?
    Thanks in advance
    Regards
    David

    Hi Ingo,
    Thanks for your help.
    Yes, I can see both hierarchies in result set when I run the query in RSRT.
    Both hierarchies are not time dependent and very simples.
    I made a lot of test (working with query designer 3x, query designer 7) and to me it is a problem with integration kit.
    There is no filter related to my hierarchy characteristic, nor level generated in OLAP universe.
    Hope your comments.
    Regards
    David
    Edited by: DAVID GALLEGO on Nov 8, 2010 3:45 PM

  • Steps to create a Universe based on Bex query

    HI Gurus,
    I am (first time ofcourse) creating a Universe based on a Bex Query. I searched on SDN to find steps to craete a universe on top of Bex query and found a document written by tej Trivedi and found other threads also which explains all the steps.
    I understood from his document that in case of OLAP Universes the Structure pan would be empty. And I will not see joins etc..Is that true?
    How can I make sure that I will see data?
    Regards

    Hi,
    I believe this is a cross post from here Re: BEX Query Objects dont show in Universe  ?
    So i will put my answer again:
    Hi,
    If you can select your BEx query,  but the 'universe outline' in the webi query panel stays blank (i.e no available objects in the webi query panel)  then you don't have enough rights (authorizations) on the BW -side.
    to prove it, try using a sap_all profile in the universe connection .
    regards,
    H
    p.s. there is a large section on the required authorizations in the Admin guide.  Also a note covers it :  Note      1585948 - No objects are visible in the query panel when creating a report using Interactive Analysis or BI Launchpad

  • Current Date in Olap Universe basead in Bex Query

    Hi All!
    I'm having some problems as the current date in the universe.
    I need the report that runs in background and a filter has the current date, I mean current month and year. The universe is based on a query Bex, and the query have a variable with the current month and year.
    I canu2019t filter int the query because it always bring the current month, and a only need that for a few reports, the others it gonna be filter by date choosen by the user.
    To resolve this I made this filter:
    <FILTER KEY="[0CALMONTH].[LEVEL01]">
    <CONDITION OPERATORCONDITION="Equal">
    <CONSTANT CAPTION ="Dec 2010"/>
    </CONDITION>
    </FILTER>
    And to my surprise it worked!
    I wonder if there is any way to make a filter with the current date dynamic?
    I tried in the constant caption : "[0CALMONTH].CurrentMember" or "[0CALMONTH].DefaultMember", but didnu2019t work, the query returns blank. Is there any way to do this? Is there any variable that the BW understand that I want the current month and year?
    Tks a lot!
    Livia

    Sorry! I didn't see that, but i already posted in the right forum.
    In the Universe.
    But it could be done with a filter in web i report also.
    Any ideas?
    Tks!
    Livia

  • Can not create Webi report on a Universe based on Bex Query

    Hi,
    We are using BO XI 3.1 (FP 3.4) with SAP integration Kit (same Patch Level) with SAP Authentication. We have a Universe based on a bex query and its connection is set to use SSO.
    We have say two SAP users U1 & U2. Now "U1" is able to create webi reports but when we Logged in as "U2" and try to create Webi reports or try to refresh reports created by U1 it through an error ...
    The database error text is: (CS) "Error on NumResultCols" . (WIS 10901).....
    As per the "Authorization" section in BusinessObjects XI Integration for SAP Solution Installation Guide we have provided this users with all the mention autherizations.
    Any words over this will be highly appreciated.
    Regards,

    It is highly probable that this is due to missing authorizations on the SAP BW side (not talking about the authroizations which are directly related to the BO/BW integration). I would recommend to ask your SAP Basis team to do a security trace while you are accessing the reports with the user, who gets the error. THey should look for failing authorization checks.
    Regards,
    Stratos

  • BW Variables not showing up in universe based on BEX query

    We've been trying to create BO Universes on BEx Queries.  When we create the connection, it reads the query into the Universe, however, it does not always read all of the BW variables associated with the queries.  We've moved all filters in the BEx Query into Free Characteristics but BO Designer still does not read them into the universe or create them as mandatory filters in the universes as the documentation states.  Any assistance is appreciated. Thanks

    Hi -
    I assume that you might have kept the filters(Variables) in Default Values section. Only filters which are placed in Characterstic restrictions will appear in Universe Designer. Thanks!
    Regards,
    Anesh B

  • Current month and Previous Month

     Hi, I have the table shown above. I m trying to get output something like I need current month total amount and the total of the previous month. Can someone please help on this?  THank you
    ID           PreviousMonthTotal        CurrentMOnthTotal      
    1              3000                                3000                   

    Please say your @@version,
    on
        Microsoft SQL Server 2012 (SP1) - 11.0.3412.0 (X64)
        Mar  2 2014 01:25:09
        Copyright (c) Microsoft Corporation
        Standard Edition (64-bit) on Windows NT 6.2 <X64> (Build 9200: )
    query show ZEROS.
    DECLARE  @TEMP as TABLE
        id int,date_t datetime,amount int
    INSERT @TEMP (id,date_t,amount)
    VALUES   (1,'20150112',1000)
            ,(1,'20150212',1000)
            ,(1,'20150122',2000)
            ,(1,'20150202',200)
            ,(1,'20160112',41000)
            ,(2,'20150112',1001)
            ,(2,'20150212',1003)
            ,(2,'20150122',2004)
            ,(2,'20150202',205)
            ,(2,'20160112',41020)
            ,(2,'20160212',11200)
            ,(2,'20140122',201)
            ,(2,'20140202',20)
    SELECT ID as [Cust Ref]
    , SUM(CASE WHEN Date_t = dateadd(MM,-1,getdate()) THEN Amount ELSE 0 END) as [Total LAST Month]
    , SUM(CASE WHEN Date_t = getdate()  THEN Amount ELSE 0 END) as [Total This Month]
    FROM @temp
    GROUP BY ID

  • Set variable date in a procedure with current month and previous month

    Hi guys, I need to set two date range in one procedure. The date should be
    @datefrom the third day of the current month
    @dateto the seventh day of the current month
    @datefrom-1 the third day of the previous month
    @dateto-1 the seventh day of the previous month
    format like @datefrom '2014-03-03' @dateto '2014-03-07'
    @datefrom '2014-02-03' @dateto '2014-02-07'
    The problem for me it's going to be the jump between the years...2014 to 2015...any advice?
    Thanks

    DECLARE @FirstDayOfCurrentMonth DATE
    SELECT @FirstDayOfCurrentMonth = DATEADD(MONTH, DATEDIFF(MONTH, '01/01/1900', Current_timeStamp), '01/01/1900')
    SELECT
    DATEADD(DAY, 2, @FirstDayOfCurrentMonth) As ThirdDayOfCurrentMonth
    ,DATEADD(DAY, 6, @FirstDayOfCurrentMonth) As SeventhDayOfCurrentMonth
    ,DATEADD(DAY, 2, DATEADD(MONTH, -1, @FirstDayOfCurrentMonth)) As ThirdDayOfPreviousMonth
    ,DATEADD(DAY, 6, DATEADD(MONTH, -1, @FirstDayOfCurrentMonth)) As SeventhDayOfPreviousMonth
    OUTPUT
    ThirdDayOfCurrentMonth SeventhDayOfCurrentMonth ThirdDayOfPreviousMonth SeventhDayOfPreviousMonth
    2014-12-03 2014-12-07 2014-11-03 2014-11-07
    Best Wishes, Arbi; Please vote if you find this posting was helpful or Mark it as answered.

  • Current month and previous months of fiscal year period data

    Hi All,
    My requirement is end user will enter month ie (fiscal year period ) and in report my requiremnt is to show data in two columns 1.Current month data  and
    2.April till date.
    Please let me know how to do this and please send the coding to be done in CMOS.
    Regards

    Hi,
    In your query, you should have following object :
    in filters:
    fiscal period object, with an user entry variable on it (UE_MONTH)
    in rows/ratios:
    Current month column, with your KF and a restriction on 0calmonth2 with an customer exit variable on it (ie: CE_VAR1)
    same for April column. (CE_VAR2)
    in your customer exit, CMOD, step 2, add these two cases :
    WHEN 'CE_VAR1'.
    READ TABLE i_t_var_range WITH KEY vnam = 'UE_MONTH' INTO
                       intern_range.
    CONCATENATE intern_range-low(6) sy-datum+4(2) INTO l_s_range-low.
    l_s_range-sign   = 'I'.
    l_s_range-opt    = 'EQ'.
    APPEND l_s_range TO e_t_range.
    Same for April, add a new case and just replace sy-datum+4(2) by '04'.
    Hope it helps,

  • Show current month and previous month measures

    Experts,
    My period names are stored like this in the Period Dim table 'Jan 2012'.....'Aug 2012', ... 'Dec 2012' etc..
    To my request, i will pass only the current period value via. a drop down prompt, say 'Feb 2013' and it has to apply filter like this Period."Period name" in ('Feb 2013', 'Jan 2013').
    I cannot use TIMESTAMPADD(SQL_TSI_MONTH, -1, Period."period name") as my period name is a char. Can someone suggest any idea?
    Version : 10.1.3.4
    Regards,
    Sarvan

    Hi,
    This can be achived,but little bit tedious process...
    Create an intermediate report with three columns.
    first column : Monthcolumn,which you are using in prompt.
    Second column :This column is for selected month
    Try to convert Jan 2012 to 201201,Feb 2012 to 201202...This can be achieved by writing a case statement like below
    cast((Case when substring(column from 1 for 3)='Jan' then 01...........)||substring(column from 5 for 4) as int)
    Third column:Prior month
    cast((Case when substring(column from 1 for 3)='Jan' then 01...........)||substring(column from 5 for 4) as int)-1
    Now add the same column formula to the main report and hide it(let's say column name will be "HIDED")
    cast((Case when substring(column from 1 for 3)='Jan' then 01...........)||substring(column from 5 for 4) as int)
    Now you can apply filter based on another request on the hided column.
    HIDED<=Second column in intermediate report.
    HIDED>=Third column in intermediate report.
    Now you will get the desired reults in your report.
    Hope this helps.
    Thanks,
    Pramod.

  • Unwanted LOVs - Universe on a BEx query on top of a Multiprovider

    BO XI 3.1
    BW 7.01
    OLAP Universe on a BEx query
    BEx query on top of a Multiprovider
    Multiprovider on 2 DSOs; lets say DSO1 and DSO2
    BEx query has a global filter for "INFOPROVIDER = DSO1"
    BEx query has a user input variable defined for "Field1" (Field1 is present in both DSOs)
    In BEx, F4 on Field1 variable entry gives the values of Field1 from DSO1. (which is what we want)
    Expected LOVs for the generated prompt for Field1 in the WEBI report: Values of Field1 from DSO1
    Problem:
    Actual LOVs returned in WEBI report: Values of Field1 from both DSO1 and DSO2
    Has anyone faced this before?
    Thank you

    Henry Banks wrote:
    > I have a suspicion the BEX property 'only values in infoprovider' isn't picked up/consumed by the BAPIs used by the MDX interface.
    That is correct. The BEx properties do not carry over to the BO side. In Webi 3.1 here are the default selections for LOVs (as far as I know)
    OLAP universe against BEx query on an infoprovider (Infocube, DSO, Multiprovider) - Only values in Infoprovider
    OLAP universe against BEx query on an Infoset - Values in the master data table
    My understanding now is
    OLAP universe against BEx query on a Multiprovider - Only values in ALL Infoproviders under the Multiprovider
    Henry Banks wrote:
    > Yes, this is confirmed by Note 1224318 - MDX: InfoProvider restriction for the member rowset
    > It's a BW limitation of the OLE DB for OLAP.
    I have seen this note before and according to it you can set an RSADMIN parameter MDX_JOIN_CUBE_DIME and have more control over the LOVs.
    MDX_JOIN_CUBE_DIME = "A" -> The read mode for all LOVs is Only values in master data
    MDX_JOIN_CUBE_DIME = "I" -> The read mode for LOVs is either master data or infoprovider depending on the infoobject settings
    Henry Banks wrote:
    > It might be easier to have to 2 data providers for this document, if you don't already, for plan and actual;  or 2 seperate bex queries.
    Well, that would work but it would defeat the purpose of having a Multiprovider for logical partitioning, wouldn't it?

Maybe you are looking for