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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Group Selection Formula Problem

Status
Not open for further replies.

WestView

Technical User
Jan 7, 2003
67
US
Hello All,

I’m having a problem with group selection and can’t figure why.

I have a group based on the following formula: Left({Table.PRODUCT_CODE},3)

I have a Parameter Field, {?Product Code}, where users enters the first three characters of a product code, i.e. 101, 102, ABC, etc.

I have the following formula in the Record Selection:
(If {?Product Code} = "101" then {Table.PRODUCT_CODE} startswith ["101"] else
If {?Product Code} = "102" then { Table.PRODUCT_CODE} startswith ["102"] else
If {?Product Code} = "104" then { Table.PRODUCT_CODE} startswith ["104"] else
If {?Product Code} = "ABC" then { Table.PRODUCT_CODE} startswith ["ABC101"] else
{?Product Code} = Left({Product.PRODUCT_CODE},3))

The problem I’m encountering is that if I enter “ABC” - along with other parameter (say, “101”) the report only returns the “ABC” records. If I enter “101”, “102”, “104” the report returns the correct records.

What have I got wrong here?

Thanks in advance for any/all suggestions!

- Tom
 
Try:

If {?Product Code} = "ABC" then {Product.PRODUCT_CODE} startswith "ABC101" else
{?Product Code} = Left({Product.PRODUCT_CODE},3))

-LB



 
Hi LB,

Thanks for your reply! I tried that, but only get "ABC" records returned.

- Tom
 
I think this should be a record selection formula, not a group selection formula. Try that and then report back, please.

-LB
 
I think this should really be a record selection formula, not a group selection formula. You could try that and then report back, or you could try the following as a group selection formula:

({?Product Code} = "ABC" and
{Product.PRODUCT_CODE} startswith "ABC101") or
{?Product Code} = Left({Product.PRODUCT_CODE},3))

-LB
 
Hi LB,

Thanks for your reply!

Unfortuately, same result.

I think I need to equate product codes that start with "101" and "ABC101" into the single "101" parameter entry. That is, if the user enters "101" into the parameter field, the report will treat product codes that start with "101" and "ABC101" the same.

How on earth do I do that????

Thanks!!!

-Tom
 
I guess I'm not following what you are trying to do. Can you explain a little more?

-LB
 
Hi LB,

Thank you for your reply. Sorry for the delay in getting back to you sooner. I couldn't log on to this site all morning.

I have a report that returns client info where that client’s subscription has recently expired. Users enter a number in a parameter field, say 100, and the report returns those 100 clients whose subscription has expired -- sorted by most recent expiration date.

The report has two parameter fields, one to enter the number of most recently expired (?MostRecentlyExpired) and the other to select the product code(s) (?ProductCode). The product codes starting with “ABC101” and “101” I need to somehow group together, as these two product codes are considered the same product for billing/marketing.

The problem I’m having is how to do this.

I hope I’ve explained the problem sufficiently. Please let me know if I can further clarify.

Thanks again!!!

- Tom
 
How about using:

{?Product Code} = right({Product.PRODUCT_CODE},3)

-LB



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top