Hello,
How do I get the quantity of the last Date for every Location ?
See example given:
select
[Measures].[Quantity] on columns,
(
nonemptycrossjoin(
[Location].[Location].[Location]
, [Posting Date].[Posting Date]
, 2
)
)
on rows
from
[Logistics]
This query will give me the following result:
This is what I want
Kind regards.
You should take a look at LastNonEmpty aggregation function in AS2005. It does exactly what you need.
|||Let me refine this with another example:Date | Location | Horz. Group | Horz. Code | Vert. Group | Vert. Code | Item | Quantity |
2006-1-1 | A | 6 | 1 | 5 | 1 | I10256 | 1 |
2006-1-2 | A | 6 | 1 | 5 | 1 | I10256 | 2 |
2006-1-3 | A | 6 | 1 | 5 | 1 | I10256 | 3 |
2006-1-1 | B | 6 | 1 | 5 | 1 | I10256 | 4 |
2006-1-3 | B | 6 | 1 | 5 | 1 | I10256 | 5 |
2006-1-1 | B | 6 | 1 | 5 | 2 | I10256 | 6 |
The actual supply-result for the year 2006 = 3 + 5 + 6 = 14 (this is correct)
The LastNonEmpty-result in AS2005 = 3 + 5 = 8 (this is not correct, eg. is not sorted by date as you can see but doesn't matter :o)
I actually wanna have the LastNonEmpty grouped by [Date],[Location],[Horz etc],[Vert etc],[Item] ?
How can I force the LastNonEmpty to do that ? Not only Time-related !?
I wanna see the correct supplies in my time-dimension on the level year or month or day :o)
Kind regards.
No comments:
Post a Comment