![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
entered in the dimension editor - you need to * alter the code below so it uses the syntax of your time dimension * perhaps change the logic - if you just want it to use today it will be a lot simpler - below it chooses previous month -- year strtomember("Tid.["+iif(month(now())=1,ltrim(str(Year(Now ())-1)),ltrim(str(Y ear(now()))))+"]." -- quarter +"[Kvartal " + iif(month(now())=1,"4].",iif(Month(now())<=4,"1].",iif (month(now())<=7,"2]." ,iif(month(now())<=10,"3].","4]."))))+ -- month "["+iif(month(now())=1,"December",iif(month(now( )) =2,"Januar",iif(month(now( ))=3,"Februar",iif(month(now())=4,"Marts",iif(mont h(now()) =5,"April",iif(mon th(now())=6,"Maj",iif(month(now())=7,"Juni",iif(mo nth(now ())=8,"Juli",iif(mo nth(now())=9,"August",iif(month(now())=10,"Septemb er",iif (month(now())=11,"O ktober","November")))))))))))+"]") Hope it helps....couldn't use it myself yet because my front end didn't support it. Michael Vardinghus |
|
all I'd really appreciate it if someone can help out with some mdx needed in order to specify the default member from the time dimension - i need this to be the latest /current month - imagine a 'snapshot month' dimension.. thre users would like to see the current snapshot month and not, by default, any others.. If I have 2 dims - one for year and one for month the same type of code is applicable presumably? many thanks Darren |
#3
| |||
| |||
|
|
Posted this to another one some time ago: Don't know if this is what you're looking for. Sorry bout the danish - used default member mdx sentence which is to be entered in the dimension editor - you need to * alter the code below so it uses the syntax of your time dimension * perhaps change the logic - if you just want it to use today it will be a lot simpler - below it chooses previous month -- year strtomember("Tid.["+iif(month(now())=1,ltrim(str(Year(Now ())-1)),ltrim(str(Y ear(now()))))+"]." -- quarter +"[Kvartal " + iif(month(now())=1,"4].",iif(Month(now())<=4,"1].",iif (month(now())<=7,"2]." ,iif(month(now())<=10,"3].","4]."))))+ -- month "["+iif(month(now())=1,"December",iif(month(now( )) =2,"Januar",iif(month(now( ))=3,"Februar",iif(month(now())=4,"Marts",iif(mont h(now()) =5,"April",iif(mon th(now())=6,"Maj",iif(month(now())=7,"Juni",iif(mo nth(now ())=8,"Juli",iif(mo nth(now())=9,"August",iif(month(now())=10,"Septemb er",iif (month(now())=11,"O ktober","November")))))))))))+"]") Hope it helps....couldn't use it myself yet because my front end didn't support it. Michael Vardinghus However ... don't understand why you have two dimensions... "Darren Drysdale" <darrend (AT) hotmail (DOT) com> skrev i en meddelelse news:%23kh23hmNEHA.1392 (AT) TK2MSFTNGP09 (DOT) phx.gbl... all I'd really appreciate it if someone can help out with some mdx needed in order to specify the default member from the time dimension - i need this to be the latest /current month - imagine a 'snapshot month' dimension.. thre users would like to see the current snapshot month and not, by default, any others.. If I have 2 dims - one for year and one for month the same type of code is applicable presumably? many thanks Darren |
#4
| |||
| |||
|
|
))=3,"February",iif(month(now())=4,"Marts",iif(mon th(now()) |
|
An extra comment.. the sentence above uses date functions and by strtomember merges these together to get a time-dimension selection. Here is an example of what my time dimension members look like: [Tid].[2004].[Kvartal 2].[april] As stated below you need to alter the sentence to hit the syntax of your time dimension (the whole sentence is to be throwed into the formula of the time dimension). "Michael Vardinghus" <michaelvardinghus (AT) hotmail (DOT) com> skrev i en meddelelse news:OEgj%23qmNEHA.2976 (AT) TK2MSFTNGP10 (DOT) phx.gbl... Posted this to another one some time ago: Don't know if this is what you're looking for. Sorry bout the danish - used default member mdx sentence which is to be entered in the dimension editor - you need to * alter the code below so it uses the syntax of your time dimension * perhaps change the logic - if you just want it to use today it will be a lot simpler - below it chooses previous month -- year strtomember("Tid.["+iif(month(now())=1,ltrim(str(Year(Now ())-1)),ltrim(str(Y ear(now()))))+"]." -- quarter +"[Kvartal " + iif(month(now())=1,"4].",iif(Month(now())<=4,"1].",iif (month(now())<=7,"2]." ,iif(month(now())<=10,"3].","4]."))))+ -- month "["+iif(month(now())=1,"December",iif(month(now( )) =2,"Januar",iif(month(now( ))=3,"Februar",iif(month(now())=4,"Marts",iif(mont h(now()) =5,"April",iif(mon th(now())=6,"Maj",iif(month(now())=7,"Juni",iif(mo nth(now ())=8,"Juli",iif(mo nth(now())=9,"August",iif(month(now())=10,"Septemb er",iif (month(now())=11,"O ktober","November")))))))))))+"]") Hope it helps....couldn't use it myself yet because my front end didn't support it. Michael Vardinghus However ... don't understand why you have two dimensions... "Darren Drysdale" <darrend (AT) hotmail (DOT) com> skrev i en meddelelse news:%23kh23hmNEHA.1392 (AT) TK2MSFTNGP09 (DOT) phx.gbl... all I'd really appreciate it if someone can help out with some mdx needed in order to specify the default member from the time dimension - i need this to be the latest /current month - imagine a 'snapshot month' dimension.. thre users would like to see the current snapshot month and not, by default, any others.. If I have 2 dims - one for year and one for month the same type of code is applicable presumably? many thanks Darren |
#5
| |||
| |||
|
|
Michael thanks for that - I have 2 dims - one just months and one just years - to allow for cross tabbing the 2 (using BusinessObjects Webi OLAP) I can just use the year and month parts of the code independently? e.g. Year strtomember("year.["+iif(month(now())=1,ltrim(str(Year(Now())-1)),ltrim(str( Year(now()))))+"] Month iif(month(now())=1,"December",iif(month(now()) =2,"January",iif(month(now( ))=3,"February",iif(month(now())=4,"Marts",iif(mon th(now()) =5,"April",iif(month(now())=6,"May",iif(month(now( ))=7,"June",iif(month(now ())=8,"July",iif(month(now())=9,"August",iif(month (now())=10,"September",iif (month(now())=11,"October","November")))))))))))+" ]") Also, what does the 'Marts' refer to on line 3 above? many thanks Darren "Michael Vardinghus" <michaelvardinghus (AT) hotmail (DOT) com> wrote in message news:%236HUswmNEHA.2468 (AT) TK2MSFTNGP11 (DOT) phx.gbl... An extra comment.. the sentence above uses date functions and by strtomember merges these together to get a time-dimension selection. Here is an example of what my time dimension members look like: [Tid].[2004].[Kvartal 2].[april] As stated below you need to alter the sentence to hit the syntax of your time dimension (the whole sentence is to be throwed into the formula of the time dimension). "Michael Vardinghus" <michaelvardinghus (AT) hotmail (DOT) com> skrev i en meddelelse news:OEgj%23qmNEHA.2976 (AT) TK2MSFTNGP10 (DOT) phx.gbl... Posted this to another one some time ago: Don't know if this is what you're looking for. Sorry bout the danish - used default member mdx sentence which is to be entered in the dimension editor - you need to * alter the code below so it uses the syntax of your time dimension * perhaps change the logic - if you just want it to use today it will be a lot simpler - below it chooses previous month -- year strtomember("Tid.["+iif(month(now())=1,ltrim(str(Year(Now ())-1)),ltrim(str(Y ear(now()))))+"]." -- quarter +"[Kvartal " + iif(month(now())=1,"4].",iif(Month(now())<=4,"1].",iif (month(now())<=7,"2]." ,iif(month(now())<=10,"3].","4]."))))+ -- month "["+iif(month(now())=1,"December",iif(month(now( )) =2,"Januar",iif(month(now( ))=3,"Februar",iif(month(now())=4,"Marts",iif(mont h(now()) =5,"April",iif(mon th(now())=6,"Maj",iif(month(now())=7,"Juni",iif(mo nth(now ())=8,"Juli",iif(mo nth(now())=9,"August",iif(month(now())=10,"Septemb er",iif (month(now())=11,"O ktober","November")))))))))))+"]") Hope it helps....couldn't use it myself yet because my front end didn't support it. Michael Vardinghus However ... don't understand why you have two dimensions... "Darren Drysdale" <darrend (AT) hotmail (DOT) com> skrev i en meddelelse news:%23kh23hmNEHA.1392 (AT) TK2MSFTNGP09 (DOT) phx.gbl... all I'd really appreciate it if someone can help out with some mdx needed in order to specify the default member from the time dimension - i need this to be the latest /current month - imagine a 'snapshot month' dimension.. thre users would like to see the current snapshot month and not, by default, any others.. If I have 2 dims - one for year and one for month the same type of code is applicable presumably? many thanks Darren |
#6
| |||
| |||
|
|
I would think that the would work indepently...and sorry bout the danish - can see in my code I made an odd combination of month names in english and danish...Marts should be March - sorry. But are your months named by month name or month number ? If number you don't have to translate to month name like i do below. \Michael Vardinghus "Darren Drysdale" <darrend (AT) hotmail (DOT) com> skrev i en meddelelse news:eQ00x9mNEHA.3312 (AT) tk2msftngp13 (DOT) phx.gbl... Michael thanks for that - I have 2 dims - one just months and one just years - to allow for cross tabbing the 2 (using BusinessObjects Webi OLAP) I can just use the year and month parts of the code independently? e.g. Year strtomember("year.["+iif(month(now())=1,ltrim(str(Year(Now())-1)),ltrim(str( Year(now()))))+"] Month iif(month(now())=1,"December",iif(month(now()) =2,"January",iif(month(now( ))=3,"February",iif(month(now())=4,"Marts",iif(mon th(now()) =5,"April",iif(month(now())=6,"May",iif(month(now( ))=7,"June",iif(month(now ())=8,"July",iif(month(now())=9,"August",iif(month (now())=10,"September",iif (month(now())=11,"October","November")))))))))))+" ]") Also, what does the 'Marts' refer to on line 3 above? many thanks Darren "Michael Vardinghus" <michaelvardinghus (AT) hotmail (DOT) com> wrote in message news:%236HUswmNEHA.2468 (AT) TK2MSFTNGP11 (DOT) phx.gbl... An extra comment.. the sentence above uses date functions and by strtomember merges these together to get a time-dimension selection. Here is an example of what my time dimension members look like: [Tid].[2004].[Kvartal 2].[april] As stated below you need to alter the sentence to hit the syntax of your time dimension (the whole sentence is to be throwed into the formula of the time dimension). "Michael Vardinghus" <michaelvardinghus (AT) hotmail (DOT) com> skrev i en meddelelse news:OEgj%23qmNEHA.2976 (AT) TK2MSFTNGP10 (DOT) phx.gbl... Posted this to another one some time ago: Don't know if this is what you're looking for. Sorry bout the danish - used default member mdx sentence which is to be entered in the dimension editor - you need to * alter the code below so it uses the syntax of your time dimension * perhaps change the logic - if you just want it to use today it will be a lot simpler - below it chooses previous month -- year strtomember("Tid.["+iif(month(now())=1,ltrim(str(Year(Now ())-1)),ltrim(str(Y ear(now()))))+"]." -- quarter +"[Kvartal " + iif(month(now())=1,"4].",iif(Month(now())<=4,"1].",iif (month(now())<=7,"2]." ,iif(month(now())<=10,"3].","4]."))))+ -- month "["+iif(month(now())=1,"December",iif(month(now( )) =2,"Januar",iif(month(now( ))=3,"Februar",iif(month(now())=4,"Marts",iif(mont h(now()) =5,"April",iif(mon th(now())=6,"Maj",iif(month(now())=7,"Juni",iif(mo nth(now ())=8,"Juli",iif(mo nth(now())=9,"August",iif(month(now())=10,"Septemb er",iif (month(now())=11,"O ktober","November")))))))))))+"]") Hope it helps....couldn't use it myself yet because my front end didn't support it. Michael Vardinghus However ... don't understand why you have two dimensions... "Darren Drysdale" <darrend (AT) hotmail (DOT) com> skrev i en meddelelse news:%23kh23hmNEHA.1392 (AT) TK2MSFTNGP09 (DOT) phx.gbl... all I'd really appreciate it if someone can help out with some mdx needed in order to specify the default member from the time dimension - i need this to be the latest /current month - imagine a 'snapshot month' dimension.. thre users would like to see the current snapshot month and not, by default, any others.. If I have 2 dims - one for year and one for month the same type of code is applicable presumably? many thanks Darren |
#7
| |||
| |||
|
|
Michael the months are using the name.. The code will be as follows:?? iif(month(now())="December",iif(month(now()) ="January",iif(month(now())="February",iif(month(n ow())="March" . etc etc or can i just use something like month(now()) similar to using month = convert(month,getdate()) in SQL..? sorry for being slow!.. "Michael Vardinghus" <michaelvardinghus (AT) hotmail (DOT) com> wrote in message news:u2rHSFnNEHA.2708 (AT) TK2MSFTNGP10 (DOT) phx.gbl... I would think that the would work indepently...and sorry bout the danish - can see in my code I made an odd combination of month names in english and danish...Marts should be March - sorry. But are your months named by month name or month number ? If number you don't have to translate to month name like i do below. \Michael Vardinghus "Darren Drysdale" <darrend (AT) hotmail (DOT) com> skrev i en meddelelse news:eQ00x9mNEHA.3312 (AT) tk2msftngp13 (DOT) phx.gbl... Michael thanks for that - I have 2 dims - one just months and one just years - to allow for cross tabbing the 2 (using BusinessObjects Webi OLAP) I can just use the year and month parts of the code independently? e.g. Year strtomember("year.["+iif(month(now())=1,ltrim(str(Year(Now())-1)),ltrim(str( Year(now()))))+"] Month iif(month(now())=1,"December",iif(month(now()) =2,"January",iif(month(now( ))=3,"February",iif(month(now())=4,"Marts",iif(mon th(now()) =5,"April",iif(month(now())=6,"May",iif(month(now( ))=7,"June",iif(month(now ())=8,"July",iif(month(now())=9,"August",iif(month (now())=10,"September",iif (month(now())=11,"October","November")))))))))))+" ]") Also, what does the 'Marts' refer to on line 3 above? many thanks Darren "Michael Vardinghus" <michaelvardinghus (AT) hotmail (DOT) com> wrote in message news:%236HUswmNEHA.2468 (AT) TK2MSFTNGP11 (DOT) phx.gbl... An extra comment.. the sentence above uses date functions and by strtomember merges these together to get a time-dimension selection. Here is an example of what my time dimension members look like: [Tid].[2004].[Kvartal 2].[april] As stated below you need to alter the sentence to hit the syntax of your time dimension (the whole sentence is to be throwed into the formula of the time dimension). "Michael Vardinghus" <michaelvardinghus (AT) hotmail (DOT) com> skrev i en meddelelse news:OEgj%23qmNEHA.2976 (AT) TK2MSFTNGP10 (DOT) phx.gbl... Posted this to another one some time ago: Don't know if this is what you're looking for. Sorry bout the danish - used default member mdx sentence which is to be entered in the dimension editor - you need to * alter the code below so it uses the syntax of your time dimension * perhaps change the logic - if you just want it to use today it will be a lot simpler - below it chooses previous month -- year strtomember("Tid.["+iif(month(now())=1,ltrim(str(Year(Now ())-1)),ltrim(str(Y ear(now()))))+"]." -- quarter +"[Kvartal " + iif(month(now())=1,"4].",iif(Month(now())<=4,"1].",iif (month(now())<=7,"2]." ,iif(month(now())<=10,"3].","4]."))))+ -- month "["+iif(month(now())=1,"December",iif(month(now( )) =2,"Januar",iif(month(now( ))=3,"Februar",iif(month(now())=4,"Marts",iif(mont h(now()) =5,"April",iif(mon th(now())=6,"Maj",iif(month(now())=7,"Juni",iif(mo nth(now ())=8,"Juli",iif(mo nth(now())=9,"August",iif(month(now())=10,"Septemb er",iif (month(now())=11,"O ktober","November")))))))))))+"]") Hope it helps....couldn't use it myself yet because my front end didn't support it. Michael Vardinghus However ... don't understand why you have two dimensions... "Darren Drysdale" <darrend (AT) hotmail (DOT) com> skrev i en meddelelse news:%23kh23hmNEHA.1392 (AT) TK2MSFTNGP09 (DOT) phx.gbl... all I'd really appreciate it if someone can help out with some mdx needed in order to specify the default member from the time dimension - i need this to be the latest /current month - imagine a 'snapshot month' dimension.. thre users would like to see the current snapshot month and not, by default, any others.. If I have 2 dims - one for year and one for month the same type of code is applicable presumably? many thanks Darren |
#8
| |||
| |||
|
|
all I'd really appreciate it if someone can help out with some mdx needed in order to specify the default member from the time dimension - i need this to be the latest /current month - imagine a 'snapshot month' dimension.. thre users would like to see the current snapshot month and not, by default, any others.. If I have 2 dims - one for year and one for month the same type of code is applicable presumably? many thanks Darren |
#9
| |||
| |||
|
|
"Darren Drysdale" <darrend (AT) hotmail (DOT) com> schrieb im Newsbeitrag news:%23kh23hmNEHA.1392 (AT) TK2MSFTNGP09 (DOT) phx.gbl... all I'd really appreciate it if someone can help out with some mdx needed in order to specify the default member from the time dimension - i need this to be the latest /current month - imagine a 'snapshot month' dimension.. thre users would like to see the current snapshot month and not, by default, any others.. If I have 2 dims - one for year and one for month the same type of code is applicable presumably? many thanks Darren You can also use VBA!Date() in MDX with some formattings instead of Now() to create the month-name. Regards, Matthias |
#10
| |||
| |||
|
|
Michael i tried the code but the usually friendly sytax error came up.. I tried usign Foodmart but no joy - the dim is called Time which i changed and renamed all the names 9e.g. Month names) to English My real date dimension is called calendar but I thought I'd try with Foodmart first.. any help really appreciated!! DD "Matthias Englert" <menglert_news_nospam (AT) hotmail (DOT) com> wrote in message news:OQ9k7vyNEHA.2500 (AT) TK2MSFTNGP12 (DOT) phx.gbl... "Darren Drysdale" <darrend (AT) hotmail (DOT) com> schrieb im Newsbeitrag news:%23kh23hmNEHA.1392 (AT) TK2MSFTNGP09 (DOT) phx.gbl... all I'd really appreciate it if someone can help out with some mdx needed in order to specify the default member from the time dimension - i need this to be the latest /current month - imagine a 'snapshot month' dimension.. thre users would like to see the current snapshot month and not, by default, any others.. If I have 2 dims - one for year and one for month the same type of code is applicable presumably? many thanks Darren You can also use VBA!Date() in MDX with some formattings instead of Now() to create the month-name. Regards, Matthias |
![]() |
| Thread Tools | |
| Display Modes | |
| |