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

How to set default value in dmr report

Started by inu, 02 Nov 2016 12:22:00 AM

Previous topic - Next topic

inu

Hi Team,

I am creating dmr report , where i use slicer filter for time as
[Agreement Fact - Monthly (Analysis)].[Time Dimension(Fiscal)].[Date].[Quarter]-> ?Par_From_MonthYear?
But i want to set the default date value as current date.
is it possible?




Regards,
Inam

MFGF

Quote from: inu on 02 Nov 2016 12:22:00 AM
Hi Team,

I am creating dmr report , where i use slicer filter for time as
[Agreement Fact - Monthly (Analysis)].[Time Dimension(Fiscal)].[Date].[Quarter]-> ?Par_From_MonthYear?
But i want to set the default date value as current date.
is it possible?




Regards,
Inam

Hi,

The expression you posted seems to be using the Quarter level from your hierarchy? Can you explain how it can make sense to use the current date as a default for a quarter-level member prompt?

Depending on the MUNs (Member Unique Names) of your members, it should be possible to swap the expression to a macro that builds the MUN and uses a prompt() macro function, setting the default to be the MUN of the member you want to use currently. We can't advise you on how to do this without knowing what the MUNs of your members look like, and also understanding how current date fits in with a prompt for quarters?

Cheers!

MF.
Meep!

inu

Quote from: MFGF on 02 Nov 2016 03:35:12 AM
Hi,

The expression you posted seems to be using the Quarter level from your hierarchy? Can you explain how it can make sense to use the current date as a default for a quarter-level member prompt?

Depending on the MUNs (Member Unique Names) of your members, it should be possible to swap the expression to a macro that builds the MUN and uses a prompt() macro function, setting the default to be the MUN of the member you want to use currently. We can't advise you on how to do this without knowing what the MUNs of your members look like, and also understanding how current date fits in with a prompt for quarters?

Cheers!

MF.

Thanks MF.

Path                                   -[Agreement Fact - Monthly (Analysis)].[Time Dimension(Fiscal)].[Date].[Quarter]->[all].[2015].[20154]
Ref                                   -[Agreement Fact - Monthly (Analysis)].[Time Dimension(Fiscal)].[Date].[Quarter]->[all].[2015].[20154]
Member Caption           -Qtr 4 2015
Member Unique Name   -[Agreement Fact - Monthly (Analysis)].[Time Dimension(Fiscal)].[Date].[Quarter]->[all].[2015].[20154]
Level Unique Name           -[Agreement Fact - Monthly (Analysis)].[Time Dimension(Fiscal)].[Date].[Quarter]
Hierarchy Unique Name   -[Agreement Fact - Monthly (Analysis)].[Time Dimension(Fiscal)].[Date]
Dimension Unique Name   -[Agreement Fact - Monthly (Analysis)].[Time Dimension(Fiscal)]
Level Number                   -   2
Parent Unique Name           -[Agreement Fact - Monthly (Analysis)].[Time Dimension(Fiscal)].[Date].[Year]->[all].[2015]

This is the hierarchy,,
I want to set the default value on quarter.



Regards,
Inam


MFGF

Quote from: inu on 02 Nov 2016 09:04:42 AM
Thanks MF.

Path                                   -[Agreement Fact - Monthly (Analysis)].[Time Dimension(Fiscal)].[Date].[Quarter]->[all].[2015].[20154]
Ref                                   -[Agreement Fact - Monthly (Analysis)].[Time Dimension(Fiscal)].[Date].[Quarter]->[all].[2015].[20154]
Member Caption           -Qtr 4 2015
Member Unique Name   -[Agreement Fact - Monthly (Analysis)].[Time Dimension(Fiscal)].[Date].[Quarter]->[all].[2015].[20154]
Level Unique Name           -[Agreement Fact - Monthly (Analysis)].[Time Dimension(Fiscal)].[Date].[Quarter]
Hierarchy Unique Name   -[Agreement Fact - Monthly (Analysis)].[Time Dimension(Fiscal)].[Date]
Dimension Unique Name   -[Agreement Fact - Monthly (Analysis)].[Time Dimension(Fiscal)]
Level Number                   -   2
Parent Unique Name           -[Agreement Fact - Monthly (Analysis)].[Time Dimension(Fiscal)].[Date].[Year]->[all].[2015]

This is the hierarchy,,
I want to set the default value on quarter.



Regards,
Inam

Replace your slicer filter with the following macro:

