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

Can you Group from 2 fields ?

Status
Not open for further replies.

rzirpolo

Programmer
Apr 8, 2002
163
GB
My dilemma is that I have created a formula which from the output i.e. result I wish to groupd data from. That works fine but for the report I wish to create I ideally need to output 2 lines of text for each condition and then group individually by these. Is this possible ?

My formulas uses if and else statements and the result is a line of text e.g.

if {table.column} = 'AA01' and
{table.column} <> 'ABC' then 'Example Text'

Is there anyway this can be amended so that 2 lines of text are the result of each if statement ?

I was thinking along the lines of creating two formula fields and then somehow outputting the results of these into another forumla field and then grouping by that. Is that possible ?

I am finding it hard to explain so I hope this makes sense.
 
rzirpolo,

You seem to be asking several questions here, I'll try to address the ones I understand.

Q: Can a Forumula Field appear as 2 lines of text on the report? (translated)
A: Yes - see sample below:
if {table.column} = 'AA01' and {table.column} <> 'ABC' then
'Example Text1' & CHR(13) & &quot;Text Line 2&quot;
The CHR(13) causes a carriage return between the two fields. Vertically Size your formula on the report so you can see both lines.

Q: Can I group on multiple fields?
A: No - unless you do as you have already figured out and concatenate the two fields together in a formula andthen group on the formula. There's nothing that requires you to show the grouped formula field - you can show the individual fields or none at all instead if you want.

Cheers,
Larry
 
Thanks some helpful tips but I I have these two formulas setup and need to group via the results from each.

I should have explained better.. the dilemma is that if I put all the info into one forumla it will pick the first line that reads true. For the data involved there will be 2 true conditions in the if.. else if statements and I need to report on both.

Is there anyway I can setup a pre-determined list to group off ? I think that may help.

Any thoughts ?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top