JeremyT Posted February 19, 2014 Share Posted February 19, 2014 I am working on a merge where a chart picture is inserted that shows claims from 2012 and 2013. If there are no claims I don't want the empty chart to show up. Originally I wrote my rule so that if the 2012 and 2013 claims totals did not equal '$0.00 ' it would insert a picture. Unfortunately, it did not add charts that only had claims in 2012. So, if 2013 claims were $0.00 it did not add a picture. Here is the rule that does not work: if (Field("2012 Claims Total") != '$0.00 ' && Field("2013 Claims Total") != '$0.00 ') return CreateResource("/Users/Desktop/Projects/Fee Mailing/Merge Links/Chart Samples/" + (Field("@ClaimsChart"))); I rewrote the rule so that if 2012 and 2013 claims totals equaled $0.00 it would return a null resource, else it would return the claim chart. This rule works: if (Field("2012 Claims Total") == '$0.00 ' && Field("2013 Claims Total") == '$0.00 ') return NullResource() else return CreateResource("/Users//Desktop/Projects/Fee Mailing/Merge Links/Chart Samples/" + (Field("@ClaimsChart"))) What am I missing to get the first code to work correctly? Thanks, Jeremy Quote Link to comment Share on other sites More sharing options...
ThomasLewis Posted February 19, 2014 Share Posted February 19, 2014 Change your original rule to be an OR || instead of an AND && and it should work. I think your new rule is better though. Quote Link to comment Share on other sites More sharing options...
JeremyT Posted February 19, 2014 Author Share Posted February 19, 2014 Change your original rule to be an OR || instead of an AND && and it should work. I think your new rule is better though. I need it to not show the graph if both 2012 and 2013 claims are $0.00, so using OR || wouldn't work. Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted February 19, 2014 Share Posted February 19, 2014 I need it to not show the graph if both 2012 and 2013 claims are $0.00, so using OR || wouldn't work. Right, but conversely, you need to show the graph if either 2012 OR 2013 claims are NOT zero. Think about it: If the either order is not zero, then both can't be zero. The use of the != (not equal) operator changes things. More generally, with Boolean logic, the converse of "if A and B" is "if not A OR not B", not "if not A and not B". So Thomas is correct. Try it and see. Quote Link to comment Share on other sites More sharing options...
JeremyT Posted February 20, 2014 Author Share Posted February 20, 2014 OR || produces the results needed. Thanks for the help! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.