Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all, maybe someone could suggest a better idea how to create 'more correct' filter without ifs, because, let's say we have simple table with some indicators:
load * inline [
id, ind_Recognision, ind_Delete, ind_Return
A, 1, 0, 0
B, 1, 1, 0
C, 1, 1, 0
D, 0, 1, 0
E, 0, 1, 0
F, 0, 0, 1];
If I want to create a filter to know what 'action' (according indicators) were done, simplest way to do is using ifs:
=IF(ind_Recognision=1, 'Recognition', if(ind_Delete=1, 'Delete', if(ind_Return=1, 'Return', 'Other')))
But here comes my problem, basically, ifs take only first value where expression is true. So if I choose 'Delete', I only see ids D and E, because B and C already treated as 'Recognition'.
Is there a way to create a filter which take not 'first true value', but looks 'if one of' way? So if I choose 'Delete' I will see B, C, D, E ids.
Thank you in advance
Table1:
load * inline [
id, ind_Recognision, ind_Delete, ind_Return
A, 1, 0, 0
B, 1, 1, 0
C, 1, 1, 0
D, 0, 1, 0
E, 0, 1, 0
F, 0, 0, 1];
Load id, 'Recognition' as Action
Resident Table1
Where ind_Return = 1;
JOIN
Load id, 'Delete' as Action
Resident Table1
Where ind_Delete = 1;
JOIN
Load id, 'Return' as Action
Resident Table1
Where ind_Recognision = 1;
JOIN
Load id, 'Other' as Action
Resident Table1
Where ind_Recognision = 0 AND ind_Delete = 0 and ind_Return = 0;
Table1:
load * inline [
id, ind_Recognision, ind_Delete, ind_Return
A, 1, 0, 0
B, 1, 1, 0
C, 1, 1, 0
D, 0, 1, 0
E, 0, 1, 0
F, 0, 0, 1];
Load id, 'Recognition' as Action
Resident Table1
Where ind_Return = 1;
JOIN
Load id, 'Delete' as Action
Resident Table1
Where ind_Delete = 1;
JOIN
Load id, 'Return' as Action
Resident Table1
Where ind_Recognision = 1;
JOIN
Load id, 'Other' as Action
Resident Table1
Where ind_Recognision = 0 AND ind_Delete = 0 and ind_Return = 0;