![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi friends! I have a problem to make a query which gives total for last (ex. 7 days). Anything similar what I've found on the web is: This works: with set [TenBest] as 'TopCount([Product].[Brand Name].Members,10,[Unit Sales])' set [LastDay] as 'Tail(Filter([Time].[Month].Members, Not IsEmpty([Time].CurrentMember)),1)' set [Last7Days] as ' [LastDay].item(0).item(0).Lag(6) : [LastDay].item(0).item(0)' select [Last7Days] on COLUMNS, [TenBest] on ROWS from Sales OK. But what if I need [Unit Sales] for one choosen store, ex. [Store].[All Stores].[USA].[WA].[Bellingham], and I DON'T NEED first teen best: something like this ( with error!): with MEMBER MEASURE.[Shop] AS '[Store].[All Stores].[USA].[WA].[Bellingham], [[Unit Sales]) set [LastDay] as 'Tail(Filter([Time].[Month].Members, Not IsEmpty([Time].CurrentMember)),1)' set [Last7Days] as ' [LastDay].item(0).item(0).Lag(6) : [LastDay].item(0).item(0)' select [Last7Days] on COLUMNS, [Shop] on ROWS from Sales Only I need is [Unit Sales] for only one store last 7 days! Please people, I'm sure someone knows that. It's very important for me! Thanks. VK |
#3
| |||
| |||
|
|
Hi friends! I have a problem to make a query which gives total for last (ex. 7 days). Anything similar what I've found on the web is: This works: with set [TenBest] as 'TopCount([Product].[Brand Name].Members,10,[Unit Sales])' set [LastDay] as 'Tail(Filter([Time].[Month].Members, Not IsEmpty([Time].CurrentMember)),1)' set [Last7Days] as ' [LastDay].item(0).item(0).Lag(6) : [LastDay].item(0).item(0)' select [Last7Days] on COLUMNS, [TenBest] on ROWS from Sales OK. But what if I need [Unit Sales] for one choosen store, ex. [Store].[All Stores].[USA].[WA].[Bellingham], and I DON'T NEED first teen best: something like this ( with error!): with MEMBER MEASURE.[Shop] AS '[Store].[All Stores].[USA].[WA].[Bellingham], [[Unit Sales]) set [LastDay] as 'Tail(Filter([Time].[Month].Members, Not IsEmpty([Time].CurrentMember)),1)' set [Last7Days] as ' [LastDay].item(0).item(0).Lag(6) : [LastDay].item(0).item(0)' select [Last7Days] on COLUMNS, [Shop] on ROWS from Sales Only I need is [Unit Sales] for only one store last 7 days! Please people, I'm sure someone knows that. It's very important for me! Thanks. VK |
![]() |
| Thread Tools | |
| Display Modes | |
| |