Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Is aggr() the way to create this expression?

Given a call_fact table as follows:

Call ID
Transaction Key
555-121212345
555-11226789

And a transaction table (with non-unique keys) as follows:

Tansaction Key
Transaction Type
Transaction Value
12345Request InfoCruise
12345Make ReservationGuarranteed
6789Request InfoCruise
6789Cancel ReservationCancelled



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.

1 Reply
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

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.


talk is cheap, supply exceeds demand