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

Displaying detail when grouping at different levels

Status
Not open for further replies.

olrac

MIS
Nov 23, 2010
16
0
0
CA
Hi,

I'm having problems displaying details when using conditional groupings.

Example:

line
type earn-code hours
d 0074 25
d 0074 25
d 0074 25
GF 2 75 (total)

d 0075 35
d 0075 35
GF2 70

GF1 145

What I need to do is that when the
1- code is 0074 > 75 display all records (both 0074 and 0075 codes)
2 - when code 0074 < 75 and code 0075 <> 0 then display all records


I tried the following but doesn't work:
((Sum ({@ADJ_HOURS}, {Command.TC_code}) > 75 and Maximum ({Command.TC_code}, {Command.TC_code}) = "007.4")) or
((Sum ({@ADJ_HOURS}, {Command.TC_code}) <75 and Maximum ({Command.TC_code}, {Command.TC_code}) = "007.4") and
(Sum ({@ADJ_HOURS}, {Command.TC_code}) <> 0 and Maximum ({Command.TC_code}, {Command.TC_code}) = "007.5"))



Where the sums are at GF2 level. I get the first requirement but not the second and I don't get the display of both earning codes.

Thanks




 
If you are only totaling AdjHours for G1 there is no reliable way for it to know which hours are which. Instead write two formulas like this:

//{@0074Hrs}
If {Command.TC_code} = "007.4" then {@Adj_Hours} else 0

//{@0075Hrs}
If {Command.TC_code} = "007.5" then {@Adj_Hours} else 0

Then you can do something like this for G1:
Sum ({@0074Hrs}, {Command.Line}) < 75
and Sum ({@0075Hrs}, {Command.Line}) > 0


Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guides to Formulas, Parameters, Subreports, Cross-tabs, VB, Tips and Tricks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top