Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trouble with grouping

Status
Not open for further replies.

raja2008

Technical User
Apr 16, 2008
265
US
Hello Everyone!

Using Crystal XI and SQL Server

Here is my problem ,I want to group something like this.


ABC123 20
123 30
345 10
567 5
ABC 15
ABC345 5
123 7
345 12
456 13
ABC123 7

This is how the data is and i want to group based on the ABC*** .It's not lilke i want to group those values.
Basically i have add up the values from ABC123 to just before ABC345 and then ABC345 to just before ABC123.
It should look like this.

ABC123 90(20,30,10,5,15)
ABC345 37(5,7,12,13)
ABC123 7

Can i do this and how.

Can i group them and sum.

Please advise.

 
You have to identify the logic that is determining this order, e.g., is this order determined by some other field? Why do those values belong together? You need to be able to identify the logic so that you can accomplish your goal.

-LB
 
Thank You for the response LBass.Sorry about that.

here we go:

This is about scanned documents.
ABC123 is the barcode of the person that scnas the documents(Bardata is the field name).
the person scans a bunch of documents,I have to get the count.
The problem is the scanner breaks 25 documents into one batch and gives some pther Bardata to the other batches other than ABC123.This is where i have trouble.
The 123,345 ans so on before ABC345 are from the same bunch.That's the reason i have to sum them up to get the total for that Bardata.

Now one more problem there can be other batches in between.
But the batchnames for this bunch takes consecutive numbers like Batch1,batch2,Batch3.

I have nothing unique for these batches from the same bunch.

Ok But there is one more field called DocID which increments only for the documents in this bunch eventhough the batchname changes.

Please let me know if this doesn't help.

 
Okay, please show some sample data that uses the BatchName, the Doc ID, and the barcode field.

-LB
 
BatchID Operator BatchName BarData DocI DocCnt
106,219 55 RPB2_mp bcode no MP1002 1 31
106,219 55 RPB2_mp bcode no 97MI 2 31
106,219 55 RPB2_mp bcode no 646E 3 31
106,219 55 RPB2_mp bcode no 97 5 31
106,219 55 RPB2_mp bcode no 97 6 31
106,219 55 RPB2_mp bcode no 97AS 7 31
106,219 55 RPB2_mp bcode no 646E 8 31
106,219 55 RPB2_mp bcode no 646E 10 31
106,219 55 RPB2_mp bcode no 646E 12 31
106,219 55 RPB2_mp bcode no 646E 14 31
106,219 55 RPB2_mp bcode no 97 16 31
106,219 55 RPB2_mp bcode no 518 17 31
106,219 55 RPB2_mp bcode no 518-0604 18 31
106,219 55 RPB2_mp bcode no 97AS 20 31
106,219 55 RPB2_mp bcode no 97AS 21 31
106,219 55 RPB2_mp bcode no 97AS 22 31
106,219 55 RPB2_mp bcode no 97AS 23 31
106,219 55 RPB2_mp bcode no 97AS 24 31
106,219 55 RPB2_mp bcode no 97AS 25 31
106,219 55 RPB2_mp bcode no 97AS 26 31
106,219 55 RPB2_mp bcode no 97 27 31
106,219 55 RPB2_mp bcode no 97 28 31
106,219 55 RPB2_mp bcode no 97AS 29 31
106,219 55 RPB2_mp bcode no 97AS 30 31
106,219 55 RPB2_mp bcode no 97AS 31 31
106,219 55 RPB2_mp bcode no 97 32 31
106,220 52 0426 DB 2008-07-25 SIG VOUCHERS 1 37
106,221 55 RPB2_mp bcode no 97AS 33 29
106,221 55 RPB2_mp bcode no 97 36 29
106,221 55 RPB2_mp bcode no 97MI 38 29
106,221 55 RPB2_mp bcode no 577 39 29
106,221 55 RPB2_mp bcode no 624 40 29
106,221 55 RPB2_mp bcode no 97AS 42 29
106,221 55 RPB2_mp bcode no 97AS 43 29
106,221 55 RPB2_mp bcode no 97AS 44 29
106,221 55 RPB2_mp bcode no 97AS 45 29
106,221 55 RPB2_mp bcode no 97 46 29
106,221 55 RPB2_mp bcode no 97 47 29
106,221 55 RPB2_mp bcode no 97 48 29
106,221 55 RPB2_mp bcode no 97AS 49 29
106,221 55 RPB2_mp bcode no 97AS 50 29
106,221 55 RPB2_mp bcode no 97AS 51 29
106,221 55 RPB2_mp bcode no 97AS 52 29
106,221 55 RPB2_mp bcode no 97AS 53 29
106,221 55 RPB2_mp bcode no 97AS 54 29
106,221 55 RPB2_mp bcode no 97 55 29
106,221 55 RPB2_mp bcode no 97AS 56 29
106,221 55 RPB2_mp bcode no 97AS 57 29
106,221 55 RPB2_mp bcode no 97MI 58 29
106,221 55 RPB2_mp bcode no 97MI 59 29
106,221 55 RPB2_mp bcode no 97 60 29
106,221 55 RPB2_mp bcode no 97 61 29
106,222 55 RPB2_mp bcode no 97 62 25
106,222 55 RPB2_mp bcode no 97 63 25
106,222 55 RPB2_mp bcode no 97AS 64 25
106,222 55 RPB2_mp bcode no 97 65 25
106,222 55 RPB2_mp bcode no 97 66 25

