Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Grouping with field query... i Post Reply Post New Topic
Author Message
Seabass
Newbie
Newbie
Avatar

Joined: 06 Jun 2009
Location: United States
Online Status: Offline
Posts: 32
Quote Seabass Replybullet Topic: Grouping with field query... i
     Posted: 01 Feb 2010 at 8:10am

Here is a challenge for all you guys !!!! ...for me it is anyhow !!!   LOL

I have a field in a database that contains coding for a WBS... so for example, the following show what i need to query and what the grouping should be....
 
0000-0000-00000-M.000128.0002.0000
0000-0000-00000-I.000000.0000.0000
 
So i need to be able to group by the result of a formulas for 4 different scenarios.... from that 1 field.
 
Scenario #1 -- > 0000-0000-00000-M.000128.0001.0000
where the "M.??????.0001" = Group  #1
 
Scenario #2 -- > 0000-0000-00000-M.000128.0002.0000
where the "M.??????.0002" = Group  #2
 
Scenario #3 -- > 0000-0000-00000-M.000128.0003.0000
where the "M.??????.0003" = Group  #3
 
Scenario #4 -- > 0000-0000-00000-I.000128.0002.0000
where the "I" = Group  #4
 
The question ????? means that it sould be different digits for each records....the constant variable that allow me to "label" that group is the "M" and the 4 last digit of the group as shown...
For group #4, just the "I"
 
Any help would be greatly appreciated !!!!
 
IP IP Logged
FrnhtGLI
Senior Member
Senior Member
Avatar

Joined: 22 May 2009
Online Status: Offline
Posts: 347
Quote FrnhtGLI Replybullet Posted: 01 Feb 2010 at 8:54am

What about something like:

if 'M' in {@field} and '.0001.' in {@field}
     then 'Group 1'
else
etc....
else
if 'I' in {@field}
     then 'Group 4'
 
Group the records by {@field}.
IP IP Logged
Seabass
Newbie
Newbie
Avatar

Joined: 06 Jun 2009
Location: United States
Online Status: Offline
Posts: 32
Quote Seabass Replybullet Posted: 01 Feb 2010 at 9:06am
cool.. let me try thta...
 
first questions that comes to mind... between the M and the 4 digits, there is a sequence fo number... that are different but the number of digits will always be the same... how do i include that ??? i just realized that there is 2 "M" in the field.... so can i put the question marks instead of the digits ??? the 6 digits in between will be different for each records.....
 
if 'M.??????.0001' in {@field} and '.0001.' in {@field}
IP IP Logged
FrnhtGLI
Senior Member
Senior Member
Avatar

Joined: 22 May 2009
Online Status: Offline
Posts: 347
Quote FrnhtGLI Replybullet Posted: 01 Feb 2010 at 11:26am
I don't think that will work. Crystal will take it as a literal occurance and actually look for a record that comes across with question marks in it.
 
If the group is only dependant upon whether it has an M or an I and what the last 4 digits are, then I think what I proposed above will work for you.
 
Where is the second 'M' in the field?


Edited by FrnhtGLI - 01 Feb 2010 at 11:27am
IP IP Logged
Seabass
Newbie
Newbie
Avatar

Joined: 06 Jun 2009
Location: United States
Online Status: Offline
Posts: 32
Quote Seabass Replybullet Posted: 01 Feb 2010 at 11:48am

i checked with folsk that are more familiar with the data... there is only 12 different options all together so i build the formulas to take all of then in consideration and it's seems to work like a charm...

 
Appreciate your assistance !!!
 
Thanks
 
IP IP Logged
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