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

Create a member that returns previous year and january month

Started by oscarca, 08 Apr 2020 06:25:01 AM

Previous topic - Next topic

oscarca

I would like to create a member that returns current year and January dynamically.

I have created the following which works great:
Current Period (yyyyMM)

#'[GeneralLedger_CostFollowUp].[Time].[Year-Month-Day].[Period]->:[M17].[[Time]].[Year-Month-Day]].[Period]].&['+
timestampMask($current_timestamp,'yyyy')
+
timestampMask($current_timestamp,'mm')
+']]]'#


Now I would like to create Previous year and January month for example 201901:

#'[GeneralLedger_CostFollowUp].[Time].[Year-Month-Day].[Period]->:[M17].[[Time]].[Year-Month-Day]].[Period]].&['+
timestampMask(_add_years($current_timestamp,-1),'yyyy')
+
timestampMask(_add_days($current_timestamp,(_day_of_year($current_timestamp) * -1) + 1),'mm')
+']]]'#


But I am stuck with the following error:
XQE-CON-0007 XQE error encountered: MacroException - a parsing error was encountered in the macro.
Encountered: "(" at line 4, column 44.
Was expecting one of:
    <INTEGER_LITERAL> ...
    <STRING_LITERAL> ...
    "$" ...
    "%" ...
    "@" ...
    "[" ...
    "{" ...
    <IDENTIFIER> ...
Text to expand:
#'[GeneralLedger_CostFollowUp].[Time].[Year-Month-Day].[Period]->:[M17].[[Time]].[Year-Month-Day]].[Period]].&['+
timestampMask(_add_years($current_timestamp,-1),'yyyy')
+
timestampMask(_add_days($current_timestamp,(_day_of_year($current_timestamp) * -1) + 1),'mm')
+']]]'#

Best regards,
Oscar


oscarca

Solved it with a less pretty solution:

#'[GeneralLedger_CostFollowUp].[Time].[Year-Month-Day].[Period]->:[M17].[[Time]].[Year-Month-Day]].[Period]].&['+
timestampMask(_add_years($current_timestamp,-1),'yyyy')
+
01
+']]]'#