8BatchID Operator BatchName BarData DocI DocCnt
106,222 55 RPB2_mp bcode no 97 67 25
106,222 55 RPB2_mp bcode no 97 68 25
106,222 55 RPB2_mp bcode no 97MI 69 25
106,222 55 RPB2_mp bcode no 97 70 25
106,222 55 RPB2_mp bcode no 97 71 25
106,222 55 RPB2_mp bcode no 97 72 25
106,222 55 RPB2_mp bcode no 97 73 25
106,222 55 RPB2_mp bcode no 97 74 25
106,222 55 RPB2_mp bcode no 97 75 25
106,222 55 RPB2_mp bcode no 97 76 25
106,222 55 RPB2_mp bcode no 97 77 25
106,222 55 RPB2_mp bcode no 97 78 25
106,222 55 RPB2_mp bcode no 97 79 25
106,222 55 RPB2_mp bcode no 97 80 25
106,222 55 RPB2_mp bcode no 97 81 25
106,222 55 RPB2_mp bcode no 97 82 25
106,222 55 RPB2_mp bcode no 97MI 83 25
106,222 55 RPB2_mp bcode no 97MI 84 25
106,222 55 RPB2_mp bcode no 97MI 85 25
106,222 55 RPB2_mp bcode no 97AS 86 25
106,223 52 0427 DB 2008-07-25 SJT VOUCHERS 1 76
106,224 55 RPB2_mp bcode no 97AS 87 25
106,224 55 RPB2_mp bcode no 97AS 88 25
106,224 55 RPB2_mp bcode no 97AS 89 25
106,224 55 RPB2_mp bcode no 97AS 90 25
106,224 55 RPB2_mp bcode no 97AS 91 25
106,224 55 RPB2_mp bcode no 97MI 92 25
106,224 55 RPB2_mp bcode no 97MI 93 25
106,224 55 RPB2_mp bcode no 97MI 94 25
106,224 55 RPB2_mp bcode no 97MI 95 25
106,224 55 RPB2_mp bcode no 97 96 25
106,224 55 RPB2_mp bcode no 97 97 25
106,224 55 RPB2_mp bcode no 97 98 25
106,224 55 RPB2_mp bcode no 97 99 25
106,224 55 RPB2_mp bcode no 97 100 25
106,224 55 RPB2_mp bcode no 97 101 25
106,224 55 RPB2_mp bcode no 97 102 25
106,224 55 RPB2_mp bcode no 97 103 25
106,224 55 RPB2_mp bcode no 97 104 25
106,224 55 RPB2_mp bcode no 97 105 25
106,224 55 RPB2_mp bcode no 97 106 25
106,224 55 RPB2_mp bcode no 97MI 107 25
106,224 55 RPB2_mp bcode no 97 108 25
106,224 55 RPB2_mp bcode no 97AS 109 25
106,224 55 RPB2_mp bcode no 97AS 110 25
106,224 55 RPB2_mp bcode no 97AS 111 25
106,225 55 RPB2_mp bcode no 97AS 112 25
106,225 55 RPB2_mp bcode no 97MI 113 25
106,225 55 RPB2_mp bcode no 97MI 114 25
106,225 55 RPB2_mp bcode no 97MI 115 25
106,225 55 RPB2_mp bcode no 97AS 116 25
106,225 55 RPB2_mp bcode no 97MI 117 25
106,225 55 RPB2_mp bcode no 97MI 118 25
106,225 55 RPB2_mp bcode no 97AS 119 25
106,225 55 RPB2_mp bcode no 97MI 120 25
106,225 55 RPB2_mp bcode no 97MI 121 25
106,225 55 RPB2_mp bcode no 97MI 122 25
106,225 55 RPB2_mp bcode no 97MI 123 25


