Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am trying to count the unique [Date] values which either had [flag_A]=1 OR [flag_B]=1. Is this possible?
[flag_A] and [flag_B] are independent fields on 'associated' tables, but which will never both equal 1 in the same 'record' of the tables. (Think of it as linking table A which is activity "starts" and table B which is activity "finishes".)
Seems like an if statement works:
count(distinct if(flag_A=1 or flag_B=1,Date))
but I wondered if such is possible and sensible with set analysis.
if i understood it right you search the XOR(/) or OR(+)
count({<flag_A={1}>/<flag_B={1}>} distinct Date)
count({<flag_A={1}>+<flag_B={1}>} distinct Date)
Not sure if this will work, but try this:
=Count(Distinct {<flag_A = {1}>+<flag_B = {1}>} Date)
I am afraid if i had understood your situation.
but i would try writing the below expressions Also.
if(flag_A=1 or flag_B=1, count(distinct{$}Date))
or
if( (flag_A=1 and flag_B=0) or (flag_A=0 and flag_B=1) , count(distinct{$}Date))
or
Count(Distinct {$<flag_A=,flag_B= >} Date)
let me know if any of the expressions works for your situation.
We can proceed resolving your issue from there onwards.
krishna
if i understood it right you search the XOR(/) or OR(+)
count({<flag_A={1}>/<flag_B={1}>} distinct Date)
count({<flag_A={1}>+<flag_B={1}>} distinct Date)
All these years and I never caught that I could define separate sets with the < >.
Thank you for your quick posts!
Here's what I ended up with:
(sum(TaskExecution)+sum([Reload in Hub]))/count({<TaskExecution={1}>+<[Reload in Hub]={1}>} distinct Date)
which as far as I can tell is equivalent to:
(sum(TaskExecution)+sum([Reload in Hub]))/count(distinct if(TaskExecution=1 or [Reload in Hub]=1,Date))
which as far as I can tell is equivalent to:
(sum(TaskExecution)+sum([Reload in Hub]))/count(distinct if(TaskExecution=1 or [Reload in Hub]=1,Date))
You are right Tyler