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

Cannot See Formula to Group By

Status
Not open for further replies.

dartagnan3rd

Programmer
Nov 16, 2010
3
US
I need to use a formula in the Group Expert so I can change the grouping based upon a parameter yet when I go to select the formula = TOTAL_BY based on the parameter {?TOTAL_BY} with the code:
if {?TOTAL_BY} = "Location" then {Command.LOCATION}
else if {?TOTAL_BY} = "Dept" then {Command.DEPT}
else if {?TOTAL_BY} = "Vendor" then {Command.VENDOR_NUMBER}
else if {?TOTAL_BY} = "PO" then {Command.PMG_PO_NUMBER}

I cannot see, let alone select the TOTAL_BY formula in Group Expert.

I appreciate you help.

Thanks,
Fred
 
Where did you create the formula? Did this formula compile without error? If you created it in the field explorer->formula->new area, then it should appear for use for grouping. I don't see anything in the formula that is incorrect unless the fields are not of the same datatype, but then you should have received an error.

Also make sure you have placed the formula somewhere on the report since if you haven't referenced the parameter elsewhere, you don't have a value for it in the formula.

-LB

 
I checked and I do have a compile error.
"A string is required here" is the error message and then the last "if" in the last line "else if" of my code is highlighted.
What could be wrong?
 
Thanks LB! I just needed to resolve the compile error. Turns out that the various values in my code switch between numeric and string values. I limited to just string values and it works! Next, set those numbers to strings in my SQL.

Thanks again!
Fred
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top