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!

Grouping formula

Status
Not open for further replies.

waldopepper

Programmer
Nov 21, 2003
124
GB
Hi - I have a variable I am grouping on but the values are not that descriptive so I have used a case statement to give the values more meaning - this is done in the grouping formula.

IF {SalesTransactionHeader.Stream} = "S" Then "Store"
ELSE IF {SalesTransactionHeader.Stream} = "T" Then "Telephone"
ELSE IF {SalesTransactionHeader.Stream} = "W" Then "Web"
ELSE IF {SalesTransactionHeader.Stream} = "O" Then "Store Telesales"
ELSE "Unknown value"

Which works fine in my report and counts look like this:
Store 1,000
Telephone 2,000
Web 3,500
Store Telesales 500


However the client want to merge the "S" and "O" values to both show as "Store".

I have changed my case statement to this:
IF {SalesTransactionHeader.Stream} = "S" Then "Store"
ELSE IF {SalesTransactionHeader.Stream} = "T" Then "Telephone"
ELSE IF {SalesTransactionHeader.Stream} = "W" Then "Web"
ELSE IF {SalesTransactionHeader.Stream} = "O" Then "Store"
ELSE "Unknown value"


But not in my report instead of
Store 1,500
Telephone 2,000
Web 3,500

It doesn't put these records together - they get grouped like this:
Store 1,000
Store 500
Telephone 2,000
Web 3,500


I've tried putting the criteria in the same part of the case statement but I get the same result

IF ({SalesTransactionHeader.Stream} = "S") OR ({SalesTransactionHeader.Stream} = "O") Then "Store"
ELSE IF {SalesTransactionHeader.Stream} = "T" Then "Telephone"
ELSE IF {SalesTransactionHeader.Stream} = "W" Then "Web"
ELSE "Unknown value"


any thoughts?
thx
W
 
Your last formula should work fine, but if it doesn't, do you maybe have an outer group that you are suppressing that is causing the duplicate groups?

-LB
 
Ah thanks - I've now removed the old group and simply created a new variable with this case statement in. It works fine now.

thx
W
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top