2

8BatchID Operator BatchName BarData DocI DocCnt
106,225 55 RPB2_mp bcode no 97AS 124 25
106,225 55 RPB2_mp bcode no 97AS 125 25
106,225 55 RPB2_mp bcode no 97MI 126 25
106,225 55 RPB2_mp bcode no 97 127 25
106,225 55 RPB2_mp bcode no 97 128 25
106,225 55 RPB2_mp bcode no 97AS 129 25
106,225 55 RPB2_mp bcode no 97AS 130 25
106,225 55 RPB2_mp bcode no 97 131 25
106,225 55 RPB2_mp bcode no 97 132 25
106,225 55 RPB2_mp bcode no 97 133 25
106,225 55 RPB2_mp bcode no 97AS 134 25
106,225 55 RPB2_mp bcode no 97AS 135 25
106,225 55 RPB2_mp bcode no 97AS 136 25
106,226 55 RPB2_mp bcode no 97AS 137 25
106,226 55 RPB2_mp bcode no 97AS 138 25
 
hello lbass!

MP1002 is the Bardata in the first batch 106219 there are 31 documents and 106220 is not associated with this 106221 is the continuation as you see the DocID is increasing for the 106221.There are altogether 173 documents in thi Bunch for MP1002.
As you noticed it is changing the Bardata value from MP1002 to somethingelse in the next batch eventhough it is from the same bunch.


Hope I'm clear,
 
Is the batchname always the same for each "bunch"? Would that distinguish the clusters if you grouped on that?

-LB
 
No the batchname changes for every batch which is 25 documents.
The batchname,batchid,bardata changes for every 25 documents.

But the the full batchname didn't come up here :
here is how it is
RPB2_mp bcode no route date-036 and the next batches for this bunch go with 37,38,39 and so on.
 
Sorry but I don't see this change per 25 records in your sample above--they all say: RPB2_mp bcode no

-LB
 
Thank YouLBass here it is

