on 11-30-2015 6:53 PM
We have a report that we cannot get a formula to work, the report needs to pull where it looks at the first set of codes and then the second set of codes. We are using the 'and' statement and it seems to be ignoring the second set of codes, here is an example:
if code in ["z37.0" to "z37.5"] or code in ["z37.50" to "z37.54] and
code in ["072.0" to "07.2"] then true
The report seems to be ignoring the "072.0" to "07.2" statement as we are getting all of the patients that match the first set only.
Thanks.
Also, you need to think about how you want the data processed so that you can use parentheses to force the processing order. For example,
code in ["z37.0" to "z37.5"] or (code in ["z37.50" to "z37.54] and
code in ["072.0" to "07.2"] )
will return different results than
(code in ["z37.0" to "z37.5"] or code in ["z37.50" to "z37.54]) and
code in ["072.0" to "07.2"]
You should also avoid using "if" statements in the Select Expert - frequently they will not be passed to the database, causing Crystal to pull all data into memory and filter it there. This can cause significant slowness in the report. However, if you use the format that Abhilash and I provided, the filter formula will be pushed to the database where it can be processed more efficiently.
-Dell
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Curt,
I'm not too sure if this statement would ever evaluate to true:
code in ["z37.50" to "z37.54] and
code in ["072.0" to "07.2"]
-Abhilash
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.