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

Cast Parameter - ParamDisplayValue

Started by HDA, 20 Nov 2013 11:41:38 AM

Previous topic - Next topic

HDA

I have a variable with following expression which is throwing parsing error.

[Year] > cast(ParamDisplayValue('yearPrompt'), integer)

'yearPrompt' is a value prompt I have in my report. How do I cast it to integer ? If I don't use cast I am getting data type error.

Please Help.

Lynn

What are your use and display values? Perhaps you just want ParamValue rather than ParamDisplayValue.

Oops....forgot to add that perhaps your query item reference needs to be qualified with the query name. [YourQuery].[Year]

HDA

I forgot to add this but my query item reference has the query name .

[Query1].[Year] > cast(ParamDisplayValue('yearPrompt', integer)

My use and display values are same [Query1].[Year]. I also tried ParamValue but it doesn't work. I get the same parsing error.

Lynn

Ok, let's step back for a moment. What type of variable (e.g., string, Boolean) are you trying to create and what is it's purpose? Is your source relational or dimensional?

It looks more like an expression one would use in a filter for a relational query, in which case you'd use a different for referring to your parameter. Using ?yearPrompt? would be the appropriate thing in that situation.

HDA

I am creating a boolean variable. Filter will not work because I am trying to do conditional formatting on the data based on the variable.

HDA

I found the solution

[Query1].[Year] >= string2int32 (ParamDisplayValue('yearPrompt'))

Its much simple than what I thought. There is a Data type casting functions folder in Available components. I just dragged it and used in my variable.  :)

Lynn

Glad it worked. You might want to look into the conditional style property within your data container. I think it is a whole lot easier to define conditional styles that way vs using variables and condition explorer.