Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

how to avoid crosstab - Show number of days according to groups

Morning all,

I think you all would agree with me that even having crosstab as a great tool in Crystal 2008, there are still quite allot of limitations to it.

I have created a report using crosstab which shows number of days and jobs according to those days grouped by account number, product code, sales area. This report is working fine until my director asked me to further group those days according to sub categories of lenses.

For example

Crosstab shows

Number of days - Day 1,day 2, day 3

Number of jobs - 111----123--1213

Percentage - -


12%---34% 60%

Now if you look at the example it says day 1, 111 jobs went out. What the director would like to see is those jobs being sub divided into types of lenses.

So out of 111 jobs, 25 would be Finished lenses, 30 could be uncut lenses and so on.

The new report should be like this

Number of days -


Day1---Day2---Day3

Number of Jobs:-

Finished -


25--


34-----23

Uncut--


30
45
-----23

AR--


70
56
-----76

Total----


125
135
----122

Percentage:-

Finished -


25%--


34%-----23%

Uncut--


30%
45%
-----23%

AR--


70%
56%
-----76%

Total----


100%
100%
----100%

Now if we look at the above criteria it seems that I have to use groups even further down the report where I am using crosstab at the moment. This means I have to get rid of the crosstab and run a report manually.

However the big question is, how to get the report calculating number of days and jobs according to customer account number, product code and sales area manually?

I tried the following formula but this requires to write way too many formulas, for example some of the jobs have taken more than 60 days and if i use this formula I have to write 60 formulas for number of days which is not feasable.

**//provided by IIbas in another forum**
whileprintingrecords;
numbervar day0;
numbervar day1;
numbervar day2;
if {@workingdays} = 0 then
day0 := day0 + 1 else
if {@workingdays} = 1 then
day1 := day1 + 1 else
if {@workingdays} = 2 then
day2 := day2 + 1 else //up to the maximum number of days.

Then in the report footer, reference the days in separate formulas, and identify them with text boxes, e.g.,

//{@day0};
whileprintingrecords;
numbervar day0;

I can sort out the Finished, uncut,AR by grouping them however I am wondering how to create a manual running total of jobs complying with number of days without using crosstab.

Any ideas?

Many thanks

Regards

Jehanzeb

Former Member
Not what you were looking for? View more on this topic or Ask a question