Ive been trying to make a dynamic default for a prompt macro and keep running into various errors. Im working with TM1 cubes so Im trying to dynamically construct an MUN for the Year dimension. Basically I would like the default year to be the year of the current date. Unfortunatetly I cant get the default text of the prompt macro to work. Putting functions in this seems to keep resolving out as a string. When I put the string statement in a different query calculation and then attempt to reference that query item in the prompt macro I get standard "contains a reference to a query item that does not exist" even though it does.
Examples of what Im trying to do.
This works to create the dynamic MUN for the current year
[IT Capital App Spend].[IT Capital Year].[IT Capital Year]->:[TM].[IT Capital Year].[IT Capital Year].[@MEMBER].#sb(timestampMask($current_timestamp, 'yyyy'))#
This does not work
[IT Capital App Spend].[IT Capital Year].[IT Capital Year]->:[TM].[IT Capital Year].[IT Capital Year].[@MEMBER].#sb(prompt( 'p_Year', 'token', 'cast(extract(year, current_date), char(4))' ))#
Neither does this
[IT Capital App Spend].[IT Capital Year].[IT Capital Year]->:[TM].[IT Capital Year].[IT Capital Year].[@MEMBER].#sb(prompt( 'p_Year', 'token', 'cast(timestampMask($current_timestamp, 'yyyy'), char(4))' ))#
Neither does this where I have taken the first working statement and put it into a query item
#prompt('p_Year', 'token', '', '', '[default_year]')#
Hi
Did you get this to work? Im doing the exact same thing
#'[Dimensional view].[Week].[Week].[Week]->[all].[' + prompt('WeekTo', 'token', '_week_of_year(current_timestamp)') +']'#
but the problem is that the function _week_of_year is not in the "macro function tab" and will not be recognized between the # #. So I want to get the week using only the macro functions... saw an article that this might be fixed in a fixpack but i cant verify that.
/Peter