Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Work Unit ID | Task ID |
A | 1 |
A | 2 |
A | 3 |
B | 1 |
B | 3 |
B | 4 |
C | 2 |
C | 3 |
C | 4 |
D | 1 |
Hi! I been cranking my head for the past few hours in trying to get to the results but to no avail. I am trying to count the instances whereby a work unit id has been associated with Task id 1, but 2 is not associated.
In the table above I would need 2 results, 1 for B and D each.
Tried this but didnt work:
count({<[Work Unit ID]=P({<Task ID={1}>}[Work Unit ID])>*<[Work Unit ID]=E({<Task ID={2}>}[Work Unit ID])>}Work Unit ID)
You missed out some parantheses/brackets [] and a distinct
=count({<[Work Unit ID]=P({<[Task ID]={1}>}[Work Unit ID])> * <[Work Unit ID]=E({<[Task ID]={2}>}[Work Unit ID])>} DISTINCT[Work Unit ID])
You are missing some square brackets:
Count({
<[Work Unit ID]=P({<[Task ID]={1}>} [Work Unit ID])>*
<[Work Unit ID]=E({<[Task ID]={2}>} [Work Unit ID])>
}
[Work Unit ID])
You missed out some parantheses/brackets [] and a distinct
=count({<[Work Unit ID]=P({<[Task ID]={1}>}[Work Unit ID])> * <[Work Unit ID]=E({<[Task ID]={2}>}[Work Unit ID])>} DISTINCT[Work Unit ID])
Hi Jontydkpi, thanks for the quick reply. Even after adding [] to all the Task ID and Work Unit ID, i find this formula to yield 0 result.
Try this script:
LOAD * inline [
Work Unit ID,Task ID
A,1
A,2
A,3
B,1
B,3
B,4
C,2
C,3
C,4
D,1];
Using the two expressions by @jonathandienst and me will result in this table-.