Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Need help with filtering Post Reply Post New Topic
Author Message
4sue2c
Newbie
Newbie
Avatar

Joined: 02 Feb 2011
Location: Canada
Online Status: Offline
Posts: 10
Quote 4sue2c Replybullet Topic: Need help with filtering
    Posted: 02 Feb 2011 at 6:12pm
I have a sales report showing Invoice number, product sold, and other info. I want to show only the invoices with a certain product sold and show all the other products sold on that invoice.  Not just that one product. How do I do this? I'm new to this. Thanks.
IP IP Logged
FrnhtGLI
Senior Member
Senior Member
Avatar

Joined: 22 May 2009
Online Status: Offline
Posts: 347
Quote FrnhtGLI Replybullet Posted: 03 Feb 2011 at 2:30am
Maybe try something like:
 
If {table.productsold}="certain product"
     then {table.invoicenumber}
          else ''
|< /\ '][' ( )
IP IP Logged
4sue2c
Newbie
Newbie
Avatar

Joined: 02 Feb 2011
Location: Canada
Online Status: Offline
Posts: 10
Quote 4sue2c Replybullet Posted: 03 Feb 2011 at 4:12am
First thank you very much for replying. I tried your suggestion but it's not working, it reads: The matching " for this string is missing.  Any other suggestions are greatly appreciated. Thanks
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 03 Feb 2011 at 4:34am
If I understand your question I would recommend a different approach.
What I think you want is to filter by group (invoice) where any record in the group is equal to a specific product.
For a crystal only solution you can create a formula to flag the records you want to keep.
As an example:
formula 'flag' as
if field = 'specific product' then 1
group on invoice number
Now summarize 'flag' as a SUM at the invoice group level
Now any group that had the value you are looking for has a value >0 and all the others = 0.
Go into the select expert and change it to use 'group select' and add your criteria here
SUM(flag,invoice)>0
 


Edited by DBlank - 03 Feb 2011 at 4:39am
IP IP Logged
FrnhtGLI
Senior Member
Senior Member
Avatar

Joined: 22 May 2009
Online Status: Offline
Posts: 347
Quote FrnhtGLI Replybullet Posted: 03 Feb 2011 at 4:35am
Sorry. My quote marks are two single quote marks not one double quote mark. If you used a double quote mark then make it "" or use two single quote marks ''.
|< /\ '][' ( )
IP IP Logged
4sue2c
Newbie
Newbie
Avatar

Joined: 02 Feb 2011
Location: Canada
Online Status: Offline
Posts: 10
Quote 4sue2c Replybullet Posted: 03 Feb 2011 at 6:04am
Thanks for your response and please be patient with me. I don't quite understand "formula 'flag' as" means but I tried what you wrote with product sold as flag and when I entered, "SUM(flag,invoice)>0" (entered product sold instead of flag it read, "The ) is missing."
IP IP Logged
4sue2c
Newbie
Newbie
Avatar

Joined: 02 Feb 2011
Location: Canada
Online Status: Offline
Posts: 10
Quote 4sue2c Replybullet Posted: 03 Feb 2011 at 6:06am
Thanks again but this doesn't work either.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 03 Feb 2011 at 6:11am
Flag is just the name of a formula, you can call it whatever you want.
the formula in a new formual fierld, NOT the select expert will look something like:
If {table.productsold}="certain product" then 1
 
Now insert a Summary using this fomrula field (I called 'flag')
Click ont her Sigma sign (looks like an E)
select the formula field name
calculate the summary as: SUM
Summary location = group footer - select the invoice number group
This wil insert a summary field in the group footer.
 
 


Edited by DBlank - 08 Feb 2011 at 4:41am
IP IP Logged
4sue2c
Newbie
Newbie
Avatar

Joined: 02 Feb 2011
Location: Canada
Online Status: Offline
Posts: 10
Quote 4sue2c Replybullet Posted: 03 Feb 2011 at 3:03pm
I tried that but in the editor it says "The ) is missing."
IP IP Logged
JohnT
Groupie
Groupie
Avatar

Joined: 20 Jan 2008
Online Status: Offline
Posts: 92
Quote JohnT Replybullet Posted: 08 Feb 2011 at 4:54am
Would you post the exact line you entered when you got the error message ?
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.031 seconds.