Skip to Content
author's profile photo Former Member
Former Member

Crosstab showing 0 and 2.3 percent

I am using Crosstab to calculate my working days and jobs. The report displays the information fine however, right on top of the Crosstab it shows

0 - 2.34%

I am wondering what is this and why is it showing 0 and if it is showing 0 then 0 / 23007 should be 0% and not 2.34%.

Where is this percentage coming from I have no idea and why is that 0 coming up I have no clue either.

Here is the layout of the report

Days - Jobs - Percentage

0 2.34%

1 6958 23.94%

2 6231 26.45%

...

Total - 23007 - 100%

here is the code used:

WhileprintingRecords;
Local DateVar Start := {order_header.date_entered};   // Starting Date
Local DateVar End := {order_header.act_despatch};  // Ending Date
Local NumberVar Weeks; // Number of weeks
Local NumberVar Days; // Number of days
Local Numbervar Hol:=0; //Number of holidays
Shared DateVar Array Holidays; // Bank holidays dates array

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) //adjust for starting on sunday:
+(if dayofweek(end) = 7 then -1 else 0); //adjust for ending on a saturday:

//Check for bank holidays
Local NumberVar i;
For i := 1 to Count (Holidays)
do (if DayOfWeek (Holidays<i>) in 2 to 6 and
Holidays<i> in Start to End then Hol:=Hol+1 );

Weeks + Days - Hol;

Can someone please help me to identify this problem, i suspect it is coming because I have put in

Days:=DayOfWeek(end) - Dayofweek(Start) + 1
+ (if dayofweek(start) = 1 then -1 else 0) //adjust for starting on sunday:
+(if dayofweek(end) = 7 then -1 else 0); //adjust for ending on a saturday:

however not sure.

Please help

many thanks

Kind Regards

Jehanzeb

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Posted on Jul 28, 2008 at 05:14 PM

    Hi Jehanzeb,

    I do not see any problems with working days calculation formula, but I do not know how jobs have been calculated or what is the percentage formula?

    For example:

    (6958 / 23007)*100 = 30.242% but you have 23.94%

    Am I missing something?

    Can you provide more details how you designed your crosstab?

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 31, 2008 at 08:35 AM

    answered

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.