jchewsmith
Technical User
I have a report that first groups by customer then by month/year:
I need to do a count of the last 3 months but I need to reset it after a new customer
example:
abc co month 1 = 10 last 3 months = 10
month 2 - 5 last 3 months = 15
month 3 = 10 last 3 months = 25
month 4 = 7 last 3 months = 22
def co month 1 = 2 last 3 months = 2
month 2 = 6 last 3 months = 8
month 3 = 5 last 3 months = 13
month 4 = 7 last 3 months = 18
my formulas for month and 3 months look like this:
MONTH:
whileprintingrecords;
Global NumberVar M3;
Global NumberVar M2;
Global NumberVar M1;
M3 := M2;
M2 := M1;
M1 := Sum ({@countoflastlogin}, {ssi_Customers1.LastLogin}, "monthly");
3 MONTHS:
WhilePrintingRecords;
Global NumberVar M3;
Global NumberVar M2;
Global NumberVar M1;
M3 + M2 + M1
I need to do a count of the last 3 months but I need to reset it after a new customer
example:
abc co month 1 = 10 last 3 months = 10
month 2 - 5 last 3 months = 15
month 3 = 10 last 3 months = 25
month 4 = 7 last 3 months = 22
def co month 1 = 2 last 3 months = 2
month 2 = 6 last 3 months = 8
month 3 = 5 last 3 months = 13
month 4 = 7 last 3 months = 18
my formulas for month and 3 months look like this:
MONTH:
whileprintingrecords;
Global NumberVar M3;
Global NumberVar M2;
Global NumberVar M1;
M3 := M2;
M2 := M1;
M1 := Sum ({@countoflastlogin}, {ssi_Customers1.LastLogin}, "monthly");
3 MONTHS:
WhilePrintingRecords;
Global NumberVar M3;
Global NumberVar M2;
Global NumberVar M1;
M3 + M2 + M1