Discussions
Categories
- 17.9K All Categories
- 3.4K Industry Applications
- 3.4K Intelligent Advisor
- 75 Insurance
- 537.6K On-Premises Infrastructure
- 138.7K Analytics Software
- 38.6K Application Development Software
- 6.1K Cloud Platform
- 109.6K Database Software
- 17.6K Enterprise Manager
- 8.8K Hardware
- 71.3K Infrastructure Software
- 105.4K Integration
- 41.6K Security Software
CEP Pattern Matching for Straight line graph

900697
Member Posts: 50
Hi,
I have a scenario where weight is directly proportional to depth, which produces a linear straight line.
CEP will get data for weight and depth, CQL has to be write to raise an event when there is a change in straight line graph.
How to write CQL query and use match pattern for this.
Thanks,
Sri
I have a scenario where weight is directly proportional to depth, which produces a linear straight line.
CEP will get data for weight and depth, CQL has to be write to raise an event when there is a change in straight line graph.
How to write CQL query and use match pattern for this.
Thanks,
Sri
Answers
-
So lets say you have an input Channel with event Type E(weight, depth)
Idea is to compute the slope - weight/depth and report the first and those subsequent events whose w/d is different from that of the previous event
Here is the querySELECT T.weight, T.depth FROM E MATCH_RECOGNIZE ( MEASURES A.depth as depth, A.weight as weight PATTERN (A) DEFINE A AS ( (PREV(A.weight) is null) OR (PREV(A.weight)/PREV(A.depth) != A.weight/A.depth) ) ) as T
Edited by: Anand Srinivasan on Mar 8, 2012 7:56 AM -
Thanks Anand.
This discussion has been closed.