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

param display

Started by COGNOSBC, 15 Jul 2013 02:42:36 PM

Previous topic - Next topic

COGNOSBC

in param display value how to display date format from : 2013-07-14   to  jul 14, 2013

MMcBride

What type of a prompt are you using to select the date?

I found if I used a Date Prompt - I could not figure out how to modify the format of the Paramdisplay

However if I used a Drop Down list to show the dates and select from the list, by changing the Format on the Prompt Object it will change the format of the Param display value.


HalfBloodPrince

Try this

add a layout calculation in report page, add ParamDisplayValue('Parameter1').

then set format of layout calculation as date.

set following properties
1)date style - medium
2)Display month - short name

MMcBride

HalfBloodPrince
I tried this and got the same results, I am on 10.1.1 fp2 so perhaps the issue is version.

If I use a Date Prompt - I can find no way to modify the display
If I use a List prompt with the date based data item and apply the format to the prompt I can make it look however I want.

CognosPaul

ParamDisplayValue always return string values.

Try the following:
date2timestamp(string2date(ParamDisplayValue('Parameter1')))

The data format will work on the timestamp data type without an issue.

MMcBride

#5
No change
I am including a very simple Report Spec that has a prompt page with 2 prompts
One is Date Prompt (Parameter1)
The Second is a Value Prompt (Parameter2)

To populate Parameter2 I connected to a Relational Package with Date in it. This is a DB2 filed with a Data Type of "Date" defined in the model. You can substitute this for any date you have in any package - I don't have the sample packages from IBM loaded atm or I would have used a Date from there.

On the Report Page I have 6 Report Expressions
3 based on the Date Prompt and 3 based on the Value Prompt

1 - date2timestamp(string2date(ParamDisplayValue('Parameter1')))
No errors on this but it only displays --
2 - string2date(ParamDisplayValue('Parameter1'))
Thinking that since this wasn't a Date/Time stamp I changed your logic to just use a string to date comparison once again it only displays --
3 - ParamDisplayValue('Parameter1')
Just to see what it would display - "Jul 18, 2013"

Second set of three use the same logic as above except with the Paramter2
1 - date2timestamp(string2date(ParamDisplayValue('Parameter2')))
--
2 - string2date(ParamDisplayValue('Parameter2'))
--
3 - ParamDisplayValue('Parameter2')
For this one I went back to the Value Prompt itself since changing the format here doesn't seem to do anything and made the Data Type for the Value Prompt to be "Date" and selected "Date Style = Full" I got "Wednesday, July 17, 2013"
I should point out the reason it is the 17th is that is the ONLY day in Date field (it is a single day snapshot)
     
So I was able to modify my Date display with a value prompt but not with a Date Prompt parameter.

Great suggestions all, but using a Date Prompt I am unable to get the displayvalue to give me anything I can modify.

This may be one of those times where I am seriously over thinking this... but I have tried everything I can to no avail.

CognosPaul

Try using ParamValue instead of ParamDisplayValue

MMcBride

And as easy as that...

Paramvalue() allowed me to modify the Date formate for the 1, 2 and 3 in my sample report without any problems

Thanks PaulM  ;D guess I was too hung up on the paramdisplayvalue()  :-[