SQLServerCentral.com / Analysis Services / Data Warehousing / MDX and VB FUNCTIONS --- / Latest PostsInstantForum.NET v2.9.0SQLServerCentral.comhttp://www.sqlservercentral.com/Forums/notifications@sqlservercentral.comTue, 31 Mar 2015 15:26:25 GMT20RE: MDX and VB FUNCTIONS ---http://www.sqlservercentral.com/Forums/Topic1415024-17-1.aspxCiao 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] asFilter([Marca_Modello].[Codice Merceologia].Members,Left([Marca_Modello].[Codice Merceologia].CurrentMember.Name,2) = "MI")SELECT[MIs]ON COLUMNS,[Measures].[Importo Venduto] ON ROWSFROM VenditeWHERE [Anno].[All Anno].[2012][b]Sincere thankings to you... !!!!!!!!!!!![/b]PS. Now i know i have to use also VB Functions....with MDX...Thanks again...:-)Mon, 04 Feb 2013 12:18:50 GMTmaretixRE: MDX and VB FUNCTIONS ---http://www.sqlservercentral.com/Forums/Topic1415024-17-1.aspxThanks 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 !!!!Mon, 04 Feb 2013 10:14:35 GMTmaretixRE: MDX and VB FUNCTIONS ---http://www.sqlservercentral.com/Forums/Topic1415024-17-1.aspxTry something like[code="other"]with set [MIs] asFilter([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 ROWSFROM VenditeWHERE [Anno].[All Anno].[2012][/code]MackSun, 03 Feb 2013 14:57:45 GMTMackersMDX and VB FUNCTIONS ---http://www.sqlservercentral.com/Forums/Topic1415024-17-1.aspxHi 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 ROWSFROM VenditeWHERE [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]) --&gt; Begins with word 'MISo i'd like to have members ..like that.MI01010MI020304MIMI02and 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 ForumSun, 03 Feb 2013 09:45:46 GMTmaretix