#prompt('Par_From_MonthYear','token','[Agreement Fact - Monthly (Analysis)].[Time Dimension(Fiscal)].[Date].[Quarter]->[all].['+timestampMask ($current_timestamp,'yyyy')+'].['+timestampMask ($current_timestamp,'yyyy')+substitute('''','',substitute('''-','',substitute(timestampMask ($current_timestamp,'mm'),'',csv(grep(timestampMask ($current_timestamp,'mm'),array('01-1','02-1','03-1','04-2','05-2','06-2','07-3','08-3','09-3','10-4','11-4','12-4'))))))+']')#

Keep the existing prompt based on the quarter level and returning a value into the Par_From_MonthYear parameter.

Cheers!

MF.
Meep!

inu

Quote from: MFGF on 02 Nov 2016 10:18:55 AM
Replace your slicer filter with the following macro:

#prompt('Par_From_MonthYear','token','[Agreement Fact - Monthly (Analysis)].[Time Dimension(Fiscal)].[Date].[Quarter]->[all].['+timestampMask ($current_timestamp,'yyyy')+'].['+timestampMask ($current_timestamp,'yyyy')+substitute('''','',substitute('''-','',substitute(timestampMask ($current_timestamp,'mm'),'',csv(grep(timestampMask ($current_timestamp,'mm'),array('01-1','02-1','03-1','04-2','05-2','06-2','07-3','08-3','09-3','10-4','11-4','12-4'))))))+']')#

Keep the existing prompt based on the quarter level and returning a value into the Par_From_MonthYear parameter.

Cheers!

MF.


Thanks MF. I honestly thankful to you, you gave time to write such a complicated codes.
I used the above statement , still when i run the report, prompt page displays and asks to enter the value for quarter. It should not happen.My prompt is in report page itself.

Regards,
Inam

MFGF

Quote from: inu on 03 Nov 2016 02:07:09 AM

Thanks MF. I honestly thankful to you, you gave time to write such a complicated codes.
I used the above statement , still when i run the report, prompt page displays and asks to enter the value for quarter. It should not happen.My prompt is in report page itself.

Regards,
Inam

That's because you haven't defined a default selection for your prompt, I assume? Go to the properties of the prompt on your report page, find the Default Selections property, and add a default selection value for the prompt as the macro below:

#'[Agreement Fact - Monthly (Analysis)].[Time Dimension(Fiscal)].[Date].[Quarter]->[all].['+timestampMask ($current_timestamp,'yyyy')+'].['+timestampMask ($current_timestamp,'yyyy')+substitute('''','',substitute('''-','',substitute(timestampMask ($current_timestamp,'mm'),'',csv(grep(timestampMask ($current_timestamp,'mm'),array('01-1','02-1','03-1','04-2','05-2','06-2','07-3','08-3','09-3','10-4','11-4','12-4'))))))+']'#

This will put the current quarter member in as the default selection for the prompt.

Cheers!

MF.
Meep!

inu

Quote from: MFGF on 03 Nov 2016 03:30:33 AM
That's because you haven't defined a default selection for your prompt, I assume? Go to the properties of the prompt on your report page, find the Default Selections property, and add a default selection value for the prompt as the macro below:

#'[Agreement Fact - Monthly (Analysis)].[Time Dimension(Fiscal)].[Date].[Quarter]->[all].['+timestampMask ($current_timestamp,'yyyy')+'].['+timestampMask ($current_timestamp,'yyyy')+substitute('''','',substitute('''-','',substitute(timestampMask ($current_timestamp,'mm'),'',csv(grep(timestampMask ($current_timestamp,'mm'),array('01-1','02-1','03-1','04-2','05-2','06-2','07-3','08-3','09-3','10-4','11-4','12-4'))))))+']'#

This will put the current quarter member in as the default selection for the prompt.

Cheers!

MF.

Hi MF,

Error is throwing while running the report after setting default value for prompt as the macro above:

XQE-GEN-0005

      Found an internal error:
Index: 0, Size: 0
RSV-SRV-0042 Trace back:RSReportService.cpp(754): XQEException: CCL_CAUGHT: RSReportService::processImpl()RSReportServiceMethod.cpp(258): XQEException: CCL_RETHROW: RSReportServiceMethod::process(): asynchRunSpecification_RequestRSASyncExecutionThread.cpp(859): XQEException: RSASyncExecutionThread::checkExceptionRSASyncExecutionThread.cpp(314): XQEException: CCL_CAUGHT: RSASyncExecutionThread::runImpl(): asynchRunSpecification_RequestRSASyncExecutionThread.cpp(904): XQEException: CCL_RETHROW: RSASyncExecutionThread::processCommand():


