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
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
+']]]'#