Bex Query Get Qty of previous day

Hello,
I have a requirement and I'm not sure if it possible to design a bex query for it
I have the stock data for each date.In my report I need to display the current day stock,previous day stock and the delta.
The layout should be like below
               Calendar day  01.01.2009    02.01.2009  03.01.2009 .........
Stock                          |           200 |            350   |         425  |
Stock previous day       |           100 |            200   |         350  |
Delta                           |           100 |            150   |           75  |
To get the current day stock is simple,it will just get the stock associated with that calendar day but to fetch the previous day stock i'm not sure how to set the fillter.
Any suggestions please?
Thank You.
Edited by: A Pothuneedi on Apr 27, 2009 4:43 PM

Hi,
Select Stock Prv Day - Right Click--> Edit- now Find the Time dimension and Select CALDAY and drag drop right side.
Right click on calday Select Restrict --> Select the variable which created move it to right side and give offset as -1. You will find offset setting above.
Please do this and let us know if still have any issues.
Reg
Pra

Similar Messages

  • Prompt in BeX query getting error

    Hi All,
    I am getting below error when I am creating prompt in BeX query. It working fime if I am using this query in Olap Analysis but in Webi I am getting below error. I am using BO 4.0
    The DSL Service returned an error: java.lang.UnsupportedOperationException
         at com.sap.ip.bi.bics.dataaccess.consumer.impl.selector.selection.SingleMember.getSingleMember(SingleMember.java:321)
         at com.businessobjects.mds.olap.protocol.bics.internal.BICSQueryViewWrapper.cacheVariables(BICSQueryViewWrapper.java:418)
         at com.businessobjects.mds.olap.protocol.bics.internal.BICSQueryViewWrapper.<init>(BICSQueryViewWrapper.java:124)
         at com.businessobjects.mds.olap.protocol.bics.internal.BICSClientImpl.getCube(BICSClientImpl.java:1098)
         at com.businessobjects.mds.olap.protocol.bics.internal.BICSClientImpl.getCube(BICSClientImpl.java:1067)
         at com.businessobjects.dsl.services.workspace.impl.QueryViewAnalyzer.getQueryCube(QueryViewAnalyzer.java:309)
         at com.businessobjects.dsl.services.workspace.impl.QueryViewAnalyzer.createOlapUniverse(QueryViewAnalyzer.java:281)
         at com.businessobjects.dsl.services.workspace.impl.QueryV
    Please help me out to solve this issue.

    Hi,
    1) Check product availability matrix (PAM) if everything is on supported version.
    2) Upgrade to some latest patch of 4.0
    If this does not help then I would recommend, raise it directly to SAP Support team.
    Probably you can open connections to your BW system and engineer can directly check the query you are using.
    Thanks,
    Vivek

  • Bex Query getting Freezed while formatting results

    Hi Friends,
    I am running a BEx Query with one year data selection but it's getting freezes while formatting results. But when i deselect the 'Format after refresh' option  in the query properties..then query is running fine.
    Could you please let me know if there is any reason for this?
    Regards,
    Mahesh

    Hi,
    Just generate your query once with program RSR_GEN_DIRECT_ALL_QUERIES.
    By selecting your multiprovider .
    Thanks,
    Ranjan

  • Get records from previous day to today

    hi
    i have 1 main table, table A, which has all the data .
    now i have table b which has previous day data and table c which has current data. i need to compare table a(each column)
    to each column in table b and c
    and need to find out rows that has been changed from yesterday to today and send that data.
    table B and table C doesnt have any date which say which date it got changed

    >> I have 1 main table, table A, which has all the data .<<
    What is a “main table”? I never used or heard that term. I am old, so I remember “main” or “master” tape files, however. 
    No table should have all the data in a schema that has more than one relationship in it. Where is the DDL?  
    >> now I have table b which has previous day data and table c which has current data <<
    NO! This design error is called “Attribute splitting” and it usually comes from programmers like you who are using SQL to write 1950's magnetic tape files. Would you have a “Male_Personnel” and a “Female_Personnel”  table or a “Personnel” table? Those
    two absurd tables were split on sex_code, just like you want to split this unknown data on a “<something>_date” attribute. 
    >>  I need to compare table a(each column) to each column in table b and c and need to find out rows that has been changed from yesterday to today and send that data. <<
    No, you need to stop trying to write SQL until you know what you are doing. To track the history of, say, Foobars we need to see time as a continuum and model it as (begin_date, end_date) pairs that define when a foobar had a particular value. Here is the skeleton. 
    CREATE TABLE Foobar_History 
    (foo_id CHAR(9) NOT NULL, 
     start_date DATE NOT NULL, 
     end_date DATE, --null means current 
     CHECK (start_date <= end_date),
     foo_status INTEGER NOT NULL, 
     PRIMARY KEY (foo_id, start_date)); 
    When the end_date is NULL, that state of being is still current. You use a simple query for the status on any particular date;
    SELECT * 
      FROM Foobar
     WHERE @in_cal_date
         BETWEEN start_date
          AND COALESCE (end_date, CURRENT_TIMESTAMP);
    There are more tricks in the DDL to prevent gaps, etc
    CREATE TABLE Events
    (event_id CHAR(10) NOT NULL,
     previous_event_end_date DATE NOT NULL  
     CONSTRAINT Chained_Dates  
      REFERENCES Events (event_end_date), 
     event_start_date DATE NOT NULL, 
     event_end_date DATE UNIQUE, -- null means event in progress
      PRIMARY KEY (event_id, event_start_date), 
     CONSTRAINT Event_Order_Valid 
      CHECK (event_start_date <= event_end_date), 
     CONSTRAINT Chained_Dates 
      CHECK (DATEADD(DAY, 1, previous_event_end_date) = event_start_date)
    -- CHECK (previous_event_end_date + INTERVAL '01' DAYS) = event_start_date)
    -- disable the Chained_Dates constraint
    ALTER TABLE Events NOCHECK CONSTRAINT Chained_Dates;
    GO
    -- insert a starter row
    INSERT INTO Events(event_id, previous_event_end_date, event_start_date, event_end_date)
    VALUES ('Foo Fest', '2010-01-01', '2010-01-02', '2010-01-05');
    GO
    -- enable the constraint in the table
    ALTER TABLE Events CHECK CONSTRAINT Chained_Dates;
    GO
    -- this works
    INSERT INTO Events(event_id, previous_event_end_date, event_start_date, event_end_date)
    VALUES ('Glob Week', '2010-01-05', '2010-01-06', '2010-01-10');
    -- this fails
    INSERT INTO Events(event_id, previous_event_end_date, event_start_date, event_end_date)
    VALUES ('Snoob', '2010-01-09', '2010-01-11', '2010-01-15');  
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

  • Need to create at BEX Query to get last 30 days data.

    Hi,
    I need to create a bex query based on input date need to calculate last 30 days outstanding and 31-60 days outstanding 61-90 days outstanding 91-180 days outstanding and greater than 180 days outstanding. Please find the format of the report.Kindly help me.
                                                                                                                          Thanks & Regards,

    Based on those documents you can easily create.
    1. First create variable (Mandatory) user input
    2. Posting date is avaialble as char you will get
    3. need to calcualte difference b/w those 2 dates  you can refer below  By using replacement path we can convert both dates into get difference.
    http://www.sd-solutions.com/SAP-HCM-BW-Replacement-Path-Variables.html
    4. now need to create  Bucketing logic  formula  as per requirement above documents will give idea.

  • 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

  • To get previous day timestamp of a timestamp value in java

    Hi,
    I have a timestamp variable, say settledTimeStamp which is passed as a runtime argument to a query. I should also send another timestamp variable say previousTimeStamp whose value should be previous day timestamp, ie for settledTimeStamp.
    For example,
    Todays date= May 9th 2008.
    say settledTimeStamp to May 7th 2008.
    I should get the timestamp value for previous day to SettleDate i.e May 6th, 2008.
    I am showing this as an example because I tried with Calendar options too but it takes current timestamp and gives previous days timestamp which is not the same as I required. Like it returns May 8th as my previousTimeStamp if I work with Calendar options....
    Can anyone help me on this?

    An object of the Calendar class represents a specific point in time. The fields, such as DAY_OF_MONTH, allow you to access meaningful parts of that specific point in time and use them. Calendar.DAY_OF_MONTH is a field, and it doesn't represent the "current day" or any particular point in time at all. It's used to ask a particular Calendar object what its DAY_OF_MONTH is.
    import java.util.Calendar;
    public class Test {
         public static void main(String[] args) {
              Calendar cal = Calendar.getInstance();
              cal.setTimeInMillis(99999999999L);
              int year = cal.get(Calendar.YEAR); //cal, what is your YEAR?
              System.out.println(year);
              int dayOfWeek = cal.get(Calendar.DAY_OF_WEEK); //cal, what is your DAY_OF_WEEK?
              System.out.println(dayOfWeek);
              boolean inApril = Calendar.APRIL == cal.get(Calendar.MONTH); //cal, are you in the month of APRIL?
              System.out.println(inApril );
              System.out.println(cal); //cal, tell me all about yourself
    }Really, the documentation can do a better job explaining it than I can. Read it. And there are numerous Calendar and Date tutorials all over the internet. Date processing in java is not the easiest thing, so it can take a bit of getting used to, but you will have to read the documentation and write code yourself to understand it.
    Oh, and you mark your question as answered and then dispense duke stars to posts you felt were helpful. I don't think people here really care much about them.

  • How do I set iCal alerts to a specific time the previous day, regardless of their specific time (so I can get an overview of tomorrow)?

    I think it would be incredibly useful to be able to get at, say, 10pm each evening, a pop up overview of the next day's events. I'm hoping for a tick box somewhere to set my default reminder as a specific time on the previous day, in the same way that you can do '15 minutes before'. Currently you can set reminders for a specific time and date, but, entering this for every item – especially if you want them to coincide – is more than slightly tedious. Furthermore, I input a lot of my Calender events on my iPhone (they sync via iCloud), which has no such functionality, rendering this essentially defunct.
    Any ideas?

    apple don't have a version of windows
    only microsoft have windows
    as how one automatate windows to send mails at a time
    googled it for you
    http://www.howtogeek.com/125045/how-to-easily-send-emails-from-the-windows-task- scheduler/
    more options in the search
    https://www.google.dk/search?client=opera&q=automatically+send+email+in+windows& sourceid=opera&ie=UTF-8&oe=UTF-8

  • How to get previous day of the date

    Hi,
    for a given date I need one day minus as a result date
    my input would be any date
    for example :
    Input Date : 2006-03-22 ( yyyy-mm-dd)
    Output should be : 2006-03-21
    If my input is 1st of April 2006, output i would expect is 31st March 2006
    Please suggest how to achieve this
    Thanks in advance
    Nilesh

    Find below the code to get previous day of the current date
    import java.util.Date;
    import java.text.DateFormat;
    import java.text.SimpleDateFormat;
    import java.util.Calendar;
    public class PreviosDay
    public static void main(String[] args)
    DateFormat dateFormat = new SimpleDateFormat( "MM/dd/yyyy");
    Calendar cl = Calendar.getInstance();
    // you can use a Date object's getTime() method , which is initialiazed
    // to desired date here directly ex: Date dt = new Date("10/10/2004");
    // cl.setTimeInMillis(dt.getTime());
    cl .setTimeInMillis(System.currentTimeMillis());
    cl.add(Calendar.DAY_OF_MONTH, -1);
    System.out.println("Previous date : "+dateFormat.format(
    new Date(cl.getTimeInMillis() ) ) );
    }

  • How to edit the properties for existing variables in BEX query, so that I can get multiple input selections

    Dear fellow developers,
    I'm trying to edit an existing variable using BEX query, so that it can allow multiple input selections.
    As you can see in the screenshot attached, the option is selectable during creation.
    However, during editing of an existing field, this field (Details -> Basic Settings -> Variable Represents) is not selectable.
    Does anyone knows why, and how to remedy this?

    Yes you can do it at the table level.
    Go to SE11 enter table name as RSZGLOBV.
    Enter the technical name of variable in VNAM field..You need to change the value in VPARSEL column.
    Please make sure to get the where used list of this variable so that you can know the impact,if something goes wrong.
    Also change it in DEV and then transport across the landscape.
    PS:Same thing has been described in this blog as well
    Changing BI variable parameters
    Regards,
    AL
    Message was edited by: Anshu Lilhori

  • How to get the previous Day of a specified day?

    Hi
    Iam developing a report and I want it to show the data of the previous day
    What is the query required to do that?
    Note:
    there is a field to insert the date for data saving

    You also need to be careful about the time part of the date, e.g.
    SELECT   TO_CHAR(SYSDATE,'DD/MM/YYYY HH24:MI:SS')
    ,        TO_CHAR(SYSDATE-1,'DD/MM/YYYY HH24:MI:SS')
    FROM     dual;
    TO_CHAR(SYSDATE,'DD TO_CHAR(SYSDATE-1,'
    06/12/2008 11:57:49 05/12/2008 11:57:49
    1 row selected.You can use the TRUNC command to strip the time from the date:
    SELECT   TO_CHAR(TRUNC(SYSDATE),'DD/MM/YYYY HH24:MI:SS')
    ,        TO_CHAR(TRUNC(SYSDATE)-1,'DD/MM/YYYY HH24:MI:SS')
    FROM     dual;
    TO_CHAR(TRUNC(SYSDA TO_CHAR(TRUNC(SYSDA
    06/12/2008 00:00:00 05/12/2008 00:00:00
    1 row selected.

  • How to get previous day data if i dont have current day data.

    Hello Gurus,
    I have a stock levels data in ODS. when there is no movements, we are not getting any stocks into ODS. So we have to get previous day data as it is for current day data into another ODS.
    Could you please help me in this regard.
    Thanks in advance,
    Rama

    Rama -    
            0CALDAY can't help us in this scenario .
    Step 1 :
        To do this - You have to add one ZDATE (InfoObject ) to 1st ODS. ZDATE is updated by itself from current date of system  when ever you are loading data to 1st ODS.
    Step 2:
       You have to do full update to 2nd ods.At the selection screen of InfoPackage  (from 1st ODS to 2nd ODS ) you have to write following code for ZDATE.
    pseudo Code:
    1) Select fields "Rec_INSERT","Time stamp","Request Status" and "Request ID"  where ICUBE = ODS1 from table "RSMONICDP"
    2) Populate above selected fields data in INTERNAL TABLE
    3) Sort INTERNAL TABLE by Time stamp .
    4)
         If (Record Count = ' 0 ' for current date in internal table )
         update records from  ODS1 to ODS2 where ZDATE = "yesterday date"
         else
         update records from ODS1 to ODS2 where ZDATE= "today date"
         endif.
    Make sure this is full update not delta update from ODS1 to ODS2
    I am sorry, I m not good in Coding but I am sure if  u use this logic,You can meet your requirement.
    I hope you can understand my logic. Let me know if you have any questions,
    Anesh B .

  • How to get bex query changes reflected in webi.

    Hi expert,
             I am using sap bex query in WEBI by BICS connection, but I have done some change in bex query, how can I get those changed reflected in webi.
    Many Thanks,

    Hi Zhang,
    Please review following link which would help you to understand the impacts of changes in the BEx Query to associated universes and webi reports.
    http://wiki.scn.sap.com/wiki/display/BOBJ/Impact+of+a+BEx+query+change+to+universes+and+WebI+documents
    Regards,
    Veer

  • Getting Java error while connect BEx query to WebI report (SAP BI4.0 )

    Not able to connect BEx query to WebI report (SAP BI4.0 ) . Below is the error I get while creating a new BEx connection to BOBJ WebI report .
    Please find the below error and help me ,
    "Select a BW Bex query window box "  displayed "Nothing to display " and server error as mentioned below
    Java.uti.concurrent.executionException: Com.sap.sl.sdk.repository.service.repositor******
    at Java.uti.concurrent.futuretask (Unknown source )
    at java.swing.swing.timer.fireactionperformed(Unknown source )
    at java.awt.event.invocationEvent.dispatch(Unknown Source)
    Thanks ,
    Pradeep Gorpadu

    Hi,
    I am on BO 4.0 SP05 Patch 6. Webi reports are just showing processing but not giving results. When I try to create new report it is throwing java security error.
    Tried applet patch upgrade(From link : https://websmp207.sap-ag.de/~sapidb/011000358700000902752013E) for webi certificate but didn't help.
    Please suggest what could be done.
    Thanks and Regards,
    Ankit Sharma

  • Get BEx query name in ABAP Class

    Hi,
    I have setup a Virtual Key Figure and need to get the BEx    query name within the implemented RSR_OLAP_BADI Class Compute method.
    Is there a system variable that holds this?
    Thanks in Advance

    Hi.
    Look at among components of importing parameter I_S_RKB1D of method you mentioned.

Maybe you are looking for

  • HP 7600 AIO Leopard update

    I recently found the new release of HP 7600 software for Leopard. After some trouble, I was able to install it (apparently) successfully for our HP Officejet Pro L7650 (which apparently is the Costco version of the L7680). I have a LAN based on an Ai

  • New problem with searching in Mail

    To find specific emails in specific mailboxes, I normally go to that mailbox and use the search function. In the past, the results were limited only to emails in that specific mailbox, that is, one result per individual email. However, for the last f

  • Music player wont open after update

    Hi, Recently i have updated music player for my nokia 5800. But after update i cant open music player and not even able to open songs folder from gallery. Could anyone help on this.

  • I can't print from adobe reader

    I just installed a new wireless printer.  I can print from all programs except Adobe Reader.  I get a print dialogue box, but when I try to click Print, Properties, or Page Setup, nothing happens. I contacted Epson but they said it must be an Adobe i

  • To create Dynamic Selection screen using Key Fields

    Hi All, We have a requirement where we want to create Dynamic selection screen using Key fileds of Z-table or any standard table. Please provide some solution if you have worked in this area. Thanks in Advance, Anand Raj Kuruba