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

Lineage Only Count One Time For Ad Number

Status
Not open for further replies.

brxmas

Programmer
Feb 9, 2004
69
US
ODBC 2000
Crystal 11.0

I created a Crystal report grouped as follows:

1) Class Code Desc
2) Class Code Int
3) Ad #


Class Desc Class Int # Ads $ CY $ LY Line CY Line LY
---------------------------------------------------------
LiveStock 915 55 874 217 322 217
LiveStock 945 59 235 174 317 235
---------------------------------------------------------
Total for Desc 114 1109 391 639 452

There can be one ad # that has ads running 10 times during the month. I want the $$ sum and only count the Lineage LY
one time. See example below:

Detail
ad # $ CY $ LY Line LY
05/02/04 45966 $6.00 $0.00 6
05/03/04 45966 $3.51 $0.00 6
05/04/04 45966 $3.51 $0.00 6
05/05/04 45966 $3.51 $0.00 6
05/06/04 45966 $3.51 $0.00 6
05/06/04 45966 $3.51 $0.00 6
05/07/04 45966 $3.51 $0.00 6
05/09/04 45966 $2.43 $0.00 6
------------------------------------------
29.49 0.00 6

05/02/04 46283 $2.34 $0.00 3
05/04/04 46283 $2.34 $0.00 3
05/08/04 46283 $2.34 $0.00 3
05/09/04 46283 $2.34 $0.00 3
05/10/04 46283 $2.34 $0.00 3
05/12/04 46283 $2.34 $0.00 3
05/13/04 46283 $2.34 $0.00 3
05/13/04 46283 $1.62 $0.00 3
-------------------------------------------
18.00 0.00 3

05/18/04 10492 $3.14 $0.00 3
05/18/04 10492 $3.13 $0.00 3
05/20/04 10492 $3.13 $0.00 3
05/21/04 10492 $0.60 $0.00 3
--------------------------------------------
10.00 0.00 3

If I only put the Date Range 2004-05-02 to 2004-05-31 I
get the correct data. But, I'm comparing Current Year to
Last Year same Period and it doesn't give me the correct Lineage.

I need a total after each Class Int (915) and
one after Class Desc Livestock.

Thanks in advance for your help. If you need anymore information, please let me know.
 
I think you could just right click on {table.LineLY} and insert a maximum at all group levels.

-LB
 
LB,

When I change the summary to Maximum it only gives me 11
and it should be 217.


This is my formula in the Lineage LY
IF {mc_ad_detail_view.ad_start_date} in DateTime (2004, 05, 02, 00, 00, 00) to DateTime (2004, 05, 31, 00, 00, 00)
THEN

{mc_ad_insertion.effective_lines}

I appeciate your help....

 
LB

I had to do a running total for my Ad's to count correctly I had to do a distinct count and change on group
class Int. This data is correct, it's just my lineage.

Thanks.

BC
 
Actually, you should use the maximum to display the correct number at the ad group level, and then use running totals for the other two groups levels. Use a sum of {table.LineLY}, evaluate using a formula:


(
onfirstrecord or
{table.ad#} <> previous({table.adno})
) and
{mc_ad_detail_view.ad_start_date} in DateTime (2004, 05, 02, 00, 00, 00) to DateTime (2004, 05, 31, 00, 00, 00)

Reset on change of group (Class Int}. For the Desc group, use the same components, but for the reset, use on change of group (Description).

Sorry that I oversimplified the first time around.

-LB
 
LB

I really appreciate the information you sent above.

The only issue I'm having is if I add the following for
my lineage in the 'Running Total' that it doesn't count my
Group
Class Desc
class_int

My report gives me the correct # of Ads and Revenue $$, but NO Lineage for the first Class Desc.

Running Total formula:
(
{mc_ad_detail_view.ad_num} <> Previous({mc_ad_detail_view.ad_num})
)
Employment
Class Int # Ads Revenue Lineage
510 Career College 1 $679.35 0 should be 3

Income Properties
Class Int # Ads Revenue Lineage
300 Apts Modesto 1 $ 214.18 3
315 Homes North Area 1 $ 205.91 3
320 Homes South Area 5 $1,154.23 31
300 Homes For Rent 1 $ 356.15 7

Thanks in advance for your help.

BC

 
Nevermind, I figured out the solution.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top