Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Given a call_fact table as follows:
Call ID | Transaction Key |
---|---|
555-1212 | 12345 |
555-1122 | 6789 |
And a transaction table (with non-unique keys) as follows:
Tansaction Key | Transaction Type | Transaction Value |
---|---|---|
12345 | Request Info | Cruise |
12345 | Make Reservation | Guarranteed |
6789 | Request Info | Cruise |
6789 | Cancel Reservation | Cancelled |
How would I define an expression that would count all of the calls that Requested Info about a Cruise AND Made a Guaranteed Reservation.
In the above example, the answer should be '1'.
I have a feeling the aggr() function should be employed here, but I'm not sure how.
Thanks.
You can do it with a set analysis expression. Something like this:
=count({<Type={'Request Info'},Value={'Cruise'},[Call ID]=p({<Type={'Make Reservation'},Value={'Guarranteed'}>}[Call ID])>} distinct Key)
See attached example.