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

Issue when using _last_of Month in Macro to build current month

Started by cognos05, 15 Nov 2016 10:13:44 PM

Previous topic - Next topic

cognos05

Hi ,

This is my Member Unique name for current month,
[Global Sales].[Time Period].[Time Period].[Months]->:[PC].[@MEMBER].[20161101-20161130]

my macro expression used to build this ,

#'[Global Sales].[Time Period].[Time Period].[Months]->:[PC].[@MEMBER].[' + timestampMask(_first_of_month($current_timestamp),'yyyymmdd')+ '-' + timestampMask(_last_of_month($current_timestamp),'yyyymmdd')  + ']'#

This code was working fine and suddenly breaks in some days.

When debugged

#_last_of_month($current_timestamp)# this is returning

2016-11-29 22:39:37346000000

which should be 30 th and not 29th

Also I checked

#$current_timestamp#
2016-11-15 22:34:51.646000000

Now I dont know why last of month is giving 29.

I tried changing the expression little differently by putting the
_last_of_month (#$current_timestamp#)
and now it returned correct value
2016-11-30 22:41:16.297000000

not sure what makes the difference if I just have the macro for current timestamp.

If I have to use this now _last_of_month (#$current_timestamp#)
how do I substitute in my original expression
#'[Global Sales].[Time Period].[Time Period].[Months]->:[PC].[@MEMBER].[' + timestampMask(_first_of_month($current_timestamp),'yyyymmdd')+ '-' + timestampMask(_last_of_month($current_timestamp),'yyyymmdd')  + ']'#

Please provide your suggestions, I am not sure why the issue is caused

Thanks,
Nithya
 






cognos05

Has anyone has any suggestion on this
#_last_of_month($current_timestamp)# this is returning

2016-11-29 22:39:37346000000

I tried changing the expression little differently by putting the
_last_of_month (#$current_timestamp#)
and now it returned correct value
2016-11-30 22:41:16.297000000

How to use this in below expression ,

#'[Global Sales].[Time Period].[Time Period].[Months]->:[PC].[@MEMBER].[' + timestampMask(_first_of_month($current_timestamp),'yyyymmdd')+ '-' + timestampMask(_last_of_month($current_timestamp),'yyyymmdd')  + ']'#
'