Reputation: 938
I have two different custom events.
I would like to know the storeNumber that exists in prod:tenant:StoreStatusChanged
event, but does not exist in prod:order:OrderStatusUpdated
.
The expected result in this example:
How can I do that?
Please check the printscreens below:
Upvotes: 0
Views: 3196
Reputation: 562
Given NRDB is not a relational DB there's not currently a way to JOIN two event types. Because you're wanting to find the diff between the two counts (i.e., via JOIN), there's not a way to do that at this time.
However, if you were wanting to find the sum of the store numbers between those two event types have the same properties you may be able to do something with NR's nested aggregation which approximates a UNION.
FROM prod:tenant:StoreStatusChanged, prod:order:OrderStatusUpdated
SELECT uniques(storeNumber)
WHERE tenantName = '123'
SINCE 3 DAYS AGO
You might also checkout this post on NRQL using multiple FROMs. I know this doesn't solve your question, but perhaps it gives you other options if you have the sum. Sorry I couldn't help you more.
Upvotes: 0