can anyone suggest a cleaner way to write the foll...
# suiteanalytics
m
can anyone suggest a cleaner way to write the following saved search? i have this feeling i’m doubling up on criteria and it’s slowing it down
CASE WHEN MOD(TO_CHAR({today}, 'IW'), 2) = '1' THEN ( CASE WHEN {custentity_call_list_week} = 'Week 1' THEN 'Fortnightly on W1' ELSE '' END )
WHEN MOD(TO_CHAR({today}, 'IW'), 2) = '0' THEN ( CASE WHEN {custentity_call_list_week} = 'Week 2' THEN 'Fortnightly on W2' ELSE '' END )
ELSE ''
END
b
you only really have 3 cases odd weeks where custentity_call_list_week is Week 1 even weeks where custentity_call_list_week is Week 2 and an else case
you can combine comparison with AND, and simply use one else since all 3 of your are the same
that said, thats unlikely to really slow down your search by much, if at all
m
@battk cheers! yeah weird, it’s about 2 minutes with the field and 10 seconds without for 83 records