Regards,
Inam


MFGF

Quote from: inu on 03 Nov 2016 04:37:25 AM
Hi MF,

Error is throwing while running the report after setting default value for prompt as the macro above:

XQE-GEN-0005

      Found an internal error:
Index: 0, Size: 0
RSV-SRV-0042 Trace back:RSReportService.cpp(754): XQEException: CCL_CAUGHT: RSReportService::processImpl()RSReportServiceMethod.cpp(258): XQEException: CCL_RETHROW: RSReportServiceMethod::process(): asynchRunSpecification_RequestRSASyncExecutionThread.cpp(859): XQEException: RSASyncExecutionThread::checkExceptionRSASyncExecutionThread.cpp(314): XQEException: CCL_CAUGHT: RSASyncExecutionThread::runImpl(): asynchRunSpecification_RequestRSASyncExecutionThread.cpp(904): XQEException: CCL_RETHROW: RSASyncExecutionThread::processCommand():


Regards,
Inam

Make sure you entered it all correctly. I tried this against my sample data and it works ok for me.

You might also try changing your slicer filter expression back to

[Agreement Fact - Monthly (Analysis)].[Time Dimension(Fiscal)].[Date].[Quarter]-> ?Par_From_MonthYear?

MF.
Meep!

inu

Quote from: MFGF on 03 Nov 2016 05:16:00 AM
Make sure you entered it all correctly. I tried this against my sample data and it works ok for me.

You might also try changing your slicer filter expression back to

[Agreement Fact - Monthly (Analysis)].[Time Dimension(Fiscal)].[Date].[Quarter]-> ?Par_From_MonthYear?

MF.

No, I used both in slicer filter, still getting error. see the attached image.
I just copied the given macro code and pasted in the default selection properties. I didnot modify....
I dont understand , why i am getting error.

Inam.

MFGF

Quote from: inu on 03 Nov 2016 05:49:17 AM
No, I used both in slicer filter, still getting error. see the attached image.
I just copied the given macro code and pasted in the default selection properties. I didnot modify....
I dont understand , why i am getting error.

Inam.

You have both expressions in the slicer filter at the same time? Not good. Use either one or the other, but not both at the same time.

MF.
Meep!

inu

Quote from: MFGF on 03 Nov 2016 06:15:12 AM
You have both expressions in the slicer filter at the same time? Not good. Use either one or the other, but not both at the same time.

MF.

I checked both indivisually as well, but error is coming from default selection code, when i remove that , i dont get error.
It might be some syntax error, if you have time , can you please look into the code which you sent me for default selection.



Regards,
Inam

MFGF

Quote from: inu on 03 Nov 2016 06:26:16 AM
I checked both indivisually as well, but error is coming from default selection code, when i remove that , i dont get error.
It might be some syntax error, if you have time , can you please look into the code which you sent me for default selection.



Regards,
Inam

Looks like my previous attempt locally had a prompt value cached within my Report Studio session. I just re-created it to send you an example, and I get the same error as you do. Looks like this won't work after all, sorry.

As you can't add this as a default selection using a macro to build the MUN for the current quarter, your only other option is to move the prompt from the report page to a prompt page, and use the original prompt macro I sent.

MF.
Meep!

inu

Quote from: MFGF on 03 Nov 2016 07:09:15 AM
Looks like my previous attempt locally had a prompt value cached within my Report Studio session. I just re-created it to send you an example, and I get the same error as you do. Looks like this won't work after all, sorry.

As you can't add this as a default selection using a macro to build the MUN for the current quarter, your only other option is to move the prompt from the report page to a prompt page, and use the original prompt macro I sent.

MF.

Oh,, no worries...
But MF. i cant change the requirement, its around 100+ reports are there.
I saw somewhere , where mentioned that using javascript we can set the default value. i tried that also, but didnot work.


Regards,
Inam

MFGF

Quote from: inu on 03 Nov 2016 09:26:45 AM
Oh,, no worries...
But MF. i cant change the requirement, its around 100+ reports are there.
I saw somewhere , where mentioned that using javascript we can set the default value. i tried that also, but didnot work.


Regards,
Inam

"did not work"? What does that mean exactly?
Meep!