Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8436

crystal report adding ranked down data

$
0
0

Hi Ma'am/Sir, please help me on my report. I do have a report that computes order to ship date. which has formula of

@proc_days2

DateVar Array Holidays;

Local DatetimeVar Start := {@Adjusted Item Create Timestamp};

Local DatetimeVar End := {@zzLast Edit Date};

local numbervar days;

Local NumberVar i;

For i := 1 to Count(Holidays) do

(

    if DayOfWeek (Holidays[i]) in 2 to 7 and Holidays[i] in [Start to End] then

         days := days + 1;

);

Datediff("d", Start, End) - Datediff("ww", Start, End, crSunday) - days;

 

and that proc_days has been categorize into 4 which are 0-3days 4-7days 8-14days 15-abovedays

i can now compute the sum of those order per categories,

formula for 4-7days

whileprintingrecords;

numbervar count_7FSSNCR;

numbervar count_7FSSLUZ;

numbervar count_7FSSVIS;

numbervar count_7FSSMIN;

numbervar count_7FSS;

numbervar count_7NTW;

numbervar count_7NNS;

numbervar count_7NSM;

numbervar count_7NLZ;

numbervar count_7SLZ;

numbervar count_7MIN;

numbervar count_7VIS;

global numbervar count_3FSSNCR2;

Local NumberVar reduction;

if {RECEIPT.SUPPLIERCODE} = 'G001' then

  reduction := 3;

IF {ORDERS.STATUS} IN ['95','92'] THEN

(if {STORER.SUSR2} = 'FSS-NCR' AND (({@proc_days2} - reduction) IN [4 to 7] ) then

  count_7FSSNCR := count_7FSSNCR + 1 else

if {STORER.SUSR2} = 'FSS-LUZ' AND (({@proc_days2} - reduction) IN [4 to 7])

   then count_7FSSLUZ := count_7FSSLUZ + 1 else

if {STORER.SUSR2} = 'FSS-VIS' AND (({@proc_days2} - reduction) IN [4 to 7])

   then count_7FSSVIS := count_7FSSVIS + 1 else

if {STORER.SUSR2} = 'FSS-MIN' AND (({@proc_days2} - reduction) IN [4 to 7])

   then count_7FSSMIN := count_7FSSMIN + 1 else

if {STORER.SUSR2} = 'NTW' AND (({@proc_days2} - reduction) IN [4 to 7])

   then count_7NTW := count_7NTW + 1 else

if {STORER.SUSR2} = 'NNS' AND (({@proc_days2} - reduction) IN [4 to 7])

   then count_7NNS := count_7NNS + 1 else

if {STORER.SUSR2} = 'NSM' AND (({@proc_days2} - reduction) IN [4 to 7])

   then count_7NSM := count_7NSM + 1 else

if {STORER.SUSR2} = 'NLZ' AND (({@proc_days2} - reduction) IN [4 to 7])

   then count_7NLZ := count_7NLZ + 1 else

if {STORER.SUSR2} = 'SLZ' AND (({@proc_days2} - reduction) IN [4 to 7])

   then count_7SLZ := count_7SLZ + 1 else

if {STORER.SUSR2} = 'MIN' AND (({@proc_days2} - reduction) IN [4 to 7])

   then count_7MIN := count_7MIN + 1 else

if {STORER.SUSR2} = 'VIS' AND (({@proc_days2} - reduction) IN [4 to 7])

   then count_7VIS := count_7VIS + 1) ELSE

count_3FSSNCR2+1

 

and i have this formula that if {RECEIPT.SUPPLIERCODE}='G001' so when a data has suppliercode of g001 it will automatically

reduce the proc_days2 by 3 cause of variable reduction. this formula works. it will produce "0" if this condition is correct

sample data

 

order    proc_days2     reduction(proc_days2 - 3)     0-3    4-7     8-14     15above

1                   0                       -3                                1         0         0            0

2                   3                         0                                1        0         0             0

3                   4                          1                               0         0         0            0

4                   3                           0                             1         0          0            0

5                    7                           4                             0         0        0            0


lets assume all orders has suppliercode of 'g001' that is why reduced has been executed. notice the order # 3 and 5. its final proc_days2 has been reduced by 3.that is why their category got rank down. so that order must be added on their correct category. for order# 3 it should fall to 0-3 category. so it should be 0-3 category + 1

for order # 5 it should fall to 4-7 category. so 4-7 category + 1.

right now report just showing zero if the condition above is true, but not adding those ranked down orders to their correct category.

sum of orders=5 but the sum of orders to all category is 3 only.


what i needed is  like


order    proc_days2     reduction(proc_days2 - 3)     0-3    4-7     8-14     15above

1                   0                       -3                                1         0         0            0

2                   3                         0                                1        0         0             0

3                   4                          1                               1         0         0            0

4                   3                           0                             1         0          0            0

5                    7                           4                             0         1        0            0


with that output. total orders must be equal to sum of orders to all category


Viewing all articles
Browse latest Browse all 8436

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>