If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Caption in prompt macro

Started by Ammus1234, 18 Jul 2014 04:07:17 AM

Previous topic - Next topic

Ammus1234

Hello All,

I am trying to get the caption of a member in slicer for creating a default value. I want the caption of
[Sales].[Time].[Month].[Month]->:[M8].[Time].[Month].&[Current Month] in below expression.

#prompt('Month','mun','[Sales].[Time].[Time].[Month]->:[M8].[Time].[Time].&['+sq(caption([Sales].[Time].[Month].[Month]->:[M8].[Time].[Month].&[Current Month]))+']')#

The above expression gives me an error

XQE-PLN-0001 Internal error. The query could not be planned by the Query Service:
MacroException - a parsing error was encountered in the macro:
Encountered "(" at line 1, column 97.
Was expecting one of:
<INTEGER_LITERAL> ...
<STRING_LITERAL> ...
"$" ...
"%" ...
"@" ...
"case" ...
<IDENTIFIER

Can someone help?

navissar

Hmm. What is the caption of the current month member supposed to be? Is it something like "2014/Jul"? Because if it is, you could probably create that by manipulation $current_timestamp using only macro functions - I could help with that.

Ammus1234

The problem is month used is fiscal month. So I can't calculate directly from $current_timestamp.
So I thought of including it as another attribute and use it in creating the default member.
The caption is like 201408.

navissar

Quote from: Ammus1234 on 19 Jul 2014 12:55:32 AM
The problem is month used is fiscal month. So I can't calculate directly from $current_timestamp.

... I beg to differ. Usually, the gap between fiscal and calendar month is set. So if, for instance, fiscal year is June through May, there's a constant 5 months difference between calendar and fiscal month. So July, for instance, is the 2nd month fiscal and the 7 month calendar, so reducing 5 months from current timestamp will give the numeric value of the fiscal month. This can be achieved in  a macro function easily.

Ammus1234

Actually the problem is starting and ending of fiscal month is not same as calendar month. So I can't give a constant as a difference.
As a result, in one calendar month there can be two fiscal month. Hope you understand the issue.

navissar

Sure do. What's the day divider? When in a calendar month does a fiscal month change? I think I can write an expression to match that.

Ammus1234

Start date and end date is different in different months.
In 2014 first month is from 26/10/13 to 29/11/13. Second month from 30/11/13 to 27/12/13.
So there is no definite pattern.

Since it was urgent, I did a workaround. I modified the key of current month as 'Current Month' and used the MUN to get the default value in prompt. But I suspect this will affect the performance of the cube. May be I will use it till I find another solution.