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

Grouping off by far 1

Status
Not open for further replies.

Ladyazh

Programmer
Sep 18, 2006
431
US
I want to say that I have created about 40 Reports and this one goes from the beginning of this year. Customer request is changing and finally i got to the point where i am losing my mind...
I have data

COD MAIN_ID ID ORDER COST
666 1111111 122 aaaaa $10.00
666 1111111 123 bbbbb $20.00
666 1111111 124 ccccc $30.00

666 1111112 122 aaaaa $10.00
666 1111112 123 bbbbb $20.00
666 1111112 124 ccccc $30.00

666 1111113 122 aaaaa $10.00
666 1111113 123 bbbbb $20.00
666 1111113 124 ccccc $30.00

My problem is that I need to calculate
MAIN IDs per COD (3)
Distinct IDs per COD (3)
Distinct ORDERs per code (3)
Total Cosr shoul be $60

Any suggestions on grouping?

 
Subreports would be fine if at the end of the song I wouldn't have to multiply and divide those results.

Does this data looks odd? I am just looking for exuse?lol
 
Insert a group #1 on code and then a group #2 on ID. Insert distinct counts on the first three fields at the group #1 level. Then insert a running total on cost that is a sum of cost, evaluate on change of group: ID, reset on change of group #1. Place the running total in the GF#1.

-LB
 
Thanks for helping.
Now if I only could get this...if my data was like this:
COD MAIN_ID ID ORDER COST CIR
666 1111111 122 aaaaa $10.00 IND
666 1111111 123 bbbbb $20.00 IND
666 1111111 124 ccccc $30.00 GRP

666 1111112 122 aaaaa $10.00 IND
666 1111112 123 bbbbb $20.00 IND
666 1111112 124 ccccc $30.00 GRP

666 1111113 122 aaaaa $10.00 IND
666 1111113 123 bbbbb $20.00 IND
666 1111113 124 ccccc $30.00 GRP

and I wanted to calculate where CIR = 'GRP' only.
Thanks
 
Fromula
If ({t.CIR}='GRP') then DistinctCount ({t.ID},{t.COD})
works and calculates fine
however
If ({t.CIR}='GRP') then DistinctCount ({t.MAIN_ID},{t.COD})
gives 0 as a result no matter what i do.
 
Your formula says if the current value of {t.CIR} is "GRP" then give me the distinctcount of ALL {t.MainIDs}. If you place this formula in the group footer, and if the last record in the group is = GRP then you will see a distinct count of all main IDs in the group, otherwise you will get a 0.

Again, what you need to do is insert a running total which is a distinctcount of {t.mainID} and evaluates based on a formula:
{t.CIR} = "GRP"

Reset on change of group {t.COD}. Please try this. The running total must be in the group footer for t.COD.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top