<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: SAS ESP: Missing First Row Event Detection using Pattern Window in Streaming Analytics</title>
    <link>https://communities.sas.com/t5/Streaming-Analytics/SAS-ESP-Missing-First-Row-Event-Detection-using-Pattern-Window/m-p/912718#M305</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you please provide the model with a sample data and expected output to check what may be happening here.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Joydeep&lt;/P&gt;</description>
    <pubDate>Tue, 23 Jan 2024 15:21:11 GMT</pubDate>
    <dc:creator>jbhattacharya</dc:creator>
    <dc:date>2024-01-23T15:21:11Z</dc:date>
    <item>
      <title>SAS ESP: Missing First Row Event Detection using Pattern Window</title>
      <link>https://communities.sas.com/t5/Streaming-Analytics/SAS-ESP-Missing-First-Row-Event-Detection-using-Pattern-Window/m-p/911437#M303</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I currently have a simple project in ESP which consists of a Source window, followed by a Pattern Window. The input stream is from a csv which has the following columns: id, stock, stock_price and amount_purchased. Using the Pattern window, I would like to detect when a certain id has purchased a certain stock in two separate events, with the second purchase having been for a lower price.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;-- Define start event that returns true for every event and sets values for variables in context
    function event_function(event, context)
            return true, {id=event.id, stock=event.stock, old_price=event.stock_price, amount_purchased_old=event.amount_purchased}
    end
    
    -- Define event that returns true if current trade price is less than previous trade price
    function price_dec(event,context)
        if (event.id == context.data.id and event.stock == context.data.stock and event.stock_price &amp;lt; context.data.old_price)
        then
            return true, {new_price=event.stock_price, id=event.id, stock=event.stock, old_price=context.data.old_price, amount_purchased_new=event.amount_purchased, amount_purchased_old=context.data.amount_purchased_old}
        end
            return false
    end&lt;/PRE&gt;&lt;P&gt;What I am noticing is that my Pattern window does NOT seem to pick up the pattern properly &lt;STRONG&gt;if the first input row (first row of the csv file) is the start of the pattern&lt;/STRONG&gt;. Does anyone know why this may be the case?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jan 2024 19:09:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Streaming-Analytics/SAS-ESP-Missing-First-Row-Event-Detection-using-Pattern-Window/m-p/911437#M303</guid>
      <dc:creator>nattyd</dc:creator>
      <dc:date>2024-01-12T19:09:26Z</dc:date>
    </item>
    <item>
      <title>Re: SAS ESP: Missing First Row Event Detection using Pattern Window</title>
      <link>https://communities.sas.com/t5/Streaming-Analytics/SAS-ESP-Missing-First-Row-Event-Detection-using-Pattern-Window/m-p/912625#M304</link>
      <description>&lt;P&gt;I moved this topic to the "Streaming Analytics" - board.&lt;BR /&gt;That's a more appropriate channel for ESP questions.&lt;BR /&gt;Hopefully, question will get an answer now.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jan 2024 10:43:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Streaming-Analytics/SAS-ESP-Missing-First-Row-Event-Detection-using-Pattern-Window/m-p/912625#M304</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2024-01-23T10:43:09Z</dc:date>
    </item>
    <item>
      <title>Re: SAS ESP: Missing First Row Event Detection using Pattern Window</title>
      <link>https://communities.sas.com/t5/Streaming-Analytics/SAS-ESP-Missing-First-Row-Event-Detection-using-Pattern-Window/m-p/912718#M305</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you please provide the model with a sample data and expected output to check what may be happening here.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Joydeep&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jan 2024 15:21:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Streaming-Analytics/SAS-ESP-Missing-First-Row-Event-Detection-using-Pattern-Window/m-p/912718#M305</guid>
      <dc:creator>jbhattacharya</dc:creator>
      <dc:date>2024-01-23T15:21:11Z</dc:date>
    </item>
  </channel>
</rss>

