Print Page | Close Window

Need help with filtering

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=12214
Printed Date: 29 Apr 2024 at 6:00pm


Topic: Need help with filtering
Posted By: 4sue2c
Subject: Need help with filtering
Date 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.



Replies:
Posted By: FrnhtGLI
Date Posted: 03 Feb 2011 at 2:30am
Maybe try something like:
 
If {table.productsold}="certain product"
     then {table.invoicenumber}
          else ''


-------------
|< /\ '][' ( )


Posted By: 4sue2c
Date 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


Posted By: DBlank
Date 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
 


Posted By: FrnhtGLI
Date 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 ''.

-------------
|< /\ '][' ( )


Posted By: 4sue2c
Date 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."


Posted By: 4sue2c
Date Posted: 03 Feb 2011 at 6:06am
Thanks again but this doesn't work either.


Posted By: DBlank
Date 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.
 
 


Posted By: 4sue2c
Date Posted: 03 Feb 2011 at 3:03pm
I tried that but in the editor it says "The ) is missing."


Posted By: JohnT
Date Posted: 08 Feb 2011 at 4:54am
Would you post the exact line you entered when you got the error message ?



Print Page | Close Window