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

MUN Error -breaking reports

Started by cognos05, 27 Jan 2015 10:00:29 PM

Previous topic - Next topic

cognos05

Hi,

I was using the below code for dynamically select the month member..Suddenly from yesterday it gives me the last of month for january as 30 instead of 31..

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


Error :Member [20150101-20150130] doesnot exist

_last_of_month is giving 20150130 instead of 20150131.

Please suggest me an alternate code to get the last day of month as 20150131.I have to fix my reports which selects default month using this macro.

You can execute last of month and check if you still get 30. I am not sure with whom the bug is either the macro or current timestamp.

Thanks,
Nithya


MFGF

Quote from: nithya1224 on 27 Jan 2015 10:00:29 PM
Hi,

I was using the below code for dynamically select the month member..Suddenly from yesterday it gives me the last of month for january as 30 instead of 31..

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


Error :Member [20150101-20150130] doesnot exist

_last_of_month is giving 20150130 instead of 20150131.

Please suggest me an alternate code to get the last day of month as 20150131.I have to fix my reports which selects default month using this macro.

You can execute last of month and check if you still get 30. I am not sure with whom the bug is either the macro or current timestamp.

Thanks,
Nithya

What debugging have you tried? If you're not sure whether the issue is with your macro or with the value in current_timestamp, why wouldn't you build a test report to find out? It's not an obvious thing where someone can say "you did this wrong" since the syntax has been working fine for a while.

What is current_timestamp returning currently? The only person on Cognoise who can find out in your Cognos instance is you. We will help if we can, but you're going to have to do some investigation work to see what's going on.

Cheers!

MF.
Meep!

cognos05

I tried _last_of_month($current_timestamp),'yyyymmdd')

Executing above statement and it returned 20150130 instead of 20150131.

Current timestamp gave me the current date.

So Yesterday night  I changed all my reports to select a default member instead of Dynamic member,

but now I get the value as 20150131 . I seriously dont understand what had happened,

Thanks,
Nithya

MFGF

Quote from: nithya1224 on 28 Jan 2015 07:51:41 AM
I tried _last_of_month($current_timestamp),'yyyymmdd')

Executing above statement and it returned 20150130 instead of 20150131.

Current timestamp gave me the current date.

So Yesterday night  I changed all my reports to select a default member instead of Dynamic member,

but now I get the value as 20150131 . I seriously dont understand what had happened,

Thanks,
Nithya

So it has gone back to working ok today? That's very strange. I have no clue why this might be happening.

MF.
Meep!

cognos05

But if its a bug with last of month, then should i use a different function to get the value, I don want this to happen again.May be I will check on this for few days.

cognos05

#5
Hi All,

This bug has started again, when I open the report through vpn from home ,I get this error.

But when the same is opened from office i dont have any issues.
_last_of_month($current_timestamp),'yyyymmdd')   giving 28 for feb instead of 29.

I ran it at 10:52pm on feb 9 th
currenttimestamp values is showing correct -2016-02-09 22:52:19.292000000
last of month - value is showing 2016-02-28 22:52:19.292000000
but it should give me 2016-02-29 right,
[20160201-20160228] does not exist.

#'[1SaleCube].[Months].[Months].[Month]->:[PC].[@MEMBER].['+timestampMask(_first_of_month($current_timestamp),'yyyymmdd')+ '-' + timestampMask(_last_of_month($current_timestamp),'yyyymmdd') + ']'#


But working in office.  Not able to guess ,but think its because of vpn connection or something

SO whenever I use the member in the layout it throws me the error.

Is there any alternate for Lastofmonth

Thanks,
Nithya

BigChris

When you look at the SQL for your query you should see something that looks something like this:

DATEADD( DAY, -1, DATEADD( MONTH, 1, DATEADD( DAY, -DAY( convert(datetime, convert( char(8),
current_timestamp, 112 ), 112) ) + 1, convert(datetime, convert( char(8), current_timestamp, 112 ), 112) ) ) ) AS "End_of_Month"


Can you check that you're getting the same statement both in your office and over your VPN?