![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi, I have a cube with Date, Product and Activity dimension which will give me what activity was carried out on which product and when. The measure in this cube is quanity which will be minus if it is out and plus if it is it type of activity. My requirement: for a given date, I need to find the stock that do not have activity for previous 30 days. Any help on how to write MDX for this will be greatly appriciated. Thanks Mahesh *** Sent via Developersdex http://www.developersdex.com *** |
#3
| |||
| |||
|
| SELECT |
#4
| |||
| |||
|
|
Might want to try a NonEmptyCrossJoin() approach, since activities on a given day may cause quantity to be <=> 0: SELECT {Measures.Quantity} ON COLUMNS, Except(Descendants([Product],,LEAVES), NonEmptyCrossJoin(Descendants([Product],,LEAVES), {[Time].Lag(30):[Time].PrevMember}, 1)) ON ROWS FROM [<Cube>] WHERE ([Time].[Day].[18 Nov 2005]) - Deepak Deepak Puri Microsoft MVP - SQL Server *** Sent via Developersdex http://www.developersdex.com *** |
#5
| |||
| |||
|
#6
| |||
| |||
|
#7
| |||
| |||
|
#8
| |||
| |||
|
#9
| |||
| |||
|
|
I agree with Darren's interpretation here. The problem sounds like classic inventory scenario with things moving in and out - so NonEmptyCrossJoin seems to be not appropriate here, but the Filter testing on non-zero values is. -- ==============================*=================== = Mosha Pasumansky - http://www.mosha.com/msolap Analysis Services blog at http://www.sqljunkies.com/WebL*og/mosha Development Lead in the Analysis Server team All you need is love (John Lennon) Disclaimer : This posting is provided "AS IS" with no warranties, and confers no rights. ==============================*=================== = |
#10
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |