Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...love the site and am constantly recommending it to (selected !) clients here in ireland..."

Geography

Where in the world do Tek-Tips members come from?
Axminster (IS/IT--Management)
8 May 12 7:03
Hi there, my first post here!

I have 2 tables joined by a left-outer. The {part} table and the {part_comp} table.

What I'd like my report to do is, with the use of a groupable formula, list the parent part and its components (if any).
In their most basic, relevant form, the tables look like this:

Part    Part_Comp
Part    Part    Comp_Part
000001  000001  001001
        000001  001002
        000001  001003
000002  000002  002001
        000002  002002
000003
000004
000005  000005  005001

All I have so-far is this:

CODE

//{@Compo}
If IsNull({part_comp.comp_part}) Then {part.part} Else {part_comp.comp_part}
I know this will only display the part OR its components, I simply can't get my head around how to display the part AND...

Can anyone solve this one?
lbass (TechnicalUser)
8 May 12 7:10
What is the problem you are running into? What is the resulting display (using your sample data)? I'm assuming you have a left join FROM part TO PartComp, with no selection criteria on PartComp fields.

-LB
Helpful Member!  IdoMillet (Instructor)
8 May 12 7:43
To have the formula return both, use:

//{@Compo}
If IsNull({part_comp.comp_part}) Then {part.part} Else {part.part} & " " & {part_comp.comp_part}

Are you aware of the Crystal option to do hierarchical grouping? See Online help...

hth,
- Ido

view, export, burst, email, and schedule Crystal Reports.
www.MilletSoftware.com

Axminster (IS/IT--Management)
8 May 12 9:11
@lbass
Thanks for the reply. Yes, I've left-outer joined from part to part_comp; no selection criteria.
The problem I'm running into is that if a part has components, my formula only returns those components. What I need is the part AND its components. If referring to the table in my initial post, we choose part 000001, we should have:
000001
001001
001002
001003


@IdoMillet
Thanks for yours also. Unfortunately, your suggestion just appends the component to the part, so we would get:
000001 001001
000001 001002
000001 001003

Hah! Hierarchical Grouping! B****r me sideways. (Please, don't)
That fixes everything, I've never used it before. Now I don't need my formula OR the subreport, OR the shared variables.

Thanks to the both of you for your efforts!
Axminster (IS/IT--Management)
8 May 12 9:22
Annoyingly now, my reply of thanks is not being submitted...
Axminster (IS/IT--Management)
8 May 12 9:24
@lbass
Thanks for the reply. Yes, I've left-outer joined from part to part_comp; no selection criteria.
The problem I'm running into is that if a part has components, my formula only returns those components. What I need is the part AND its components. If referring to the table in my initial post, we choose part 000001, we should have:
000001
001001
001002
001003


@IdoMillet
Thanks for yours also. Unfortunately, your suggestion just appends the component to the part, so we would get:
000001 001001
000001 001002
000001 001003

Hah! Hierarchical Grouping! B****r me sideways. (Please, don't)
That fixes everything, I've never used it before. Now I don't need my formula OR the subreport, OR the shared variables.

Thanks to the both of you for your efforts!

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close