Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 

Hello,

I was asked to create a report which summarizes the sum of checks, the count of the customers paid the checks, and the count of the checks which are due within the selected month and year. Also, I was asked to make the summary divided into periods for example 5 days.


In this case, the report should show the sum of checks, the count of the customers paid the checks, and the count of the checks which are due in November 2014. The summary is divided into periods of 5 days as the following:

If the period is 10 days, the report will be as the following:

I used the following formula as Cross-Tab Columns Formula:

Ceiling (day({Command.CheckDate})/{?days}) // This formula name is d which will be used in another formula later

DayFormula (d)    DayFormula (d)     DayFormula (d)
11113215
21123225
31133235
41143245
51153255
62164266
72174276
82184286
92194296
102204306
317

Here is the result:

To make the column header more meaningful, I added the following formula into the Cross-Tab Group Options > Group Name Formula as shown in the screenshot:

if ({@d}-1)*{?days}+1=Day(DateAdd("d",-1,DateAdd ("m",1 , Date ({?Year},{?Month} ,1 )))) then

// The first day in the period = the last day in the month then show only that day for example 31

CSTR(({@d}-1)*{?days}+1,0)

Else if {@d}*{?days}>Day(DateAdd("d",-1,DateAdd ("m",1 , Date ({?Year},{?Month} ,1 )))) then

// The last day in the period > The last day in the month then show the beginning of the period with ++ for example if the period is 7 days then the last period will be 29++

CSTR(({@d}-1)*{?days}+1,0)+"++"

Else

CSTR(({@d}-1)*{?days}+1,0)+"-"+Cstr(({@d})*{?days},0)

The final result as the following:

I hope this was helpful

Best regards,

Alaa

Labels in this area