Well, I think it's possible, but it's complicated.
1. Using Query Builder, select everything from your table. Create a new advanced expression, and make the expression
monotonic()
This is an unsupported function that will add the row number to the record. Let's call it SeqNo for the rest of this example.
2. Do the following for both streams, Auto and Housing:
2.1 Select only the records for Auto
2.2 For this table, do a summarized query, keeping CustNo, the min of SeqNo, and the max of SeqNo.
2.3 Do the same two steps for Housing.
3. Create a new query on the result of 2.2, and do a full outer join to the result of 2.3, joining on CustNo. This should give you a dataset with the CustNo, min and max of SeqNo for Auto, and min and max of SeqNo for Housing.
4. With this, create a query. Create your variables Auto_then_Housing and Housing_then_Auto as advanced expressions, where you'll use a Case function to compare the variables. For Auto_then_Housing I used this:
CASE
WHEN (t1.MIN_of_SeqNo_Auto < t1.MAX_of_SeqNo_Housing) & ^missing(t1.MIN_of_SeqNo_Auto)
THEN 1
ELSE 0
END
and for Housing_then_Auto
CASE
WHEN (t1.MIN_of_SeqNo_Housing < t1.MAX_of_SeqNo_Auto) & ^missing(t1.MIN_of_SeqNo_Housing)
THEN 1
ELSE 0
END
... View more