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

Need help with Grouping formula..

Status
Not open for further replies.

Wilnicm

MIS
Mar 16, 2009
20
US
Currently i have two tables {Comand_1} and {Command}
There are link with the AL_FATHER_ID field.
{Command_1} has these field {Command}
AL_DESCRIPTION AL_ITEM_ID
AL_FATHER_ID TS_SUBJECT
AL_ITEM_ID AL_DESCRIPTION
AL_FATHER_ID
Currently i have the report disigned like this
Group field 1 | Group Field 2| Total | Total Executed| Pass|
Group field 1 is from {Comand_1.AL_DESCRIPTION}
Group field 2 is where i'm having problems i want to include each group field from group 2 that equals group 1 and also some groups that have have corresponding groups that does not relate to a group from group field one for example.
I want the group to look like this

Group field 1 | Group Field 2| Total | Total Executed| Pass|
Financials (FI)
-FI <--- *
-Letter Day 1 <--- *
-Letter Day 2 <--- *

* currently these are from table and field {command.AL_DESCRIPTION} but does no relate to be able to group them under Financials (FI), but i want to put them under this group anyway. Is there a way for me to do this. The reason i have to do it like this is because the table is not currently formated to allow me to easily group them that way. if there is a way to do this whether it is with a formula or just by adjusting my format setting. I would gladly appreciate it since i been working on a work around for this for some time..I'm currently using Crystal report version 10.



<Will The Great>
 
What have you tried? I'm assuming you don't want all Group 2 values otherwise you could just group by that. It sounds like you should have a formula field, something like
Code:
if {group1_value} = {group2_value}
then {group1_value}
else if {group2_value} in ["cat", "dog"] then "Animal"
else...
Does this help?

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Madawc Thanks.. so much for you help..
This code i think will work but, how do i specify my group name in the formula. On the design section of the report the group is name is "Group #1 Name" and "Group #2 Name" respectively. I used this text for group one name "Group #1 Name({Command_1.AL_Description})" but i recieve an error from crystal report.. let me know if this is formated incorrectly.. thanks..

<Will The Great>
 
How can i make this formula correct i keep recieving the error "string is required here"

If {Command_1.AL_DESCRIPTION} = {Command_1.AL_DESCRIPTION}
then {Command_1.AL_DESCRIPTION}
else if {Command_1.AL_DESCRIPTION}= "Financials (FI)_Stacy" then {Command_1.AL_DESCRIPTION} in ["FI","Letters DAY 1"]

<Will The Great>
 
How can i make this formula correct i keep recieving the error "string is required here"
If {Command_1.AL_DESCRIPTION} = {Command_1.AL_DESCRIPTION}
then {Command_1.AL_DESCRIPTION}
else if {Command_1.AL_DESCRIPTION} = "Financials (FI)_Stacy" then {Command_1.AL_DESCRIPTION} = ["FI","Letters DAY 1"]

<Will The Great>
 
Will,

Please do not start multiple threads on the same basic question.

Why don't you upload your report to this thread and maybe someone can look at it.

Software Sales, Training, Implementation and Support for Macola, Synergy, and Crystal Reports. Check out our Macola tools:
 
I'd say your error was the last part,
{Command_1.AL_DESCRIPTION} = ["FI","Letters DAY 1"]
You've used the format for a test, or else you want Crystal to look up another record, which is not how it works. If you want the description from another field then it's not easy in Crystal. You could maybe get it using a subreport and shared variables.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top