Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

MDX and VB FUNCTIONS --- Expand / Collapse
Author
Message
Posted Sunday, February 3, 2013 9:45 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Today @ 2:46 PM
Points: 89, Visits: 181
Hi to all.
I write this topic because i need an help about MDX and how to use VB Functions to use together MDX.

My MDX Query example :



SELECT
([Marca_Modello].[Codice Merceologia].[All Marca_Modello].[MM0202xx])

ON COLUMNS,

[Measures].[Importo Venduto] ON ROWS

FROM Vendite

WHERE [Anno].[All Anno].[2012]


This query MDX works but i need to do more with VB Functions i think...
I'd like to do more because to hve members that begins with 'MI' that is...

([Marca_Modello].[Codice Merceologia].[All Marca_Modello].[MM0202xx])

--> Begins with word 'MI

So i'd like to have members ..like that.
MI01010
MI020304
MI
MI02
and not only equal to a string ....


Is this possibile with VB Functions ????

Any suggest or idea ???
Sorry first time i need that...using MDX.

Good week to all members of this wonderful Forum

Post #1415024
Posted Sunday, February 3, 2013 2:57 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Monday, January 13, 2014 7:34 AM
Points: 117, Visits: 499
Try something like


with set [MIs] as
Filter([Marca_Modello].[Codice Merceologia].Members
,Left([Marca_Modello].[Codice Merceologia].[All Marca_Modello].CurrentMember.Name,2) = "MI")


SELECT
[MIs]
ON COLUMNS,

[Measures].[Importo Venduto] ON ROWS

FROM Vendite

WHERE [Anno].[All Anno].[2012]


Mack
Post #1415060
Posted Monday, February 4, 2013 10:14 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Today @ 2:46 PM
Points: 89, Visits: 181
Thanks MACK very kind of you !!!
I test immediately...i read about LEFT VBA FUNCTION but i was not able to understand to use properties Name.
I have to put that set in a Excel 2013.
Will see..wait for my response.

However THANKS A LOT !!!!
Post #1415394
Posted Monday, February 4, 2013 12:18 PM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Today @ 2:46 PM
Points: 89, Visits: 181
Ciao Mackers...sorry if i disturb you again.
I tested your set but i receive an error that tell that:
i TRANSLATE from italian,...

IT IS EXPECTED A HIERARCHY EXPRESSION INSTEAD YOU DID A MEMBER EXPRESSION...

So i discover with your help , the error...

Syntax correct is without .[All Marca_Modello] ...(you could not know extacly my dimensions and their attributes ) that is...:


with set [MIs] as
Filter([Marca_Modello].[Codice Merceologia].Members
,Left([Marca_Modello].[Codice Merceologia].CurrentMember.Name,2) = "MI")


SELECT
[MIs]
ON COLUMNS,

[Measures].[Importo Venduto] ON ROWS

FROM Vendite

WHERE [Anno].[All Anno].[2012]


Sincere thankings to you... !!!!!!!!!!!!

PS. Now i know i have to use also VB Functions....with MDX...

Thanks again...
Post #1415453
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse