dbTalk Databases Forums  

sales per square foot, where square footage changes over time...

microsoft.public.sqlserver.olap microsoft.public.sqlserver.olap


Discuss sales per square foot, where square footage changes over time... in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
bwlang@gmail.com
 
Posts: n/a

Default sales per square foot, where square footage changes over time... - 08-30-2006 , 04:08 PM






I have built two cubes and put them into a virtual cube
cube 1 contains all the sales values by date and location
cube 2 contains all the square footage information by date and
location.
The information in these cubes is not on the same date grain.

I want to produce a calculated member "sales per sqft" that is correct
for any selected time period.

If I have only one square foot value I can do the calculation like this

say 100 sq ft on 04/01/02

Iif(
([Accounts].[Sales],[Measures].[Square Feet],[date].[all date])=0, 0,
([AccountNumbers].[Sales]
,[Measures].[Amount])/
([AccountNumbers].[Sales],[Measures].[Square Feet],[date].[All date]))

But if i add a second value 30 sq ft on 04/30/02, i have a problem.
Any sort of square foot aggregation will be incorrect in some
circumstance.

I've fooled around with topcount but I can't get that working.

I could do this by keeping the square foot information on the same
grain as the sales information but that's such a waste of space that i
don't want to do it.

How can i solve this problem?


Reply With Quote
  #2  
Old   
Deepak Puri
 
Posts: n/a

Default Re: sales per square foot, where square footage changes over time... - 08-30-2006 , 07:44 PM






For the square footage, maybe you can adapt the Last Non Empty Value
calculation discussed in this MSDN paper:

http://msdn.microsoft.com/library/de.../en-us/dnsql2k
/html/semiadd2.asp
Quote:
Analysis Services: Semiadditive Measures and Inventory Snapshots

Amir Netz
Microsoft Corporation

Updated May 18, 2004

Applies to:
Microsoft SQL Server 2000
Microsoft SQL Server 2000 Analysis Services

Summary: Focusing on a classic inventory problem, this article describes
the implementation techniques of semiadditive measures in online
analytical processing.

...

Measures.[Last Non Empty Value]:
CoalesceEmpty((Measures.[Value], Time.CurrentMember ) ,
(Measures.[Last Non Empty Value],Time.CurrentMember.PrevMember))
Quote:

- Deepak

Deepak Puri
Microsoft MVP - SQL Server

*** Sent via Developersdex http://www.developersdex.com ***


Reply With Quote
  #3  
Old   
Brad Langhorst
 
Posts: n/a

Default Re: sales per square foot, where square footage changes over time... - 08-31-2006 , 04:13 PM




Deepak Puri wrote:
Quote:
For the square footage, maybe you can adapt the Last Non Empty Value
calculation discussed in this MSDN paper:

http://msdn.microsoft.com/library/de.../en-us/dnsql2k
/html/semiadd2.asp

....

Thanks!

That set me on the right track.
I ended up creating a new calculated measure that used the coalesce
empty recursively.
Like this...
CoalesceEmpty((Measures.[Value], Time.CurrentMember ) ,
(Measures.[Last Non Empty Value],Time.CurrentMember.PrevMember))

Best wishes!

Brad



Reply With Quote
  #4  
Old   
Brad Langhorst
 
Posts: n/a

Default Re: sales per square foot, where square footage changes over time... - 08-31-2006 , 05:48 PM




Deepak Puri wrote:
Quote:
For the square footage, maybe you can adapt the Last Non Empty Value
calculation discussed in this MSDN paper:

I thought i had it until I realized that I have the aggregation all
wrong...
[Latest Square Feet] =

CoalesceEmpty(

(Ancestor([accountnumbers].currentmember,[AccountNumbers].[Level
01]),
Measures.[Square Feet], [Date].CurrentMember) ,
(Ancestor([accountnumbers].currentmember,[AccountNumbers].[Level
01]),
Measures.[Latest Square Feet],[Date].CurrentMember.PrevMember)
)

Lets say a company has 3 changes to their square footage.
If I go up to a level where more than one is involved I need to
calculate the time weighted avearge of that square footage, NOT the
sum. I'm not sure if this is a semiadditive measure or just non
additive.

I tried adding the Avg function in various places but I see no
change...
Feels like a black box experiment. I hope I start to understand this
better soon...

Thanks for any help!


Brad



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.