Focal Point
[CLOSED] SUM, showing pieces from multiple records for each result

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/6947038895

February 16, 2011, 02:14 PM
CD960
[CLOSED] SUM, showing pieces from multiple records for each result
I'm not sure if this is possible. I need to spin thru the following table summing NBR by TITLE. The table shows categories, some are "details" (type A) and some are "combinations" (type B). Details make up combinations, and for each detail category line, the "combinations" column contains which combinations they go into.

The report I'm trying to make would show the following:

For each "A" type, I show NBR and TITLE. For each "B" type, I show NBR, TITLE, and the respective DETAILS that it consists of. Problem is, the details are scattered throughout the entire table.

Representation of data:

IND NBR TITLE COMBINATIONS
---------------------------------
A 101 title1 B 103 B 105
A 102 title2 B 103
B 103 title3
A 104 title4 B 103
B 105 title5
A 106 title6 B 105
A 107 title7 B 103 B 105

Desired report output:

NBR TITLE DETAILS
-------------------------------
101 Title1
102 Title2
103 Title3 101, 102, 104, 107
104 Title4
105 Title5 101, 106, 107
106 Title6
107 Title7

Would I need to run thru once, table the NBR & TITLE, create a hold and then run through again looking for detail matches, or can this be done in one pass??
Thank you to any ideas.

This message has been edited. Last edited by: CD960,


Cobol, Foc 7.6.5, VBA
all Outputs
February 16, 2011, 03:00 PM
Doug
What's your MFD look like? It looks like your data is rather random, is it really?

Post a copy of your MFD for us to see.
February 16, 2011, 03:19 PM
CD960
Yeah, it does look a bit messy, but the data is actually that random. What holds it together is a sequence number that I didn't mention, which will not be displayed in the output. This is the MFD:

SEGNAME=ONE,SEGTYPE=S0,$
FIELD=SEQ_NO , ,A4 ,A4 ,$
FIELD=CAT_TYPE , ,A2 ,A2 ,$
FIELD=CAT_NBR , ,A4 ,A4 ,$
FIELD=CAT_NAME , ,A36 ,A36 ,$
FIELD=CATEGS , ,A150 ,A150 ,$
SEGNAME=TWO,SEGTYPE=S0,PARENT=ONE,POSITION=CATEGS,OCCURS=25,$
FIELD=GEN_CAT_TYPE, ,A2 ,A2 ,$
FIELD=GEN_DETL_CAT, ,A4 ,A4 ,$
FIELD=CATS ,ORDER ,I2 ,I4 ,$


Cobol, Foc 7.6.5, VBA
all Outputs
February 17, 2011, 03:33 PM
Waz
I would suggest TABLEing out the details, Seg two, and creating a file that you can join to.

Then join CAT_TYPE + CAT_NBR to GEN_CAT_TYPE + GEN_DELT_CAT.

From there you can build the list of NBRs.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

February 17, 2011, 09:48 PM
CD960
Waz,
Thanks for the tip, I figured it would be tough to do this in one pass. I'll see what I can do with a join.
Chris


Cobol, Foc 7.6.5, VBA
all Outputs