Solved

How to Roll over End of Month Stock to Beginning Stock of next month in SQL Server 2000 AS

Posted on 2008-10-19
1
891 Views
Last Modified: 2013-11-16
Hi Experts,

I have a cube that the has the following

Dimensions
- Time
- Location
- Product
- Transaction Type

Measures
- Qty

The transaction Type dimension classifies all the different transaction codes.
The Sum aggregate at the (ALL) level of the Transaction type dimension is the total changes in inventory for the period, at a location for a product.

I created a Calculated member called BOM (Beginning of Month) with parent dimension 'Transaction Type' and Parent Member '(All)'.
The formula = [Time].prevmember, [Transaction Type].(All)

The BOM rolls the amount at 'all' but the BOM member is not aggregated up to the Transaction Type (All) for the next period.

Period 1
  BOM                         <NULL>
  Initial Stock Take      100
  Sales                         -10
  Recieved                     20
Total at (ALL)            110

Period 2
  BOM                          110
  Sales                         -30
  Recieved                     25
Total at (ALL)              -5        

Period 3
  BOM                            -5
  Sales                         -20
  Recieved                     15
Total at (ALL)               5        

... and so on ...

In the Dimension Browser
Transaction Type
All
  Initial Stock Take
  Sales
  Received
  BOM (calculated member)

I assume that Transaction Type dimension at level all will sum all children INCLUDING the calculated member BOM?

Why doesn;t this work?

Anyone can help me?


Period
0
Comment
Question by:tozysentosa
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 

Accepted Solution

by:
tozysentosa earned 0 total points
ID: 22783135
Hi,
I found the answer...

Create a Calculated member called BOM (Beginning of Month)
with parent dimension 'Transaction Type' and Parent Member '(All)'.
The formula = sum(periodstodate([Time].[(All)], [Time].prevmember),[Transaction type].[(All)])

This sums the total changes from beginning up to previous time member which is equal to the beginning stock of current period.

The formula = sum(periodstodate([Time].[(All)],[Transaction type].[(All)])  gives the Ending stock formula.


0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SQL query for highest sequence 4 63
Access control a form field in Lotus Notes 3 25
Connect remotely to SQL Server DB without TCP/IP enabled? 2 35
SQL Syntax 6 31
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Via a live example, show how to shrink a transaction log file down to a reasonable size.

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question