106,219 55 RPB2_mp bcode no route_08182008_036 MP1002 1 31
106,219 55 RPB2_mp bcode no route_08182008_036 97MI 2 31
106,219 55 RPB2_mp bcode no route_08182008_036 646E 3 31
106,219 55 RPB2_mp bcode no route_08182008_036 97 5 31
106,219 55 RPB2_mp bcode no route_08182008_036 97 6 31
106,219 55 RPB2_mp bcode no route_08182008_036 97AS 7 31
106,219 55 RPB2_mp bcode no route_08182008_036 646E 8 31
106,219 55 RPB2_mp bcode no route_08182008_036 646E 10 31
106,219 55 RPB2_mp bcode no route_08182008_036 646E 12 31
106,219 55 RPB2_mp bcode no route_08182008_036 646E 14 31
106,219 55 RPB2_mp bcode no route_08182008_036 97 16 31
106,219 55 RPB2_mp bcode no route_08182008_036 518 17 31
106,219 55 RPB2_mp bcode no route_08182008_036 518-0604 18 31
106,219 55 RPB2_mp bcode no route_08182008_036 97AS 20 31
106,219 55 RPB2_mp bcode no route_08182008_036 97AS 21 31
106,219 55 RPB2_mp bcode no route_08182008_036 97AS 22 31
106,219 55 RPB2_mp bcode no route_08182008_036 97AS 23 31
106,219 55 RPB2_mp bcode no route_08182008_036 97AS 24 31
106,219 55 RPB2_mp bcode no route_08182008_036 97AS 25 31
106,219 55 RPB2_mp bcode no route_08182008_036 97AS 26 31
106,219 55 RPB2_mp bcode no route_08182008_036 97 27 31
106,219 55 RPB2_mp bcode no route_08182008_036 97 28 31
106,219 55 RPB2_mp bcode no route_08182008_036 97AS 29 31
106,219 55 RPB2_mp bcode no route_08182008_036 97AS 30 31
106,219 55 RPB2_mp bcode no route_08182008_036 97AS 31 31
106,219 55 RPB2_mp bcode no route_08182008_036 97 32 31
106,220 52 0426 DB 2008-07-25 SIG VOUCHERS 1 37
106,221 55 RPB2_mp bcode no route_08182008_037 97AS 33 29
106,221 55 RPB2_mp bcode no route_08182008_037 97 36 29
106,221 55 RPB2_mp bcode no route_08182008_037 97MI 38 29
106,221 55 RPB2_mp bcode no route_08182008_037 577 39 29
106,221 55 RPB2_mp bcode no route_08182008_037 624 40 29
106,221 55 RPB2_mp bcode no route_08182008_037 97AS 42 29
106,221 55 RPB2_mp bcode no route_08182008_037 97AS 43 29
106,221 55 RPB2_mp bcode no route_08182008_037 97AS 44 29
106,221 55 RPB2_mp bcode no route_08182008_037 97AS 45 29
106,221 55 RPB2_mp bcode no route_08182008_037 97 46 29
106,221 55 RPB2_mp bcode no route_08182008_037 97 47 29
106,221 55 RPB2_mp bcode no route_08182008_037 97 48 29
106,221 55 RPB2_mp bcode no route_08182008_037 97AS 49 29
106,221 55 RPB2_mp bcode no route_08182008_037 97AS 50 29
106,221 55 RPB2_mp bcode no route_08182008_037 97AS 51 29
106,221 55 RPB2_mp bcode no route_08182008_037 97AS 52 29
106,221 55 RPB2_mp bcode no route_08182008_037 97AS 53 29
106,221 55 RPB2_mp bcode no route_08182008_037 97AS 54 29
106,221 55 RPB2_mp bcode no route_08182008_037 97 55 29
106,221 55 RPB2_mp bcode no route_08182008_037 97AS 56 29
106,221 55 RPB2_mp bcode no route_08182008_037 97AS 57 29
106,221 55 RPB2_mp bcode no route_08182008_037 97MI 58 29
106,221 55 RPB2_mp bcode no route_08182008_037 97MI 59 29
106,221 55 RPB2_mp bcode no route_08182008_037 97 60 29
106,221 55 RPB2_mp bcode no route_08182008_037 97 61 29
106,222 55 RPB2_mp bcode no route_08182008_038 97 62 25
106,222 55 RPB2_mp bcode no route_08182008_038 97 63 25
106,222 55 RPB2_mp bcode no route_08182008_038 97AS 64 25
106,222 55 RPB2_mp bcode no route_08182008_038 97 65 25
106,222 55 RPB2_mp bcode no route_08182008_038 97 66 25
106,222 55 RPB2_mp bcode no route_08182008_038 97 67 25
106,222 55 RPB2_mp bcode no route_08182008_038 97 68 25
106,222 55 RPB2_mp bcode no route_08182008_038 97MI 69 25
106,222 55 RPB2_mp bcode no route_08182008_038 97 70 25
106,222 55 RPB2_mp bcode no route_08182008_038 97 71 25
106,222 55 RPB2_mp bcode no route_08182008_038 97 72 25
106,222 55 RPB2_mp bcode no route_08182008_038 97 73 25
106,222 55 RPB2_mp bcode no route_08182008_038 97 74 25
106,222 55 RPB2_mp bcode no route_08182008_038 97 75 25
106,222 55 RPB2_mp bcode no route_08182008_038 97 76 25
106,222 55 RPB2_mp bcode no route_08182008_038 97 77 25
106,222 55 RPB2_mp bcode no route_08182008_038 97 78 25
106,222 55 RPB2_mp bcode no route_08182008_038 97 79 25
106,222 55 RPB2_mp bcode no route_08182008_038 97 80 25
106,222 55 RPB2_mp bcode no route_08182008_038 97 81 25
106,222 55 RPB2_mp bcode no route_08182008_038 97 82 25
106,222 55 RPB2_mp bcode no route_08182008_038 97MI 83 25
106,222 55 RPB2_mp bcode no route_08182008_038 97MI 84 25
106,222 55 RPB2_mp bcode no route_08182008_038 97MI 85 25
106,222 55 RPB2_mp bcode no route_08182008_038 97AS 86 25
106,223 52 0427 DB 2008-07-25 SJT VOUCHERS 1 76
106,224 55 RPB2_mp bcode no route_08182008_039 97AS 87 25
106,224 55 RPB2_mp bcode no route_08182008_039 97AS 88 25
106,224 55 RPB2_mp bcode no route_08182008_039 97AS 89 25
106,224 55 RPB2_mp bcode no route_08182008_039 97AS 90 25
106,224 55 RPB2_mp bcode no route_08182008_039 97AS 91 25
106,224 55 RPB2_mp bcode no route_08182008_039 97MI 92 25
106,224 55 RPB2_mp bcode no route_08182008_039 97MI 93 25
106,224 55 RPB2_mp bcode no route_08182008_039 97MI 94 25
106,224 55 RPB2_mp bcode no route_08182008_039 97MI 95 25
106,224 55 RPB2_mp bcode no route_08182008_039 97 96 25
106,224 55 RPB2_mp bcode no route_08182008_039 97 97 25
106,224 55 RPB2_mp bcode no route_08182008_039 97 98 25
106,224 55 RPB2_mp bcode no route_08182008_039 97 99 25
106,224 55 RPB2_mp bcode no route_08182008_039 97 100 25
106,224 55 RPB2_mp bcode no route_08182008_039 97 101 25
106,224 55 RPB2_mp bcode no route_08182008_039 97 102 25
106,224 55 RPB2_mp bcode no route_08182008_039 97 103 25
106,224 55 RPB2_mp bcode no route_08182008_039 97 104 25
106,224 55 RPB2_mp bcode no route_08182008_039 97 105 25
106,224 55 RPB2_mp bcode no route_08182008_039 97 106 25
106,224 55 RPB2_mp bcode no route_08182008_039 97MI 107 25
106,224 55 RPB2_mp bcode no route_08182008_039 97 108 25
106,224 55 RPB2_mp bcode no route_08182008_039 97AS 109 25
106,224 55 RPB2_mp bcode no route_08182008_039 97AS 110 25
106,224 55 RPB2_mp bcode no route_08182008_039 97AS 111 25
106,225 55 RPB2_mp bcode no route_08182008_040 97AS 112 25
106,225 55 RPB2_mp bcode no route_08182008_040 97MI 113 25
106,225 55 RPB2_mp bcode no route_08182008_040 97MI 114 25
106,225 55 RPB2_mp bcode no route_08182008_040 97MI 115 25
106,225 55 RPB2_mp bcode no route_08182008_040 97AS 116 25
106,225 55 RPB2_mp bcode no route_08182008_040 97MI 117 25
106,225 55 RPB2_mp bcode no route_08182008_040 97MI 118 25
106,225 55 RPB2_mp bcode no route_08182008_040 97AS 119 25
106,225 55 RPB2_mp bcode no route_08182008_040 97MI 120 25
106,225 55 RPB2_mp bcode no route_08182008_040 97MI 121 25
106,225 55 RPB2_mp bcode no route_08182008_040 97MI 122 25
106,225 55 RPB2_mp bcode no route_08182008_040 97MI 123 25
106,225 55 RPB2_mp bcode no route_08182008_040 97AS 124 25
106,225 55 RPB2_mp bcode no route_08182008_040 97AS 125 25
106,225 55 RPB2_mp bcode no route_08182008_040 97MI 126 25
106,225 55 RPB2_mp bcode no route_08182008_040 97 127 25
106,225 55 RPB2_mp bcode no route_08182008_040 97 128 25
106,225 55 RPB2_mp bcode no route_08182008_040 97AS 129 25
106,225 55 RPB2_mp bcode no route_08182008_040 97AS 130 25
106,225 55 RPB2_mp bcode no route_08182008_040 97 131 25
106,225 55 RPB2_mp bcode no route_08182008_040 97 132 25
106,225 55 RPB2_mp bcode no route_08182008_040 97 133 25
106,225 55 RPB2_mp bcode no route_08182008_040 97AS 134 25
106,225 55 RPB2_mp bcode no route_08182008_040 97AS 135 25
106,225 55 RPB2_mp bcode no route_08182008_040 97AS 136 25
106,226 55 RPB2_mp bcode no route_08182008_041 97AS 137 25
106,226 55 RPB2_mp bcode no route_08182008_041 97AS 138 25
106,226 55 RPB2_mp bcode no route_08182008_041 97AS 139 25
106,226 55 RPB2_mp bcode no route_08182008_041 97AS 140 25
106,226 55 RPB2_mp bcode no route_08182008_041 97 141 25
106,226 55 RPB2_mp bcode no route_08182008_041 97 142 25
106,226 55 RPB2_mp bcode no route_08182008_041 97 143 25
106,226 55 RPB2_mp bcode no route_08182008_041 97 144 25
106,226 55 RPB2_mp bcode no route_08182008_041 97 145 25
106,226 55 RPB2_mp bcode no route_08182008_041 97 146 25
106,226 55 RPB2_mp bcode no route_08182008_041 97 147 25
106,226 55 RPB2_mp bcode no route_08182008_041 97 148 25
106,226 55 RPB2_mp bcode no route_08182008_041 97 149 25
106,226 55 RPB2_mp bcode no route_08182008_041 97 150 25
106,226 55 RPB2_mp bcode no route_08182008_041 97 151 25
106,226 55 RPB2_mp bcode no route_08182008_041 97 152 25
106,226 55 RPB2_mp bcode no route_08182008_041 975 153 25
106,226 55 RPB2_mp bcode no route_08182008_041 97AS 154 25
106,226 55 RPB2_mp bcode no route_08182008_041 97AS 155 25
106,226 55 RPB2_mp bcode no route_08182008_041 97AS 156 25
106,226 55 RPB2_mp bcode no route_08182008_041 97 157 25
106,226 55 RPB2_mp bcode no route_08182008_041 97AS 158 25
106,226 55 RPB2_mp bcode no route_08182008_041 97AS 159 25
106,226 55 RPB2_mp bcode no route_08182008_041 97AS 160 25
106,226 55 RPB2_mp bcode no route_08182008_041 646E 161 25
106,227 55 RPB2_mp bcode no route_08182008_042 518 162 12
106,227 55 RPB2_mp bcode no route_08182008_042 518 163 12
106,227 55 RPB2_mp bcode no route_08182008_042 97 164 12
106,227 55 RPB2_mp bcode no route_08182008_042 97 165 12
106,227 55 RPB2_mp bcode no route_08182008_042 97MI 166 12
106,227 55 RPB2_mp bcode no route_08182008_042 97 167 12
106,227 55 RPB2_mp bcode no route_08182008_042 97MI 168 12
106,227 55 RPB2_mp bcode no route_08182008_042 97MI 169 12
106,227 55 RPB2_mp bcode no route_08182008_042 97AS 170 12
106,227 55 RPB2_mp bcode no route_08182008_042 97AS 171 12
106,227 55 RPB2_mp bcode no route_08182008_042 97AS 172 12
106,227 55 RPB2_mp bcode no route_08182008_042 97AS 173 12
106,229 52 0330 DB 2008-08-08 ORG VOUCHERS 1 38
106,230 52 0331 DB 2008-08-08 MOY VOUCHERS 1 19
106,231 52 0332 DB 2008-08-08 GRT VOUCHERS 1 16
106,232 52 0333 DB 2008-08-08 VHO VOUCHERS 1 220
106,233 55 RPB2_mp bcode no route_08182008_043 MP1002 1 25
106,233 55 RPB2_mp bcode no route_08182008_043 596 2 25
106,233 55 RPB2_mp bcode no route_08182008_043 596 3 25
106,233 55 RPB2_mp bcode no route_08182008_043 596 4 25
106,233 55 RPB2_mp bcode no route_08182008_043 596 5 25
106,233 55 RPB2_mp bcode no route_08182008_043 596 6 25
106,233 55 RPB2_mp bcode no route_08182008_043 596 7 25
106,233 55 RPB2_mp bcode no route_08182008_043 596 8 25
106,233 55 RPB2_mp bcode no route_08182008_043 596 9 25
106,233 55 RPB2_mp bcode no route_08182008_043 596 10 25
106,233 55 RPB2_mp bcode no route_08182008_043 596 11 25
106,233 55 RPB2_mp bcode no route_08182008_043 596 12 25
106,233 55 RPB2_mp bcode no route_08182008_043 596 13 25
106,233 55 RPB2_mp bcode no route_08182008_043 596 14 25
106,233 55 RPB2_mp bcode no route_08182008_043 596 15 25
106,233 55 RPB2_mp bcode no route_08182008_043 596 16 25
106,233 55 RPB2_mp bcode no route_08182008_043 596 17 25


 
Try grouping by the operator field so you can don't have discontinuous "bunches". Then insert a detail_b section and create a formula to place there:

