Question:
I want to create one report wherein I need to include only those
e_id
whose ref_id
is not null and sys_other
is either Email or null
. Other than this combination, that e_id
will not be considered in the report. For ex:e_id = 122
it should come in report as ref_id
is not null and sys_other
is nulle_id = 6122
it should not come in report as ref_id
is nulle_id = 805
it should also not come in report where ref_id
is not null but in sys_other
we have value other than Email and null
which is Test
so we should exclude this e_idLogic: Basically, need to check two columns ref_id and sys_other. If ref_id is null then we should exclude those e_id and if it is not null then need to check sys_other column and if it has ‘Email’ than include otherwise exclude irrespective of column sys_name
My Attempt:
Expected output:
Answer:
You can try:e_id
and for each group:- count the non-null
ref_id
and ensure that there is as least 1 row and - count the non-null
sya_other
values that are notEmail
and ensure that there are no rows that are non-null, non-email rows in the group.
If you have better answer, please add a comment about this, thank you!