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

Set a Variable to a dataitem value?

Started by jburchill, 07 Feb 2023 02:11:39 PM

Previous topic - Next topic

jburchill

Hello, is there a way to set a variable to a specific value returned by a dataitem?  For instance, if I have a data item called Rate, and I want to use that in calculations through the report, can I just set a variable to equal Rate?  This way I wouldn't have to join the rate query to different queries just to bring in the rate.  I also, don't want to enter it in a Rate prompt, since I find that defeating the purpose getting the rate from the tables.

Any help is appreciated. 

Thank you

bus_pass_man

In business terms, what is the relationship between this rate and anything else, especially the things being used in the expressions you want to use rate in?

Is there one rate to all things or a rate to many but not all things and, thus a set of rates?

What are the things you want to use in conjunction with rate in your calculations?


dougp

For a single value, yes.  It can be done either of two ways.

If your package is DQM (data modules are DQM) you can use the QueryValue() function in your data items that require this calculation.

Regardless of query mode, you can use a prompt.  You'll need add an additional prompt page that uses a page module to automatically select all of the (one) values in the value prompt that contains your rate.  You'll also need to add a custom control that automatically runs the FINISH action.  Other cosmetics and functional things like hiding controls and faking up some graphics so the user doesn't know they navigated to another prompt page, and changing the FINISH button on the preceding prompt page to NEXT.  You'll then add a parameter to the data items that require this calculation.