whileprintingrecords;
stringvar bunchname;
numbervar sumdocs;
if {table.DocI} = 1 then
bunchname := BarData;
if onfirstrecord or
{table.operator} <> previous({table.operator}) or
{table.DocI} >= previous({table.DocI}) then
sumdocs := sumdocs + {table.DocCnt} else
sumdocs := sumdocs;
bunchname + ": "+totext(sumdocs,0,"");

Then suppress the detail_a section. Next suppress the detail_b section with a formula:

not onlastrecord and
{table.DocI} < next({table.DocI})

Add a reset formula to detail_a:
whileprintingrecords;
numbervar sumdocs;
if {table.DocI} = 1 then
sumdocs := 0;

-LB
 
Hello LBass!

Thank You very much.I will test it out and let you know.
 
Hello LBass!

Here is one more problem.The operator id has nothing to do with the Bardata.
The same operator id can be the same for diff Bardata.

Again coming back to my question.

Can i group the data from one MP1002 until the other MP1002.

This way i can have totals at grouplevel and i can have a grand total at the report level.

I don't know if it makes sense.

 
I don't understand your first comment. And no you cannot group on that field. You haven't shown any field that indicates that rows belong to a particular MP record, so there is nothing to group on.

-LB
 
To answer operator id ,One person will start the scanner by entering his operator id which is not the same person that is going to scan them,So for anyone that scnas on that machine the operator id is the same.

