SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


MDX and VB FUNCTIONS ---


MDX and VB FUNCTIONS ---

Author
Message
maretix
maretix
Old Hand
Old Hand (327 reputation)Old Hand (327 reputation)Old Hand (327 reputation)Old Hand (327 reputation)Old Hand (327 reputation)Old Hand (327 reputation)Old Hand (327 reputation)Old Hand (327 reputation)

Group: General Forum Members
Points: 327 Visits: 234
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
Mackers
Mackers
SSC Veteran
SSC Veteran (245 reputation)SSC Veteran (245 reputation)SSC Veteran (245 reputation)SSC Veteran (245 reputation)SSC Veteran (245 reputation)SSC Veteran (245 reputation)SSC Veteran (245 reputation)SSC Veteran (245 reputation)

Group: General Forum Members
Points: 245 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
maretix
maretix
Old Hand
Old Hand (327 reputation)Old Hand (327 reputation)Old Hand (327 reputation)Old Hand (327 reputation)Old Hand (327 reputation)Old Hand (327 reputation)Old Hand (327 reputation)Old Hand (327 reputation)

Group: General Forum Members
Points: 327 Visits: 234
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 !!!!
maretix
maretix
Old Hand
Old Hand (327 reputation)Old Hand (327 reputation)Old Hand (327 reputation)Old Hand (327 reputation)Old Hand (327 reputation)Old Hand (327 reputation)Old Hand (327 reputation)Old Hand (327 reputation)

Group: General Forum Members
Points: 327 Visits: 234
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...
:-)
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search