How to get the opening balances for lessthan selected date in cubes.

Hi All,
my task is to get the opening balances for the selected date.
Ex: If I select date say 31-1-2013, I should get the sum of values which are less than the selected date.
in sql:
select sum(balance) from banktrans where banktrans.transdate < 31-1-2013;
BankTable                            BankTrans
BankId                               BankId
                                        balance
                                        transdate
BankTable (records):
SCB
BankTrans(records):
a) SCB, 15000, 10-02-2013
b) SCB, 20000, 31-01-2014
c) SCB, 50000, 21-09-2012
If I select date as 31-01-2014, I should get the value as 65000 
If I select date as 10-02-2013, I should get the value as 50000
Date will be dynamic selection from years months days hirearchy ( time dimension)
How can i achieve this?  
any help is much appreciated.
Thanks,
Rakesh

Dear David,
I've tried the below with static date but i'm not getting the values which are sum of less than the given date.
I've given 1st jan 2013 as static date and I need to get the sum of values which are less than the 1st jan date.
CREATE
MEMBER
CURRENTCUBE.[Measures].[OPENBALANCE]
AS
Sum({Null:[Time].[Years
Quarters Months Weeks Days].[Days].&[2013-01-01T00:00:00]},[Measures].[AmountCur]]),
FORMAT_STRING
= "Standard",
VISIBLE
= 1
can you plz check the above once and guide me.
Thankyou,
Rakesh

Similar Messages

  • How to query the opening balance for an specific account for an spec. date

    Hi all,
    for my user query I need to calculate the opening balance for an cash account for an specific date.
    Any ideas, how can I do this?
    Or may be you know a field in an SBO table that already contains information I need...
    Best Regards,
    Inna

    Hi Inna,
    to find the opening balance for an account or a business partner, please see SAP Note [1114253|https://service.sap.com/sap/support/notes/1114253] :
    Symptom
    How to find the opening balance of a business partner or G/L account.
    Other terms
    Account, customer, supplier, vendor, creditor, debitor, start, initial, first, opening balance, business partner, G/L, SAP Business One
    Reason and Prerequisites
    Consulting
    Solution
    There are several possible approaches:
    Approach 1 - Business Partner Opening Balance:
    1. Go to Business Partners -> Business Partner Master Data -> find the Business Partner
    2. Click on the orange link arrow next to the field 'Account Balance' in the header region of the window.
    3. Untick the boxes next to 'Posting date from', 'Display' and 'Display Unreconciled Trans. Only'.
    4. Click on the button 'Refresh'.
    5. Find 'OB' in the column 'Origin', this is the opening balance journal entry.
    Approach 2 - Business Partner Opening Balance:
    1. Go to Business Partners -> Business Partner Master Data.
    2. Click on the orange link arrow next to the field 'Account Balance' in the header region of the window.
    3. Untick the boxes next to 'Posting date from', 'Display' and 'Display Unreconciled Trans. Only'.
    4. Click on the button 'Refresh'.
    5. Double click on the column header 'Posting Date' to find the earliest transaction on the business partner account. This transaction could be opening balance, verify this with the company accountant.
    Approach 3 - G/L Account Opening Balance:
    1. Go to Financials -> Chart of Accounts -> click on the account name once.
    2. Click on the orange link arrow next to the field 'Balance'.
    3. Untick the boxes next to 'Posting date from', 'Display' and 'Display Unreconciled Trans. Only'.
    4. Click on the button 'Refresh'.
    5. Find 'OB' in the column 'Origin', this is the opening balance journal entry.
    Approach 4 - Business Partner and/or G/L Account Opening Balance:
    1. If using SAP Business One 2005 SP01 or earlier, go to Reports -> Query Generator -> click on 'Execute'.
    2. If using SAP Business One 2007 or later, go to Tools -> Queries -> Query Generator -> click on 'Execute'.
    3. Ignore the red system message in the bottom of the screen.
    4. Click on the pencil icon in the top left of the window, the field with 'SELECT *' will change colour to white, then yellow when activated by clicking in the field.
    5. Copy the query below:
               SELECT T0.[TransId], T0.[Debit], T0.[Credit] , T0.[CreatedBy], T0.[TransType] FROM [dbo].[JDT1]  T0 WHERE T0.[TransType] = '-2'  and T0.[ShortName]  = '[%1]'
    6. Click on 'Save' and give the query an appropriate name and select the appropriate category.
    7. Click on 'Execute'.
    8. Click on 'Existing Values'.
    9. Select the G/L account or the Business Partner name from the list and click on 'OK'.
    10. The system message 'Records retrieved by this query #' (# = number of records) will pop up. Click on 'OK'.
    All the best,
    Kerstin

  • How to get the week number for a given date?

    hi guys,
    what is coding to get the week number for a given date?
    For example, 1/1/05 is week 1. then 8/1/05 is week 2.

    The second parameter to pass to the method is supposed to be one of the month constants JANUARY - DECEMBER. It happens to be that their numerical values are 0-11, not 1-12, so your "12" refers to the "13th" month of the year.
    givenDate = new GregorianCalendar(2003, Calendar.DECEMBER, 31);
    If you want to construct dates and times from strings like you seem to be, look into SimpleDateFormat http://javaalmanac.com/egs/java.text/ParseTime.html
    (even still I got WEEK_OF_YEAR as 1 which is true but not really what I expected, excuse my previous reply but I wanted to check the facts before posting this)

  • How to get the weekends days for a specific date range

    I want to select list of only weekend dates from a given date range. Is it possible in SQL?
    For example if the range is '08/01/2011' and '08/30/2011'
    I want a list
    08/06/2011
    08/07/2011
    08/13/2011
    08/14/2011
    08/20/2011
    08/21/2011
    08/27/2011
    08/28/2011Thank You, Naveen email:[email protected]

    First and easy to do is having a Calendar table, which over there you can have those information.
    http://arbibaghdanian.blogspot.com/2011/05/calendar-table.html
    Declare @beginDate Date, @EndDate Date
    Select @beginDate = '08/01/2011', @EndDate = '08/31/2011'
    Declare @Calendar Table
    (CalendarDate Date Primary key, IsWeekend Bit, YearNo SmallInt, QuarterNo TinyInt, MonthNo TinyInt, DayOfYearNo SmallInt, DayNo TinyInt, WeekNo TinyInt, WeekDayNo TinyInt)
    While @beginDate <= @endDate
    Begin
    Insert Into @Calendar
    Select
    @beginDate As CalendarDate
    ,(Case When DATEPART(Weekday, @beginDate) In (7, 1) Then 1 Else 0 End) As IsWeekend
    ,DATEPART(Year, @beginDate) As YearNo
    ,DATEPART(QUARTER, @beginDate) As QuarterNo
    ,DATEPART(MONTH, @beginDate) As MonthNo
    ,DATEPART(DayOfYear, @beginDate) As DayOfYearNo
    ,DATEPART(Day, @beginDate) As DayNo
    ,DATEPART(Week, @beginDate) As WeekNo
    ,DATEPART(WEEKDAY, @beginDate) As WeekDayNo
    Set @beginDate = DateAdd(Day, 1, @beginDate)
    End
    Select * From @Calendar Where IsWeekend = 1
    Best Wishes, Arbi --- MCC 2011; Please vote if you find this posting was helpful or Mark it as answered.

  • Passing the Opening Balance for the 1st peroid of the quater

    HI ,
    Passing the Opening Balance for the 1st peroid of the quater: The report format is as follows
    Code-Desc-Amount
    1001-AAAA-1000
    1002-BBBB-2000
    1003-CCCC-3000
    The output is based on quaterwise. If I enter the first period of the particular quater, it will show the reports for the whole quater. I created the report and working fine.
    But the problem is that, if it is AAAA, i need to pass only first period of that quater else total of the quater.
    Can you please, explain me how to do this....
    Thanks and Regards
    Rajesh

    Hi Pooja,
    RSA3 only shows records in setup table, which is collected by MCNB.
    by MCNB, you could only get the current opening stock, and in order to calculate the open stock in previous month,
    you'd have to load the history movement via 2lis_03_bf.
    Thanks & B.R.
    Vince

  • How to get the last error for while loop?

    How to get the last error for while loop? I just want transfer the last error for while loop, but the program use the shift register shift all error every cycle.

    What do you mean by "get" and "transfer"?
    If the shift register is not what you want, use a plan tunnel instead.
    Typically, programmers are interested in the first, not last, error.
    Can you show us your code so we have a better idea what you are trying to?
    LabVIEW Champion . Do more with less code and in less time .

  • How to get the Open qty. in JIT Schedule in VA33 txn.

    How to get the Open qty. in JIT Schedule in VA33 txn.
    The F1 Helps says Structure VBEPD field name is OLFMNG.

    any clues ??

  • How to get a opening balance in fbl1n

    how to get a opening balance in fbl1n as i copied it into zreport,
    plz help
    Moderator message : Spec dumping not allowed, thread locked.
    Edited by: Vinod Kumar on Dec 1, 2011 3:07 PM

    how to get a opening balance in fbl1n as i copied it into zreport,
    plz help
    Moderator message : Spec dumping not allowed, thread locked.
    Edited by: Vinod Kumar on Dec 1, 2011 3:07 PM

  • How to get the depreciation areas for an asset in particular period

    Hi frndz,
      how to get the depreciation areas for an asset in a particular period for writeup or manual depreciation method.
    Thanks and regards.
    Harisumanth.Ch

    Try table ANLB, then read ANLC.
    Regards.

  • How to get the version no. for service po?

    Hi,
    How to get the version no. for service po?For material po we are getting the version from EKKO-REVNO but for service po Ekko-revno is blank.
    Regards,
    Rachel.

    Hiee,
    It is not like service PO does not have revision.
    REVNO will only exists for any document if amendment is made after releasing it. If in EKKO for all service PO revision number is blank then test if version management is active for document type
    MM->Purchasing->Version management -> External documents
    Here check for your doc type and purchase org version management is active.
    Regs,
    Appie

  • How to get the owner name for the file in ftp using abap ?

    Hi folks ,
    How to get the owner name for the file in ftp using abap ? please help me very ugernt . I tried with all standard FTP commands
    but doest work out me . Helping in this regard highly appreciated ...
    Thanks and regards,
    Swarupa Vanarchi

    Hi
    dont you  have used the os user while calling the FTP_CONNECT FM?
    Hope you are not talking about the user executing the FTP program.
    Else If you are talking about the FTP file creator then its not related to abap as you can handle it by maintaining the user in file name itself.
    May be i am going too far with if and elses here as your question possesses no  clarity.
    Plz elaborate your requirement  before anybody can help.
    Regards
    sateesh

  • How to get the document number for a ware house order.

    Hello gurus,
    how to get the document number for a ware house order. [if GI is posted refering that WH order] .. is there any report?
    Thanks in advance

    There are several options.  When you post a Goods Movement, you can use LB12 -display Transfer Requirement for material document or LB11 Display TR for material.
    Depending on how your system is set up you may have gotten a Transfer Order automcatically.  In this case you can look at LT24 - Transfer Order for material.

  • How to get the baselinegrid position for a line?

    Hi All,
    How to get the baselinegrid position for a line in a paragraph?

    Hi,
    2nd line baseline grid for yourPara paragraph is:
    yourPara.lines[1].baseline;
    last line baseline is:
    yourPara.endBaseline;
    Jarek

  • HT204291 how do get the media icon for mac mirroring when running airplay on itunes?

    how do get the media icon for mac mirroring when running airplay

    Airplay mirroring requires a Mac from 2011 or later, running OSX 10.8 (or later)
    http://support.apple.com/kb/HT5404?viewlocale=en_US&locale=en_US

  • How to get the latest update for the phone?

    hey does anyone know how to get the latest upgrade for my phone? 3230 nokia

    http://www.nokia.co.uk/nokia/0,,58162,00.html
    Gadget
    Remember to mark all correctly answered questions as Solved. A forum is only as great as the sum of its parts, together we will prevail.

Maybe you are looking for

  • Froze on black screen and power button does not work

    my sons ipod touch is stuck on a black screen when plugged into the computer got a spinning wheel and will not connect now spinning wheel will not go away the power button does not work so can not reset it manually any suggestions would be appreciate

  • XBTM* queue with sysfail as the FM: SXMS_ASYNC_EXEC failing.

    Hi All, We have a landscape that includes two PI systems between the SAP system and the legacy systems. We received a large message of around 85MB from the legacy system through HTTP adapter. This message was transformed and processed successfully fr

  • Special Characters in charts with web reports

    Hello, we are facing a problem to display special characters in charts on web reports (it comes out badly). The only sap note found about this problem is note n°1036745, but it is for NW 2004s, but should be solved in NW04s BIJava SP 12, and we are c

  • How can I access the data on my time capsule remotely?

    I see the drive under the shared tab in Finder, but I cannot open it.  I am at school and need to access documents that are stored on my time capsule at home.  When I set everything up, I enabled "sharing over WAN" and everything and set up the passw

  • Apple Store app?

    There isan Apple Store app for the iPhone but not for the iPad? Seriously??