OK here is the situation:

The barcode is the ID of the person that is scanning the documents.So,there are more than one ID starting with MP****.

Now based on the Date range and the Barcode ,I have to show the total documents under that Barcode.

I grouped them based on the BatchID

This is how the data might look like when i pull the data based on the daterange:
These are at the grouplevel.

BatchID Batchname Bardata DocCount
106,219 RPB2_mp bcode no route_08182008_036 MP1002 31
106,220 0333 DB 2008-08-08 VHO Vouchers 10
106,221 RPB2_mp bcode no route_08182008_037 97 25
'
'
'
106,232 RPB2_mp bcode no route_08182008_042 97 25
106,233 RPB2_mp bcode no route_08182008_043 MP1001 25
'
'
'
'
'
106,241 RPB2_mp bcode no route_08182008_054 MP1002 25
'
'
'
'106,255 RPB2_mp bcode no route_08182008_060 MP1002 25




Now if the user wants to see the total count for MP1002

I have to add the the document counts ,When i first hit the MP1002 my adding of the Document count should start,And it also should look for similar batchname since the second record has differrent batch name it doesn't belong to this bunch.I have to add until i hit the other MP****.
Here it hits MP1001 so,i don't want to add them until it hits Mp1002 again.

I want the total count at the end.

I don't need total for Mp1002 ,Total for MP1001 like that for now.

