I have a publications datamart from teachers of my university, I would like to select the list of teachers with how much books they wrote and in period while them publicated the books.
Example Teacher - Last Year of pubblication - Number of Books
Teacher A - 2014 - 200 books
I tried to do something like:
WITH MEMBER [Measures].[LastYear] AS
'(ClosingPeriod([Anno].[Anno])
,[Autore].[Nome].CurrentMember)'
SELECT
{[Measures].[Unita (Libri)],[Measures].[LastYear]} ON COLUMNS,
NON EMPTY
[Autore].[Nome].Members ON ROWS
FROM [Pubblicazioni]
but the field last year is alway void, if i try to change the second part of ClosingPeriod with [Measures].[Unita (libri)] it is empty too... How should i implement that query? I'm a bit confused about
EDIT
select [Measures].[Libri] ON COLUMNS,
crossjoin([Autore.default].[Nome].[Fazzinga, Bettina], tail(NonEmptyCrossJoin([Autore.default].[Nome].[Fazzinga, Bettina], [Anno.default].[Anno].Members), 1).Item(0).Item(1)) ON ROWS
from [Pubblicazioni]
This one is working great for the teacher [Fazzinga, Bettina], but the query stops to work while i doing
select [Measures].[Libri] ON COLUMNS,
crossjoin([Autore.default].[Nome].Members, tail(NonEmptyCrossJoin([Autore.default].[Nome].CurrentMember, [Anno.default].[Anno].Members), 1).Item(0).Item(1)) ON ROWS
from [Pubblicazioni]