Durango122
MIS
Hi All
Cr 9.0
ms sql
I have a formula that calculated the average
here are my formula
--------------------------------
@Daily_Red
if {TRANSACTION_HISTORY.POSTING_DATE} <={?End_Date}
and
{TRANSACTION_HISTORY.TRADE_CLASS} = "R"
then
round({TRANSACTION_HISTORY.GROSS_AMOUNT})
else
0
-----------------------------------------
then i create a summary of this formula
sum(@Daily_Red,Territory)
that's fine
then i create a work-day formula
---------------------------------
@work_Day
WhileReadingRecords;
Local DateVar Start := Date(year({?End_Date}),1,1); // place your Starting Date here
Local DateVar End := {?End_Date}; // place your Ending Date here
Local NumberVar Weeks;
Local NumberVar Days;
Local Numbervar Hol;
DateVar Array Holidays;
Weeks:= (Truncate (End - dayofWeek(End) + 1
- (Start - dayofWeek(Start) + 1)) /7 ) * 5;
Days := DayOfWeek(End) - DayOfWeek(Start) + 1 +
(if DayOfWeek(Start) = 1 then -1 else 0) +
(if DayOfWeek(End) = 7 then -1 else 0);
//Local NumberVar i;
//For i := 1 to Count (Holidays)
//do (if DayOfWeek ( Holidays ) in 2 to 6 and
//Holidays in start to end then Hol:=Hol+1 );
Weeks + Days //- Hol
--------------------------------
this gives me the # of work days
then i get the average from @Daily_Red and @work_Day
--------------------------------
@Average
{@Daily_Red}/ {@work_Day}
--------------------------
i get the right number so far so good
but when i want to get the sum of @Average
@total_Avg
sum({@Average)
i don't get the right amount of the formula @Average result
ex:
Daily_Red********Work_Day*******Average
15****************5***************3
30****************5***************6
45****************5***************9
when i do a sum of the Average i get 90 instead of 18
what i'm i doing wrong????????????
Thanks
Durango122
if it moves and should not used Duck Tape
if does not move and should used WD-40
Cr 9.0
ms sql
I have a formula that calculated the average
here are my formula
--------------------------------
@Daily_Red
if {TRANSACTION_HISTORY.POSTING_DATE} <={?End_Date}
and
{TRANSACTION_HISTORY.TRADE_CLASS} = "R"
then
round({TRANSACTION_HISTORY.GROSS_AMOUNT})
else
0
-----------------------------------------
then i create a summary of this formula
sum(@Daily_Red,Territory)
that's fine
then i create a work-day formula
---------------------------------
@work_Day
WhileReadingRecords;
Local DateVar Start := Date(year({?End_Date}),1,1); // place your Starting Date here
Local DateVar End := {?End_Date}; // place your Ending Date here
Local NumberVar Weeks;
Local NumberVar Days;
Local Numbervar Hol;
DateVar Array Holidays;
Weeks:= (Truncate (End - dayofWeek(End) + 1
- (Start - dayofWeek(Start) + 1)) /7 ) * 5;
Days := DayOfWeek(End) - DayOfWeek(Start) + 1 +
(if DayOfWeek(Start) = 1 then -1 else 0) +
(if DayOfWeek(End) = 7 then -1 else 0);
//Local NumberVar i;
//For i := 1 to Count (Holidays)
//do (if DayOfWeek ( Holidays ) in 2 to 6 and
//Holidays in start to end then Hol:=Hol+1 );
Weeks + Days //- Hol
--------------------------------
this gives me the # of work days
then i get the average from @Daily_Red and @work_Day
--------------------------------
@Average
{@Daily_Red}/ {@work_Day}
--------------------------
i get the right number so far so good
but when i want to get the sum of @Average
@total_Avg
sum({@Average)
i don't get the right amount of the formula @Average result
ex:
Daily_Red********Work_Day*******Average
15****************5***************3
30****************5***************6
45****************5***************9
when i do a sum of the Average i get 90 instead of 18
what i'm i doing wrong????????????
Thanks
Durango122
if it moves and should not used Duck Tape
if does not move and should used WD-40