for now the user will pick only one Bardata.
Once iam done with this i will worry about that.

or if you think it's better to approach that way,Please lead me.

i hope this time i'm clear.
 
Can somebody give any leads or any ideas for achieving this.

Thnak You
 
Did you try my earlier suggestion? The point of grouping on the operator was to remove the records that were not part of the sequence--since it appears you ONLY have sequence as a mechanism to determine what goes with the "MP*" records. Was there some problem with doing this?
What results did you get?

-LB
 
Thank You LBass
I can't use the exact way you mentioned but i'm using the formula's of yours and modifying them to get the results i'm looking for.

I'm halfway there.
Still working on the final result.

Got so excited to see getting closer to want i want ,wanted to say thank you first.

I might be asking for your help later for the final solution.

Be back.

ThankYou .
 
Hello Everyone!

I'm almost there.I have a Parameter for dateRange and Bardata.

Let's say the first Bunch(has more than one BatchId's but not the same BarData) was scnned under MP1002 and second bunch(Morethan One BatchId) under MP1000.
All the batches beofre Mp1000 should come under Mp1002.

So i used your formula and created this to show me MP1002 until it sees Mp1000.This is working fine.

"Bardatareset":I used this formula:
whileprintingrecords;
stringvar bardatareset;
if lookslike({BarcodeTable.BarData},"MP????") then
bardatareset:={BarcodeTable.BarData};
bardatareset;


Group: BatchID
BatchId Batchname Bardata Bardatareset DocCnt TotalDOcs

I supressed the records based on the Bardata i picked in the Parameter like this:

bardatareset<>?bardata

I'm seeing what exactly i want to see.

Now the problem is How can i add these values up.

When i a formula it is adding even the supressed values.

I want to add only the non supressed values.

Please help.

Thank You

 
Thank You everyone.

I got it to work.

I used this formula:

whileprintingrecords;
numbervar totaltotaldocs;
totaltotaldocs:=totaltotaldocs+{@NewFormulaTotalDocs};
totaltotaldocs;

Then i used this to have the other values 0
evaluateafter({@NewBarDataResetFormula});
numbervar totaldocs;
if {@NewBarDataResetFormula}={?BarData} then totaldocs:={batchtable.DocCnt} else totaldocs:=0;
totaldocs;


And it worked.

i'm still in the middle.

Lot more to be done.

Probably i will be asking for help again. on this.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top