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

Recent posts

#81
Reporting / Re: return value of ParamValue...
Last post by MrKlar - 09 Oct 2024 06:12:52 AM
Quote from: dougp on 08 Oct 2024 06:09:45 PMIn the Report expression dialog, there are tabs along the bottom, below Available Components.  Looking at the Functions tab, I see a function named string2int32().  Maybe give that a go.

I also found the function string2int32() in the layout calculation, that you are referring to. It works, thanks for the hint.

Quote from: cognostechie on 08 Oct 2024 07:08:19 PMYou said that the value is already numeric in your database so which value did you convert to a number?
The value in the database is numeric. I fill the prompts creating the parameter that I want to display in the layout calculation with these numeric values. Nonetheless, ParamValue() and ParamDisplayValue() seem to always return the values in text format. Which is fine with me since I can use the function mentioned above.

#82
Reporting / Re: Change default source of r...
Last post by cognostechie - 08 Oct 2024 08:12:08 PM
Quote from: dougp on 08 Oct 2024 06:03:30 PMBut I don't remember ever seeing a red star next to a package or data module. 

He is not talking about the screen which shows Insertable Objects but the screen you get when you click on Report and then again Report.

Quote from: dougp on 08 Oct 2024 06:03:30 PMHowever, I have not had success using multiple packages in a report. 

It is only possible when the package you use uses DQM. You will get a '+' icon on the top right side of the package to add another DQM package. 
#83
Reporting / Re: return value of ParamValue...
Last post by cognostechie - 08 Oct 2024 07:08:19 PM
Quote from: MrKlar on 08 Oct 2024 04:13:18 AMDear Cognos-fellows,

I wonder wether a parameter value, retrieved by either ParamValue('paramter_name') or ParamDisplayValue('paramter_name'), is always in text format?

In my example I set the "parameter use value" to a numeric field in the database. However, if I want to do numeric calculations with that "use value" in a layout calculation, I get an error ("The operand types [...] are not compatible.").
Quote from: MrKlar on 08 Oct 2024 04:13:18 AMDear Cognos-fellows,

I wonder wether a parameter value, retrieved by either ParamValue('paramter_name') or ParamDisplayValue('paramter_name'), is always in text format?

In my example I set the "parameter use value" to a numeric field in the database. However, if I want to do numeric calculations with that "use value" in a layout calculation, I get an error ("The operand types [...] are not compatible."). I do not get the error if I to convert the value to a number at first.

Thank you for your answers.

Thank you for your answers.

You said that the value is already numeric in your database so which value did you convert to a number?

I am not sure if Layout calculation will allow functions but query calculation does allow that.

cast( ?parameter_name?, int) OR  cast( ?parameter_name?, char)

If you DB is SQL Server then thus might also work

cast( ?parameter_name? as integer) OR  cast( ?parameter_name? as char)
#84
Reporting / Re: return value of ParamValue...
Last post by dougp - 08 Oct 2024 06:09:45 PM
In the Report expression dialog, there are tabs along the bottom, below Available Components.  Looking at the Functions tab, I see a function named string2int32().  Maybe give that a go.
#85
Reporting / Re: Change default source of r...
Last post by dougp - 08 Oct 2024 06:03:30 PM
I find the term data source confusing.  The term "data source" has a specific meaning in Cognos Analytics.  A data source is created in Cognos Administration on the Configuration | Data Source Connections page.  I don't think that's what you are asking about.

A report can use a data module or a package as a source.  A data source is how a package accesses data.  A data module uses a data server, package, dataset, or uploaded file as sources.

I could assume you are in Reporting looking at the Sources tab in Insertable Objects.  But I don't remember ever seeing a red star next to a package or data module.  I'm also not familiar with a package being the default package.  However, I have not had success using multiple packages in a report.  If I need multiple data subjects in a report, I include them in a data module, then use the data module for the report.

Please be specific and use correct vocabulary.
#86
Reporting / Re: return value of ParamValue...
Last post by MFGF - 08 Oct 2024 09:35:26 AM
Quote from: MrKlar on 08 Oct 2024 04:13:18 AMDear Cognos-fellows,

I wonder wether a parameter value, retrieved by either ParamValue('paramter_name') or ParamDisplayValue('paramter_name'), is always in text format?

In my example I set the "parameter use value" to a numeric field in the database. However, if I want to do numeric calculations with that "use value" in a layout calculation, I get an error ("The operand types [...] are not compatible."). I do not get the error if I to convert the value to a number at first.

Thank you for your answers.

I believe ParamValue() and ParamDisplayValue() will always return character strings. They are for use in layout calculations, rather than query calculations.

I'm assuming you're trying to reference the value for use in a query calculation? Have you tried simply referring to the parameter in your expression by name (eg ?parameter_name? )?

Cheers!

MF.
#87
Reporting / Re: Change default source of r...
Last post by MrKlar - 08 Oct 2024 04:24:04 AM
Hi cognostechie,
Thanks for the reply.

I'm not sure wether your post answers my question.
I have the situation where I already have more than one data source (e.g. different data modules) in the report. Say data source 1 is the default at the moment and data source 2 is not. How do I switch these two. If I use the option "replace the package" I would probably get errors in the queries, don't I?

Or maybe I don't comprehend you correctly?
#88
Reporting / return value of ParamValue / P...
Last post by MrKlar - 08 Oct 2024 04:13:18 AM
Dear Cognos-fellows,

I wonder wether a parameter value, retrieved by either ParamValue('paramter_name') or ParamDisplayValue('paramter_name'), is always in text format?

In my example I set the "parameter use value" to a numeric field in the database. However, if I want to do numeric calculations with that "use value" in a layout calculation, I get an error ("The operand types [...] are not compatible."). I do not get the error if I to convert the value to a number at first.

Thank you for your answers.
#89
Reporting / Adding a row that calculates t...
Last post by Roberto - 07 Oct 2024 09:45:45 AM
So I have a crosstab with information on the following format

My crosstab looks like this

How do I add a column that subtracts the sum of all the title amts in group A minus the sum of all the title amts in group b?

Here is an example in excel:

https://imgur.com/a/hL6N6u8
#90
Reporting / Re: Change default source of r...
Last post by cognostechie - 04 Oct 2024 11:36:51 AM
Yes, it is possible.

Instead of going to the Report Tab, go to any Page under 'Pages'. On the left, you will see the same 'data source' which is actually the package. Right click on it and you will see an option to replace the package. If your package is using DQM then you will also see a + icon to add another package to the report.