CEP Pattern Matching for Straight line graph

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

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 query
SELECT
          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 TEdited by: Anand Srinivasan on Mar 8, 2012 7:56 AM

Similar Messages

  • Pattern matching for an expression

    How do I do a pattern matching for a strings that look like the ones below?
    11 1
    12 12
    1 34
    Thanks

    >
    "[^[0-9]|^RATE]";
    "[\\d\\d\\d\\d\\d\\d\\d|\\w\\w\\w\\w\\w\\w\\p{Punct}\\w
    \w\\p{Punct}\\w|[RATE]]";
    I have the above two patterns to match. I want to
    combine these two and say this and that. How do I use
    an and in between. I tried the following and it didn't
    work.
    "[^[0-9]|^RATE][\\d\\d\\d\\d\\d\\d\\d|\\w\\w\\w\\w\\w\\
    \\p{Punct}\\w\\w\\p{Punct}\\w|[RATE]]";
    Any help?I think you'd do better to give us examples of the text you're trying to match, because none of those patterns makes any sense.

  • How to set the 4th Y axis color for a line graph

    Hello experts,
    I have developed a multiple y axis line graph using oracle reports 10g.
    It has got 1 x axis and 4 axes. I am able to set the color of the the first three y axes
    but the reports designer automatically assigns yellow color to the 4th axis.
    I mean there is no option in the graph wizard for changing the 4th color)
    How to change the color of this 4th y axis to a desired color?
    Cheers
    Sri

    Assuming you mean that your graph has 4 series, not 4 Y axes, you might try something like this:
    1. Save a backup copy of your current report in case the changes you are about to make don't work out and you want to revert to the backup copy.
    2. Using the Property Inspector, display the current value of the Graph Settings property for your graph. The value of the property should be something like:
    <rw:graph id...
    </rw:graph>3. Look for a <SeriesItems> tag and a matching </SeriesItems> tag in the property value. If you don't find them, add the following two lines immediately before the </Graph> tag.
    <SeriesItems>
    </SeriesItems>4. Between the <SeriesItems> tag and the matching </SeriesItems> tag, add (or update) a <Series> tag for each series that you want to specify the color for. For example, to specify the color of the fourth series as red, you would use a <Series> tag like this:
    <Series id="3" color="#ff0000"/>Note that the id numbers start at 0 for the first series, 1 for the second, and so on. The color value is a hexadecimal number specifying the RGB value of the color.
    You can also use the <Series> tag to specify other features like the marker shape.
    For more information on what you can do using the Graph Settings property, see this FAQ and Technical Note.
    Hope this helps.

  • Combine output  from two data sources for a line graph.

    Hello Experts,
    I need your help in following scenario.
    Scenario - We have a line graph created in VC. We have a numeric field in the data seris and a date field in the Category axis.
                      This is working fine.
    Requirement - Customer wants month names instead of dates on the category axis of the line graph.
    Problem - The RFC which is providing the data to line graph doesnot have a output field giving month names instead it has dates.
    Options Tried - Tried using 'Union' and 'Switch' operator with a RFC giving month names. Unfortunately this doesnot work.
                             One close try was with 'union' operator but it ignores the numeric fields.
    Any help would be highly appreciated.
    Thanks & Regards,
    Amit Kade

    Hello Sandeep,
    Thank you for the reply. I did try to do changes in RFC, I am calling a FM which gives me month names in my original RFC.
    But still the outpot of this FM is in a seperate table and anyways I will have to combine these two tables.
    Problem still remains the same.
    I tried using 'Filter' to convert date format but after applying filter my VC application is not deploying.
    Thanks,
    Amit Kade

  • Pattern matching for range of numbers

    I am facing problem in using a pattern like [200-300] to match any number in the range 200 and 300 inclusive. I wrote following code:
    public class RangeTest {
         public static void main(String[] args) {
              String pat = "[100-200]";
              String input = "100";
              // incpat.replace("[", "\\[");
              // incpat.replace("]", "\\]");                    
              System.out.println("Pattern" + pat);
              Pattern pattern = Pattern.compile(pat);
              Matcher matcher = pattern.matcher(input);
              if (matcher.matches()) {
                   System.out.println("EPC Matched:" + input + " and pattern:"              +matcher.pattern());                         
    }and tested it for different values of input , it's not working. I tried even giving escape characters for "[" and "]" (commented code). Can i use pattern matching in this case.
    Please help me.
    Regards,
    Prashanth

    I am facing problem in using a pattern like[200-300] to match any number in
    the range 200 and 300 inclusive.Try this one: "(2\d\d)|(300)".
    kind regards,
    Jos
    ps. Waiting for Sabre to jump in telling me that the
    parentheses aren't needed ;-)The parentheses aren't needed Jos! :-)

  • Pattern Matching for a wildcard Ip address

    I m working on a project. And in it i get problem for pattern matching.I have ipv4 ip address for ex " 127.3.0.1* ".I have to generate regular exp for pattern matching in Java.Can you guide me what can be its regular exp.
    thanks,
    preeti

    preetiGupta wrote:
    I m working on a project. And in it i get problem for pattern matching.I have ipv4 ip address for ex " 127.3.0.1* ".I have to generate regular exp for pattern matching in Java.Can you guide me what can be its regular exp.Alternatively, [try this|http://lmgtfy.com/?q=regex+for+ipv4+addresses].
    Winston

  • Remaining Value for Straight-line Depreciation

    Hi Experts,
    I am using straight-line depreciation for 36 months.
    The asset value is $198,168.64, I notice that the calculated monthly depreciation is
    sometimes $5,504.68 and sometimes $5,504.69 (I think it is due to rounding issue).
    However, after 36 months, the total deprecation is only $198,168.63, leaving a $0.01 balance at the asset.
    This $0.01 balance was not depreciated in the 37th month,
    and I need to manually run an unplanned deprecation to eliminate the $0.01.
    Is there any settings that can remove the $0.01 balance automatically?
    Thanks,
    Urchin

    Hi,
    Why dont you try ABAVN transaction?
    Go to AR01
    And position the cursor on all the effected assets and click on *create worklist8 button in th eapplication tool bar.
    (CtrlShftF8)
    Thanks,
    Srinu

  • Pattern matching for LCD function test

    Hello,
    I am writing a VI that is taking a single picture from a camera and then compares it with a template extracted before that.
    The camera is looking at LCD display and and the purpose of the matching is to find whether there is a dead pixel or sth wrong at the display. The problem is that the comparison doesn't work as expected.
    I will illustrate this with just one examples with picture attached:
    - At step 1. the template is created. (you can see RUN 2 at the top left corner at the display) 
    - At step 2. pattern matching is performed with the same mode of the LCD but a little bit tilted(score - 972 achieved)
    - At step 3. the mode is changed (you can see RUN 3 at the top left corner at the display, everything else is the same) - but however a bigger score of 974 is achieved
    Any explanation of this and some suggestions that can improve my program !?
    Thanks a lot
    Iliya G. 
    Attachments:
    1step.JPG ‏43 KB
    2step.JPG ‏42 KB
    3step.JPG ‏38 KB

    Hi David,
    I went through this OCR examples that you mentioned but in fact I find them very annoying because in many cases the output string depends on how you draw your ROI. Please, find an example below and could you please tell me if i am doing sth wrong, but in fact i don't think so.
    When I try to read the characters separetely, everythings goes ok - it finds r,u,n and 1.
    But when I make the ROI bigger in order to contain all the characters, the output is the one at the picture. Any ideas?
    Thanks,
    Iliya 
    Attachments:
    1.JPG ‏21 KB

  • SSRS Use a formula for a line graph y = mX + b

    Hi I want to show a line on a line chart using a formula in the form y = mX + b.   Can't seem to get this to work.   I inputted the formula into the "Value field" of the "Data field" but the line doesn't show up.
    X = value for X axis (it's a date);  m and b are query fields (both type real)    The data is grouped on two fields that are specified in the "series field"
    There are multiple values for X but only one value for M and B.
    So for all dates (X) for each Group 1 AND Group 2 combo: chart this line.
    Using: SSRS Visual Studio 2008

    Hi 317704,
    Linear Regression line might be what you need, you have to get the records in the database using the T-SQL for all the points on the X-Axis following the below formula. Where n is the total number of data points, and the tis and yis are the components of
    the data point tuples (ti, yi).
     I give a sample below,
    My datasource(AdventureWorksDW2008):
    DECLARE @start_month
    SMALLDATETIME
    DECLARE @end_month
    SMALLDATETIME
    SET @start_month
    = '2002-01-01'
    SET @end_month
    = '2002-12-01';
    SELECT
    CAST(CONVERT(CHAR(6),DimTime.FullDateAlternateKey,112)
    + '01'
    AS
    SMALLDATETIME)
    AS CalendarMonth
    ,SUM(SalesAmount)
    AS y
    FROM FactInternetSales
    INNER
    JOIN DimSalesTerritory
    ON FactInternetSales.SalesTerritoryKey
    = DimSalesTerritory.SalesTerritoryKey
    INNER
    JOIN DimTime
    ON FactInternetSales.OrderDateKey
    = DimTime.TimeKey
    WHERE DimSalesTerritory.SalesTerritoryKey
    = 9 --Australia
    AND
    DATEPART(YEAR,DimTime.FullDateAlternateKey)
    BETWEEN
    DATEPART(YEAR,@start_month)
    AND DATEPART(YEAR,@end_month)
    AND
    DATEPART(MONTH,DimTime.FullDateAlternateKey)
    BETWEEN
    DATEPART(MONTH,@start_month)
    AND DATEPART(MONTH,@end_month)
    GROUP
    BY CONVERT(CHAR(6),DimTime.FullDateAlternateKey,112)
    You could get some reference from top sample.
    Thanks,
    Challen Fu
    Challen Fu [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

  • Pattern matching for thumb print scanner using java

    I want to get some information about security system technology using java to develop my final year project. Please kindly assist me in searching some related information regarding thumb print scanner security system. Anyone who can help me in this, i will really appreciate it, thank you in advanced !

    This is going to be a tough project. Here are a couple of ideas
    1. Java, or whatever language you do it in probably won't matter that much.
    2. You need to find algorithms for matching fingerprints. There are probably some out there... You may need to pay to use them. There are also probably some books out that might help you figure out how to do this, or how other people have done this, or who to contact about doing this.
    3. Partnering up with someone, either in industry (like IBM maybe) or at the very least a professor is going to be important.
    4. Don't try to invent the wheel. Do your research and reuse as much as you can. Getting the algorithm + the scanner are going to be the hard parts

  • Why does shift click for straight line not work in mask

    Is "Shift Click" supposed to work when editing a mask with the brush tool.   Seems like it used to but doesn't any more.  Anybody have this problem?

    Could you please post a screenshot with the pertinent Panels (Layers, Brush, Brush Preset, Options Bar, …) visible?
    If resetting the Tool dow not help you can always try restoring preferences (preferably after after making sure all customized presets like Actions, Patterns, Brushes etc. have been saved).
    http://blogs.adobe.com/crawlspace/2012/07/photoshop-basic-troubleshooting-steps-to-fix-mos t-issues.html

  • Oracle OpenSSO Pattern Matching for Application Express "Free" Pages

    Has anyone successfully established a "Free" page within an Application Express application under Oracle's OpenSSO? The problem seems to be associated with the use of wildcards and the f?p syntax. In addition, the use of wildcards and multi-level wildcards in the OpenSSO un-enforced policy list seems to drop semi-colons from the posted URLs. We have successfully deployed applications which require authentication, but applications which contain a "free" landing page elude me.
    Any insight would be appreciated.
    Thank you.

    Has anyone successfully established a "Free" page within an Application Express application under Oracle's OpenSSO? The problem seems to be associated with the use of wildcards and the f?p syntax. In addition, the use of wildcards and multi-level wildcards in the OpenSSO un-enforced policy list seems to drop semi-colons from the posted URLs. We have successfully deployed applications which require authentication, but applications which contain a "free" landing page elude me.
    Any insight would be appreciated.
    Thank you.

  • How do I make a line graph that shows temperature readings taken on specific dates?

    I need to make a chart of my wife's temperatures taken via ovulation thermometer. All I need is a line graph that shows the temperatures on the y axis and the dates the measurements were taken on the x axis.
    What is the easiest way to do this? Please explain in detail as I have almost no knowledge regarding Numbers. Thanks.

    You can construct a Line graph or a Scatter graph to display this.
    The two are similar, but require the data to be set up differently.
    A Line graph is a Category graph.
    Each 'date' is a text value that names a category. The categories are equally spaced along the category axis. Measurements taken on day 1, day 2 and day 4 would be equally spaced with respect to the category axis.
    Each temperature reading is a numerical value, and is represented on the graph by the distance it is placed from (and usually above) the category axis.
    A Scatter graph has two value axes.
    Each Date is a Date and Time value. The position of these values depends on the value itself. Measurements taken on February 1, February 2 and February 4 wound not be equally spaced. Along the Date axis, the space between the second and third dates would be twice as wide as that between the first and second cates.
    Each temperature reading is a numerical value, and is represented on the graph in the same manner as in the Line graph.
    Here's an example of each, using the same data set.
    For the Line graph (left), the Category labels (dates) are placed in a Header column, and the temperatures in a non-header column,
    For the Scatter graph, both the dates and the temperatures are in non-header columns. The Chart Inspector was used to Connect the data points with straight line segments, and the weight of these lines (and size of the data point markers) was increased to more closely match the weights and sizes in the Line graph.
    Data on the graphs is not intended to have any similarity to temperatures measured for your purposes.
    The construct the line graph:
    Set up the data and labels as described.
    Select the cells containing the data (column B in my case).
    Click the Chart button and choose the Line Chart.
    To construct the scatter chart:
    Set up the data as described.
    Select the cells containing the date and temperature data (columns A and B for mine)
    Click the Chart button, and select the Scatter Chart button (third from the bottom),
    In the Chart inspector, click the Series button, then set the Connection Points menu to Straight. Change the Data Point size yo 15.
    Click anywhere on the line to select it, then in the Stroke section of the Format bar, set the line weight to 4 points.
    Click on the box containing the dates (under the chart), then click the ruler icon in the Inspector to show the metrics inspector. Use the Rotate control to set the angle for the dates to about 75°.
    Click on the label for this axis (Dates) and drag it to a position below the date labels.
    Regards,
    Barry

  • Help needed in plotting Line Graph!!!!!!!!!Pls help!!

    Hi, i need help in plotting a simple line graph showing the x&y axis and has to plot 3 different lines in the same graph.I have written a program and i need to implement this graph in it.Is there any tutorial for plotting line graphs,i mean steps included.
    Please help!

    You describe your need, but not where it originates from.
    Is it a programming assignment? If so, I hope this is not your chosen major, as you will fail because you are a non-resourceful plagarist.
    Do you need to simply graph some data? Use an existing package. There are free ones somewhere.
    What do you mean "i have written a program and i need to implement this graph in it"? If you wrote the program, wouldn't you be done?
    Enjoy programming

  • Creating a Double Line Graph

    Hello,
    I'm trying to create a graph from the information seen in the table below. I need to plot on the X- Axis, the T0,T1,T2 values. There will be two data sets for the line graph, Subject A and Subject B, the value from which will be plotted on the Y-Axis. I've spent about an hour now, trying to order the values to create the graph I need.
         Another way of saying this, is that I'm plotting the differences in Subject A versus Subject B over a period of Time (T0, T1, T2).
    It should look something like this:
    Help Please!
    -KB

    Hi KBaines,
    Please don't worry about wasting anyone's time. Many users in this forum look upon Numbers problems as a challenge. If you solved your own problem, please post your solution to help others.
    Regards,
    Ian.

Maybe you are looking for