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

[closed]values to prompt

Started by BIsrik, 10 Oct 2005 06:02:58 AM

Previous topic - Next topic

BIsrik

Hi i have requirement wherein i have to pass a value to a prompt. the value comes from the a calculated column.

That is the calculated column has to be computed first and this value is to passed as a prompt value.

The report requirement is like this..

Prompt A

o Query1
o Query2

Prompt B

o value1
o value2

if the user selects the query1 in promptA then the user will select a value displayed in value1 in prompt B. there is no probs here.

Now if the user selects the query2 in promptA then the user will only see a value (coming from the computed column).

Plz help in this out...

Srik

Cornelis

Srik,

Is there a way for you to create an example using the default databases?
Despite your description I still don't really see what you're trying to do. If you can send me an xml copy of a similar report based on the GO Sales and Retailers package I might understand better.

regards,
Cornelis Zijlstra

sir_jeroen

Little reminder: close the topic if it's been solved/closed (see board rules)

BIsrik

no, i don't have access to these packages..the report requirement is like this...

Prompt A

o Value1
o Value2

Prompt B

From and To Date Prompts

if the user selects the value1 in promptA then the user will select a date range in prompt B. there is no probs here.

Now if the user selects the value2 in promptA then the user will only see the date range (coming from the computed column).

The computed column is like this...from date: add_days(Currentdate,-1*365) ; To Date: Current date.

I want this calculation to take place at the report level so that only the value in the filter is passed to the database and not the entire expression.

Srik

Cornelis

This will not work (out of the box) using date prompts.
Most likely it will be possible if you use the SDK or some Java scripting to fill the prompt values.

If you lack the programatic skills for the SDK or Java scripting solutions (like me  :)) I would approach this the pragmatic way.
Make sure to specify in the first prompt that value2 will only give back data from the last year.
Apply this filter to the actual report (of course, only if value2 was selected)
Now just show the second prompt and allow people to make a from/to date selection (optional: give message that specifies that choosing dates is limited to last year).
There will be no checking the from/to column, but if you fill in invalid values, you'll only get the see the last year (on the account of our extra filter which is used if you select value2 in prompt A).

Regards,
Cornelis

BIsrik

thats fine as of now i have did something similar to this.. i have used the conditional blocks for the promptB based on promptA. I wanted to pass only the values because the reports developed are going to be in production. Hence a huge amount of data will reside in the database. Now for everyrow if the expression is added then the calcuation is calculated first for every row and then the filtering takes place..this will reduce the performance..instead if i pass only the values then the filtering takes place at the first instant itself..

Srik

Draoued

why don't you hide the prompt B if  value 2 is selected with conditional blocs.

And then in the Filter you do ,
If ( PromptB = "Your computed field" ) then ( [date] >= add_days(Currentdate,-1*365) )

BIsrik

yes presently i am doing like this...but this happens at a cost of performance...I don't want to use this expression because RN is converting it into sql. thus transfers the load to database...If i pass only the value, then there will no expression( like add_days(Currentdate,-1*365) ) in sql...the filtering happens directly on the value...

Srik

Cornelis

Quote from: BIsrik on 11 Oct 2005 08:02:34 AM
yes presently i am doing like this...but this happens at a cost of performance...I don't want to use this expression because RN is converting it into sql. thus transfers the load to database...If i pass only the value, then there will no expression( like add_days(Currentdate,-1*365) ) in sql...the filtering happens directly on the value...

Srik

don't use a date prompt, but use a selection of year (value prompt) month (value prompt) and day (value prompt).
Now you can use a query with a filter to show only one year, so people cannot select anything else.
months/days shouldn't be to much of a problem (although you will have to think of something to make the same month last year show only the days up until now).

this way you can just create filters which are build from the 3 (or 6 if you want a beginning and an end date) value prompts.  It's probably not as nice, but it will work!

Cornelis

sir_jeroen

#9
Little reminder: What is the status of this topic if it's been read board rules for Status text