Tips and Tricks
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Tips and Tricks
Message Icon Topic: Need to group Data in series Post Reply Post New Topic
Author Message
sorlacm
Newbie
Newbie
Avatar

Joined: 21 Apr 2010
Location: Philippines
Online Status: Offline
Posts: 2
Quote sorlacm Replybullet Topic: Need to group Data in series
    Posted: 21 Apr 2010 at 10:45pm
How can I group  this kind of data
 ORNO  Amount
 2310    5
 2311    9
 2312    2
 3311    9
 3312    4
the output should look like this
 ORNO   Amount
  2310    5
  2311    9
  2312    2
 Subtotal
 
 3311    9
 3312    4
Subtotal
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 22 Apr 2010 at 3:41am

depends if the orno is a number or string but, it would appear to be the first 2 digits,

if String:
group by left({table.orno}, 2)
 
if number:
group by int({table.orno}/100)
 
HTH
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 22 Apr 2010 at 3:41am
Depends. I think you are asking if you can group on first 2 characters of your ORNO field.
You can create a formula to extract that and then group on the formula field. How to extract depends on what type of field ORNO is.
if it is a string then
left(table.orno,2)
 
if it is numeric
left(totext(table.orno),2)
 
 
Sorry Lockwelle,
posting at the same time as you Smile


Edited by DBlank - 22 Apr 2010 at 3:42am
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 22 Apr 2010 at 3:46am
No problem...obviously we both saw the same issues.
 
the only potential problem I see with DBlank's solution is if there is only 3 digits in the orno....but that same could be said of both of ours if it is a string.
 
Hmmm....


Edited by lockwelle - 22 Apr 2010 at 3:47am
IP IP Logged
sorlacm
Newbie
Newbie
Avatar

Joined: 21 Apr 2010
Location: Philippines
Online Status: Offline
Posts: 2
Quote sorlacm Replybullet Posted: 23 Apr 2010 at 12:58am

well thanks for the reply guys,  I got the idea.. finaly I have the correct output.

IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.000 seconds.