Reputation: 153
Hello guys again here with my MDX headaches (why does my boss think programmer = solve anything computer related).
The measure of the Filter Productos is compose this way [Casa].[Linea].[Producto] and I am trying to filter by Linea 72 and 74, outside this anyone know a good tutorial online or book for MDX?
Anyways here my MDX so far
SELECT 'Dic 1 2010' AS Fecha, A.*
from (SELECT
"[Measures].[Piezas Dia]",
"[Measures].[P Redondeadas]"
FROM openrowset('MSOLAP'
,'DATASOURCE=XXX
;Initial Catalog=XXX
; User Id=XXX;Password=XXX;',
'WITH SET [Lineas] AS ''
FILTER(DESCENDANTS([PRODUCTOS],[LINEA],SELF),
ANCESTOR([PRODUCTOS].CURRENTMEMBER,SELF) <> [74 VARIOS] AND
ANCESTOR([PRODUCTOS].CURRENTMEMBER,SELF) <> [72 VARIOS] )''
Member [Measures].[Piezas Dia] AS ''sum([Lineas],[Measures].[|P| Venta Dia Año Actual])''
Member [Measures].[P Redondeadas] AS ''sum([Lineas],[Measures].[Venta Piezas Redondeadas])''
SELECT {[Measures].[Piezas Dia], [Measures].[P Redondeadas]} on columns
FROM [Venta Gerencial]
WHERE ([Fecha Diario].[Fecha].&[2010].&[12].&[1])')) as A
Thanks for all help provided.
Upvotes: 1
Views: 2541
Reputation: 449
You asked for a book referral. My boss just purchased SQL Server 2008 MDX Step by Step for me. I'm beginning to go through it and I like the way it is laid out. I've been programming in T-SQL for over ten years and MDX is just close enough to confuse me. This book is helping me think different about my code and coding practices. I haven't finished it, but I do think that it might be a good one for you to start with, as you can jump in anywhere in the book to learn what you need to know.
Upvotes: 4
Reputation: 5412
Should it really be a , instead of a ; here:
FROM openrowset('MSOLAP' ***,*** 'DATASOURCE=HDZNT10
Upvotes: 1