This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
I am attempting to apply same filter conditions for multiple numeric fields but the results are not showing as expected. Can you please help? Below is my custom filter condition.
([FACTORED_DEFFERED]) != 0 AND
([FACTORED_AGE_91_TO_120]) != 0 OR
([FACTORED_AGE_121_TO_150]) != 0 OR
([FACTORED_AGE_151_TO_180]) != 0 OR
([FACTORED_AGED_181_TO_270]) != 0 OR
([FACTORED_AGE_271_TO_360]) != 0 OR
([FACTORED_AGE_361_TO_720]) != 0 OR
([FACTORED_AGE_721_TO_1080]) != 0 OR
([FACTORED_AGE_1080_PLUS]) != 0
What am I doing wrong? My goal is to pull only rows that have factored deferred amounts !0 and any of the other columns as !0.
Looks like this is an order of operations issue - you just need to add parentheses around your block of OR statements as follows so it checks for all the OR scenarios at once.
([FACTORED_DEFFERED]) != 0 AND
( ([FACTORED_AGE_91_TO_120]) != 0 OR
([FACTORED_AGE_121_TO_150]) != 0 OR
([FACTORED_AGE_151_TO_180]) != 0 OR
([FACTORED_AGED_181_TO_270]) != 0 OR
([FACTORED_AGE_271_TO_360]) != 0 OR
([FACTORED_AGE_361_TO_720]) != 0 OR
([FACTORED_AGE_721_TO_1080]) != 0 OR
([FACTORED_AGE_1080_PLUS]) != 0 )
Cheers,
NJ
@Dimple You can also replace Or statements with an In statement like so:
([FACTORED_DEFFERED]) != 0 AND
0 not in
([FACTORED_AGE_91_TO_120],
[FACTORED_AGE_121_TO_150],
[FACTORED_AGE_151_TO_180],
[FACTORED_AGED_181_TO_270],
[FACTORED_AGE_271_TO_360],
[FACTORED_AGE_361_TO_720],
[FACTORED_AGE_721_TO_1080],
[FACTORED_AGE_1080_PLUS])
EDIT: I misread your post. My solution wouldn't be solving quite the same logic that you posted.