Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crystal selection formula

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
We have two parameters, "State Code" and "Store Id". The user is prompted to enter a value for each of these parameters. The user may select the value "ALL" for each parameter in order to bring back all records, or the may enter a specific value to limit the returned records. We are having problems when we concatenate the two formulas for these parameters. We don't have any problems if we only use one formula and not the other. Here is the concatenated version of the formulas:

(if {?show_specific_store} = -9999 then
true
else
{sp_sales_change_over_time.retailer_id} = {?show_specific_store}) and
(if {?show_specific_state} = "ALL" then
true
else
{sp_sales_change_over_time.state_code} = {?show_specific_state})

It WILL work with only one formula, for example:

if {?show_specific_store} = -9999 then
true
else
{sp_sales_change_over_time.retailer_id} = {?show_specific_store}

Any ideas why? Thanks!
 
Try this (or some variant):

(if {?show_specific_store} > 0 then
{sp_sales_change_over_time.retailer_id} = {?show_specific_store}) and
(if {?show_specific_state} <> &quot;ALL&quot; then
{sp_sales_change_over_time.state_code} = {?show_specific_state})


The idea here is to assume the 'ALL' condition. ECS DataSystems, Inc.
A Crystal Partner
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top