<?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 Selecting the data with a specific trend. in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Selecting-the-data-with-a-specific-trend/m-p/643973#M35926</link>
    <description>&lt;P&gt;Hello All,&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;I have a very interesting case in SAS EG which I would like to solve and which might benefit us all to learn from. I have a big dataset in SAS EG which I use to make charts in VA. These charts (most of them) have a specific trend in a time-frame of 1 minute. The beginning of the chart have values around 17-18, within a few seconds, the values drop to approximately 0 - 1. A few seconds later the value rises again to 17-18.&amp;nbsp; So the trend starts high goes low and ends high. The data-set looks like this (but much much bigger):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080"&gt;&lt;STRONG&gt;Time&amp;nbsp; &amp;nbsp; &amp;nbsp;--&amp;nbsp; &amp;nbsp; Value&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;00:000&amp;nbsp; --&amp;nbsp; &amp;nbsp;17.109&lt;/P&gt;
&lt;P&gt;00:025&amp;nbsp;&amp;nbsp;--&amp;nbsp; &amp;nbsp;17.109&lt;/P&gt;
&lt;P&gt;00:040&amp;nbsp; --&amp;nbsp; &amp;nbsp;17.106&lt;/P&gt;
&lt;P&gt;00:061&amp;nbsp; --&amp;nbsp; &amp;nbsp;17.034&lt;/P&gt;
&lt;P&gt;00:071&amp;nbsp; --&amp;nbsp; &amp;nbsp; 17.056&lt;/P&gt;
&lt;P&gt;00:151&amp;nbsp; --&amp;nbsp; &amp;nbsp; 0.431&lt;/P&gt;
&lt;P&gt;00:173&amp;nbsp; --&amp;nbsp; &amp;nbsp; 0.432&lt;/P&gt;
&lt;P&gt;00:182&amp;nbsp; --&amp;nbsp; &amp;nbsp; 0.320&lt;/P&gt;
&lt;P&gt;00:195&amp;nbsp; --&amp;nbsp; &amp;nbsp; 0.650&lt;/P&gt;
&lt;P&gt;00:234&amp;nbsp; --&amp;nbsp; &amp;nbsp;17.109&lt;/P&gt;
&lt;P&gt;00:244&amp;nbsp; --&amp;nbsp; &amp;nbsp;17.109&lt;/P&gt;
&lt;P&gt;00:256&amp;nbsp; --&amp;nbsp; &amp;nbsp;17.106&lt;/P&gt;
&lt;P&gt;00:278&amp;nbsp; --&amp;nbsp; &amp;nbsp;17.034&lt;/P&gt;
&lt;P&gt;00:291&amp;nbsp; --&amp;nbsp; &amp;nbsp;17.056&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sometimes the chart doesn't fit the trend because the dataset sometimes contains to high or to low values at unwanted places. Now I only want to select the data in EG which fits the trend so that I don't get weird charts in SAS VA. &lt;SPAN&gt;The trend I'm looking for actually has 3 sections: &lt;STRONG&gt;Begin - Middle - End.&lt;/STRONG&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;In the&lt;STRONG&gt; Begin&lt;/STRONG&gt; the values must be &lt;STRONG&gt;HIGH&lt;/STRONG&gt; between 17 and 18. In the &lt;STRONG&gt;Middle&lt;/STRONG&gt; the values must be &lt;STRONG&gt;LOW&lt;/STRONG&gt; between 0 and 1. In the &lt;STRONG&gt;End&lt;/STRONG&gt; the values must again be &lt;STRONG&gt;HIGH&lt;/STRONG&gt; between 17 and 18.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If the values are like I mentioned above, I will get a Bathtub curve which is what I want.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I was thinking about selecting the average of the highest values (the 17's) and the average of the lowest values (the 0's) and then maybe filter which are the closest to those values? I think this might not be accurate enough. I have also read something about the SHEWHART Procedure (I don't know what this is or how this works).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I appreciate your help. Thank you in advance.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 29 Apr 2020 14:58:38 GMT</pubDate>
    <dc:creator>AK100</dc:creator>
    <dc:date>2020-04-29T14:58:38Z</dc:date>
    <item>
      <title>Selecting the data with a specific trend.</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Selecting-the-data-with-a-specific-trend/m-p/643973#M35926</link>
      <description>&lt;P&gt;Hello All,&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;I have a very interesting case in SAS EG which I would like to solve and which might benefit us all to learn from. I have a big dataset in SAS EG which I use to make charts in VA. These charts (most of them) have a specific trend in a time-frame of 1 minute. The beginning of the chart have values around 17-18, within a few seconds, the values drop to approximately 0 - 1. A few seconds later the value rises again to 17-18.&amp;nbsp; So the trend starts high goes low and ends high. The data-set looks like this (but much much bigger):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080"&gt;&lt;STRONG&gt;Time&amp;nbsp; &amp;nbsp; &amp;nbsp;--&amp;nbsp; &amp;nbsp; Value&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;00:000&amp;nbsp; --&amp;nbsp; &amp;nbsp;17.109&lt;/P&gt;
&lt;P&gt;00:025&amp;nbsp;&amp;nbsp;--&amp;nbsp; &amp;nbsp;17.109&lt;/P&gt;
&lt;P&gt;00:040&amp;nbsp; --&amp;nbsp; &amp;nbsp;17.106&lt;/P&gt;
&lt;P&gt;00:061&amp;nbsp; --&amp;nbsp; &amp;nbsp;17.034&lt;/P&gt;
&lt;P&gt;00:071&amp;nbsp; --&amp;nbsp; &amp;nbsp; 17.056&lt;/P&gt;
&lt;P&gt;00:151&amp;nbsp; --&amp;nbsp; &amp;nbsp; 0.431&lt;/P&gt;
&lt;P&gt;00:173&amp;nbsp; --&amp;nbsp; &amp;nbsp; 0.432&lt;/P&gt;
&lt;P&gt;00:182&amp;nbsp; --&amp;nbsp; &amp;nbsp; 0.320&lt;/P&gt;
&lt;P&gt;00:195&amp;nbsp; --&amp;nbsp; &amp;nbsp; 0.650&lt;/P&gt;
&lt;P&gt;00:234&amp;nbsp; --&amp;nbsp; &amp;nbsp;17.109&lt;/P&gt;
&lt;P&gt;00:244&amp;nbsp; --&amp;nbsp; &amp;nbsp;17.109&lt;/P&gt;
&lt;P&gt;00:256&amp;nbsp; --&amp;nbsp; &amp;nbsp;17.106&lt;/P&gt;
&lt;P&gt;00:278&amp;nbsp; --&amp;nbsp; &amp;nbsp;17.034&lt;/P&gt;
&lt;P&gt;00:291&amp;nbsp; --&amp;nbsp; &amp;nbsp;17.056&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sometimes the chart doesn't fit the trend because the dataset sometimes contains to high or to low values at unwanted places. Now I only want to select the data in EG which fits the trend so that I don't get weird charts in SAS VA. &lt;SPAN&gt;The trend I'm looking for actually has 3 sections: &lt;STRONG&gt;Begin - Middle - End.&lt;/STRONG&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;In the&lt;STRONG&gt; Begin&lt;/STRONG&gt; the values must be &lt;STRONG&gt;HIGH&lt;/STRONG&gt; between 17 and 18. In the &lt;STRONG&gt;Middle&lt;/STRONG&gt; the values must be &lt;STRONG&gt;LOW&lt;/STRONG&gt; between 0 and 1. In the &lt;STRONG&gt;End&lt;/STRONG&gt; the values must again be &lt;STRONG&gt;HIGH&lt;/STRONG&gt; between 17 and 18.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If the values are like I mentioned above, I will get a Bathtub curve which is what I want.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I was thinking about selecting the average of the highest values (the 17's) and the average of the lowest values (the 0's) and then maybe filter which are the closest to those values? I think this might not be accurate enough. I have also read something about the SHEWHART Procedure (I don't know what this is or how this works).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I appreciate your help. Thank you in advance.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Apr 2020 14:58:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Selecting-the-data-with-a-specific-trend/m-p/643973#M35926</guid>
      <dc:creator>AK100</dc:creator>
      <dc:date>2020-04-29T14:58:38Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting the data with a specific trend.</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Selecting-the-data-with-a-specific-trend/m-p/643979#M35927</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;This means for example that the values cannot start at low numbers like 1 for or have middle values around the 10 or end with to low values.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;This is a rather vague description of what constitutes&amp;nbsp;the problem you are looking for. Can you be much more specific about what exactly would be the trend you are looking for (or not looking for)?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;I was thinking about selecting the average of the highest values (the 17's) and the average of the lowest values (the 0's) and then maybe filter which are the closest to those values? I think this might not be accurate enough.&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Same comments as above.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt; I have also read something about the SHEWHART Procedure (I don't know what this is or how this works).&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Shewhart will not find these types of trends that you are discussing.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Apr 2020 14:47:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Selecting-the-data-with-a-specific-trend/m-p/643979#M35927</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-04-29T14:47:35Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting the data with a specific trend.</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Selecting-the-data-with-a-specific-trend/m-p/643985#M35929</link>
      <description>&lt;P&gt;The trend I'm looking for actually has 3 sections: Begin - Middle - End&lt;BR /&gt;In the Begin the values must be HIGH between 17 and 18. In the Middle the values must be LOW between 0 and 1. In the End the values must again be HIGH between 17 and 18. &lt;BR /&gt;&lt;BR /&gt;If the values are like I mentioned above, I will get a Bathtub curve which is what I want.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Apr 2020 14:56:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Selecting-the-data-with-a-specific-trend/m-p/643985#M35929</guid>
      <dc:creator>AK100</dc:creator>
      <dc:date>2020-04-29T14:56:36Z</dc:date>
    </item>
    <item>
      <title>Filter only which fits a specific trend</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Selecting-the-data-with-a-specific-trend/m-p/644175#M35934</link>
      <description>&lt;P&gt;Hello All,&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;I have a very interesting case in SAS EG which I would like to solve and which might benefit us all to learn from. I have a big dataset in SAS EG which I use to make charts in VA. These charts (most of them) have a specific trend in a time-frame of 1 minute. The beginning of the chart have values around 17-18, within a few seconds, the values drop to approximately 0 - 1. A few seconds later the value rises again to 17-18.&amp;nbsp; So the trend starts high goes low and ends high. The data-set looks like this (but much much bigger):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080"&gt;&lt;STRONG&gt;Time&amp;nbsp; &amp;nbsp; &amp;nbsp;--&amp;nbsp; &amp;nbsp; Value&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;00:000&amp;nbsp; --&amp;nbsp; &amp;nbsp;17.109&lt;/P&gt;
&lt;P&gt;00:025&amp;nbsp;&amp;nbsp;--&amp;nbsp; &amp;nbsp;17.109&lt;/P&gt;
&lt;P&gt;00:040&amp;nbsp; --&amp;nbsp; &amp;nbsp;17.106&lt;/P&gt;
&lt;P&gt;00:061&amp;nbsp; --&amp;nbsp; &amp;nbsp;17.034&lt;/P&gt;
&lt;P&gt;00:071&amp;nbsp; --&amp;nbsp; &amp;nbsp; 17.056&lt;/P&gt;
&lt;P&gt;00:151&amp;nbsp; --&amp;nbsp; &amp;nbsp; 0.431&lt;/P&gt;
&lt;P&gt;00:173&amp;nbsp; --&amp;nbsp; &amp;nbsp; 0.432&lt;/P&gt;
&lt;P&gt;00:182&amp;nbsp; --&amp;nbsp; &amp;nbsp; 0.320&lt;/P&gt;
&lt;P&gt;00:195&amp;nbsp; --&amp;nbsp; &amp;nbsp; 0.650&lt;/P&gt;
&lt;P&gt;00:234&amp;nbsp; --&amp;nbsp; &amp;nbsp;17.109&lt;/P&gt;
&lt;P&gt;00:244&amp;nbsp; --&amp;nbsp; &amp;nbsp;17.109&lt;/P&gt;
&lt;P&gt;00:256&amp;nbsp; --&amp;nbsp; &amp;nbsp;17.106&lt;/P&gt;
&lt;P&gt;00:278&amp;nbsp; --&amp;nbsp; &amp;nbsp;17.034&lt;/P&gt;
&lt;P&gt;00:291&amp;nbsp; --&amp;nbsp; &amp;nbsp;17.056&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sometimes the chart doesn't fit the trend because the dataset sometimes contains to high or to low values at unwanted places. Now I only want to select the data in EG which fits the trend so that I don't get weird charts in SAS VA. &lt;SPAN&gt;The trend I'm looking for actually has 3 sections: &lt;STRONG&gt;Begin - Middle - End.&lt;/STRONG&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;In the&lt;STRONG&gt; Begin&lt;/STRONG&gt; the values must be &lt;STRONG&gt;HIGH&lt;/STRONG&gt; between 17 and 18. In the &lt;STRONG&gt;Middle&lt;/STRONG&gt; the values must be &lt;STRONG&gt;LOW&lt;/STRONG&gt; between 0 and 1. In the &lt;STRONG&gt;End&lt;/STRONG&gt; the values must again be &lt;STRONG&gt;HIGH&lt;/STRONG&gt; between 17 and 18.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If the values are like I mentioned above, I will get a Bathtub curve which is what I want.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I was thinking about selecting the average of the highest values (the 17's) and the average of the lowest values (the 0's) and then maybe filter which are the closest to those values? I think this might not be accurate enough. I have also read something about the SHEWHART Procedure (I don't know what this is or how this works).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I appreciate your help. Thank you in advance.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Apr 2020 09:10:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Selecting-the-data-with-a-specific-trend/m-p/644175#M35934</guid>
      <dc:creator>AK100</dc:creator>
      <dc:date>2020-04-30T09:10:09Z</dc:date>
    </item>
    <item>
      <title>Re: Filter only which fits a specific trend</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Selecting-the-data-with-a-specific-trend/m-p/644179#M35935</link>
      <description>&lt;P&gt;Since you already asked that identical question, I merged this back into it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please supply usable example data (&lt;STRONG&gt;IN A DATA STEP WITH DATALINES; DO NOT SKIP THIS!&lt;/STRONG&gt;) that illustrates your issue sufficiently, and point out the observations you want deleted, and why.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Apr 2020 09:37:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Selecting-the-data-with-a-specific-trend/m-p/644179#M35935</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-04-30T09:37:47Z</dc:date>
    </item>
    <item>
      <title>Re: Filter only which fits a specific trend</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Selecting-the-data-with-a-specific-trend/m-p/644181#M35936</link>
      <description>I don't think a data step will help for this one as the trend starts taking shape after more then thousands of rows. The data set is to big to just show you a small portion of it. So it wont make sense if I just send you 10 or 100 observations in a date step. It also contains  a lot of private data which I cannot just throw on the forum.</description>
      <pubDate>Thu, 30 Apr 2020 09:46:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Selecting-the-data-with-a-specific-trend/m-p/644181#M35936</guid>
      <dc:creator>AK100</dc:creator>
      <dc:date>2020-04-30T09:46:59Z</dc:date>
    </item>
    <item>
      <title>Re: Filter only which fits a specific trend</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Selecting-the-data-with-a-specific-trend/m-p/644185#M35937</link>
      <description>&lt;P&gt;You already showed data, and I can see nothing critical in there. But it does not sufficiently illustrate your issue, so you need to expand it (so we see which values you want deleted), and present the data in a readily usable form, so we can immediately start testing. Help us to help you.&lt;/P&gt;
&lt;P&gt;If you're not willing to help us, why should we invest time in helping you?&lt;/P&gt;</description>
      <pubDate>Thu, 30 Apr 2020 10:02:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Selecting-the-data-with-a-specific-trend/m-p/644185#M35937</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-04-30T10:02:47Z</dc:date>
    </item>
    <item>
      <title>Re: Filter only which fits a specific trend</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Selecting-the-data-with-a-specific-trend/m-p/644188#M35939</link>
      <description>&lt;P&gt;I know there is nothing critical in there, but can you say the same for millions of rows? I can assure you there are values in those millions who don't fit the trend. I want to filter them out as a precaution.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Its not that I don't want to help you, but I cant give give you (private) data which contains millions of rows, and to make 1 trend chart out of that millions rows I need approximately 1500+ rows. That means a data step would only give you usable data if I make a data step of 1500 rows, is that what you want? Do you want me to send you a data step of 1500 rows?&lt;/P&gt;</description>
      <pubDate>Thu, 30 Apr 2020 10:10:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Selecting-the-data-with-a-specific-trend/m-p/644188#M35939</guid>
      <dc:creator>AK100</dc:creator>
      <dc:date>2020-04-30T10:10:36Z</dc:date>
    </item>
    <item>
      <title>Re: Filter only which fits a specific trend</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Selecting-the-data-with-a-specific-trend/m-p/644200#M35940</link>
      <description>&lt;P&gt;Take the lines you already gave us, add a few lines that you would want excluded, and post that. If these 14 lines were enough to show an "OK" example, 20 lines should be enough to create a "not OK" example. Once we have code to solve this, you can try it out on your data, and come back with the special cases that the code did not cover.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But right now nobody here has a clue what you want, and that is why you have not gotten a usable answer yet.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Apr 2020 11:10:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Selecting-the-data-with-a-specific-trend/m-p/644200#M35940</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-04-30T11:10:46Z</dc:date>
    </item>
    <item>
      <title>Re: Filter only which fits a specific trend</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Selecting-the-data-with-a-specific-trend/m-p/644201#M35941</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/310659"&gt;@AK100&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I know there is nothing critical in there, but can you say the same for millions of rows? I can assure you there are values in those millions who don't fit the trend. I want to filter them out as a precaution.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Its not that I don't want to help you, but I cant give give you (private) data which contains millions of rows, and to make 1 trend chart out of that millions rows I need approximately 1500+ rows. That means a data step would only give you usable data if I make a data step of 1500 rows, is that what you want? Do you want me to send you a data step of 1500 rows?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;We still don't really know what "trend" you want to find. And no, by the way, a data step of 1500 rows would probably not help, as it is one instance of such a trend, and we would need to see both matching trends (plural) and non-matching trends (plural). Maybe a plot showing some matching trends (plural) and some non-matching trends (plural) would move everything in the direction of helping us understand what you want. The plot can have 1500 data points (or more!) in each "trend".&lt;/P&gt;</description>
      <pubDate>Thu, 30 Apr 2020 11:14:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Selecting-the-data-with-a-specific-trend/m-p/644201#M35941</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-04-30T11:14:25Z</dc:date>
    </item>
    <item>
      <title>Re: Filter only which fits a specific trend</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Selecting-the-data-with-a-specific-trend/m-p/644234#M35942</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Okay guys I have tried to figure out some code for you. If you run the following code you will get (the mini version) of my data-set.&lt;/P&gt;
&lt;PRE&gt;data want1 ;
  length Value Location $40 Time 8 ;
  infile cards dsd dlm=':' truncover ;
  input Value Location Minutes Seconds ;
   time = minutes*60 + seconds ;
  format time time11.2 ;
cards;
17.000: Germany: 1:45.0
17.001: Germany:  1:45.1
17.220: Germany:  1:45.2
18.901: Germany: 1:45.3
1.091: Germany: 1:45.4
19.021: Germany: 1:45.5
16.023: Germany: 1:45.6
17.504: Germany: 1:45.7
17.600: Germany: 1:45.8
17.760: Germany: 1:45.9
19.759: Germany: 1:45.10
6.000: Germany: 1:45.11
2.454: Germany: 1:45.12
1.665: Germany: 1:45.13
0.435: Germany: 1:45.14
0.091: Germany: 1:45.15
0.654: Germany: 1:45.16
53.324: Germany: 1:45.17
0.554: Germany: 1:45.18
1.670: Germany: 1:45.19
3.050: Germany: 1:45.20
5.659: Germany: 1:45.21
17.540:Germany: 1:45.22
17.67: Germany: 1:45.23
17.546:Germany:  1:45.24
18.434:Germany:  1:45.25
16.655:Germany:  1:45.26
19.315:Germany:  1:45.27
16.323:Germany:  1:45.28
1.545:Germany:  1:45.29
19.323:Germany:  1:45.30
17.234:Germany:  1:45.31
22.215:Germany:  1:45.32
;;;;


&lt;/PRE&gt;
&lt;P&gt;This is the preferred trend I want to see: The first rows should have a value between 15 - 25, then in the middle rows the values need to drop between 0 and 5. In the last rows the values should rise again between 15 - 25 (High,Low,High). If I have this trend I can make my bathtub curve in VA.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However,&amp;nbsp; As you can also see in the output. Row &lt;STRONG&gt;5&lt;/STRONG&gt;, &lt;STRONG&gt;18&lt;/STRONG&gt; and &lt;STRONG&gt;30&lt;/STRONG&gt; have to high or to low values who don't fit the trend. These need to be out-filtered, so I need to take just the remaining rows. Please note that directly after this bunch of rows a new bunch starts again which will give me a new bathtub curve etc. In total I have more then 50 million rows. I wish all of them could be filtered the same way.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've tried my best to make things as clear as possible, hope this does okay. Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Apr 2020 12:58:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Selecting-the-data-with-a-specific-trend/m-p/644234#M35942</guid>
      <dc:creator>AK100</dc:creator>
      <dc:date>2020-04-30T12:58:27Z</dc:date>
    </item>
    <item>
      <title>Re: Filter only which fits a specific trend</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Selecting-the-data-with-a-specific-trend/m-p/644235#M35943</link>
      <description>&lt;P&gt;If we are going to pick out a trend from data that contains many trends, from a statistical point of view, we need to see examples (plural) of the trends you WANT and examples (plural) of the trends you DON'T WANT.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Apr 2020 13:03:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Selecting-the-data-with-a-specific-trend/m-p/644235#M35943</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-04-30T13:03:25Z</dc:date>
    </item>
    <item>
      <title>Re: Filter only which fits a specific trend</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Selecting-the-data-with-a-specific-trend/m-p/644237#M35944</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't think you understand what I want. In the code I have sent you there is data I WANT and data I DON'T want. Like I said row 5 ,18 and 30 need to be out-filtered. The rest can stay.&amp;nbsp; It doesn't make sense to add a trend which fits my criteria as it is already added in the previous code. But as you wish: here is a trend that DOES fit my criteria and which will give me the wished bathtub curve.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data want1 ;
  length Value Location $40 Time 8 ;
  infile cards dsd dlm=':' truncover ;
  input Value Location Minutes Seconds ;
   time = minutes*60 + seconds ;
  format time time11.2 ;
cards;
19.434: Germany: 2:45.0
16.545: Germany:  2:45.1
17.354: Germany:  2:45.2
17.943: Germany: 2:45.3
17.091: Germany: 2:45.4
17.545: Germany: 2:45.5
16.434: Germany: 2:45.6
17.504: Germany: 2:45.7
17.545: Germany: 2:45.8
17.542: Germany: 2:45.9
19.759: Germany: 2:45.10
3.000: Germany: 2:45.11
2.434: Germany: 2:45.12
1.545: Germany: 2:45.13
0.322: Germany: 2:45.14
0.654: Germany: 2:45.15
0.537: Germany: 2:45.16
53.786: Germany: 2:45.17
0.434: Germany: 2:45.18
17.646: Germany: 2:45.19
3.434: Germany: 2:45.20
5.659: Germany: 2:45.21
17.540:Germany: 2:45.22
20.434: Germany: 2:45.23
24.433:Germany:  2:45.24
16.545:Germany:  2:45.25
16.656:Germany:  2:45.26
19.315:Germany:  2:45.27
16.323:Germany:  2:45.28
16.545:Germany:  2:45.29
19.544:Germany:  2:45.30
19.234:Germany:  2:45.31
22.655:Germany:  2:45.32
;;;;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Apr 2020 13:11:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Selecting-the-data-with-a-specific-trend/m-p/644237#M35944</guid>
      <dc:creator>AK100</dc:creator>
      <dc:date>2020-04-30T13:11:24Z</dc:date>
    </item>
    <item>
      <title>Re: Filter only which fits a specific trend</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Selecting-the-data-with-a-specific-trend/m-p/644241#M35945</link>
      <description>&lt;P&gt;Do you have a maximum value for the "low" part of the cycle that is the same for all trends, or are those dynamic?&lt;/P&gt;
&lt;P&gt;(say, all "lows" for "Germany" are below 6, but for "UK" they are below 25)&lt;/P&gt;
&lt;P&gt;Likewise for the "high" part, can one define a fixed minimum value?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Edit: and is there an overall maximum value?&lt;/P&gt;</description>
      <pubDate>Thu, 30 Apr 2020 13:36:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Selecting-the-data-with-a-specific-trend/m-p/644241#M35945</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-04-30T13:36:15Z</dc:date>
    </item>
    <item>
      <title>Re: Filter only which fits a specific trend</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Selecting-the-data-with-a-specific-trend/m-p/644474#M35950</link>
      <description>No All lows must be below 6 for Germany as wel as the other locations. The same applies for the High parts. There is not really an overall maximum.</description>
      <pubDate>Fri, 01 May 2020 10:03:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Selecting-the-data-with-a-specific-trend/m-p/644474#M35950</guid>
      <dc:creator>AK100</dc:creator>
      <dc:date>2020-05-01T10:03:59Z</dc:date>
    </item>
    <item>
      <title>Re: Filter only which fits a specific trend</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Selecting-the-data-with-a-specific-trend/m-p/644480#M35952</link>
      <description>&lt;P&gt;Taking your first dataset (the second has different values), this code removes rows 5, 18 and 30:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
  length Value 8 Location $40 Time 8;
  infile cards dsd dlm=':' truncover;
  input Value Location Minutes Seconds;
  time = minutes * 60 + seconds;
  format time time11.2;
  drop minutes seconds;
cards;
17.000: Germany: 1:45.0
17.001: Germany:  1:45.1
17.220: Germany:  1:45.2
18.901: Germany: 1:45.3
1.091: Germany: 1:45.4
19.021: Germany: 1:45.5
16.023: Germany: 1:45.6
17.504: Germany: 1:45.7
17.600: Germany: 1:45.8
17.760: Germany: 1:45.9
19.759: Germany: 1:45.10
6.000: Germany: 1:45.11
2.454: Germany: 1:45.12
1.665: Germany: 1:45.13
0.435: Germany: 1:45.14
0.091: Germany: 1:45.15
0.654: Germany: 1:45.16
53.324: Germany: 1:45.17
0.554: Germany: 1:45.18
1.670: Germany: 1:45.19
3.050: Germany: 1:45.20
5.659: Germany: 1:45.21
17.540:Germany: 1:45.22
17.67: Germany: 1:45.23
17.546:Germany:  1:45.24
18.434:Germany:  1:45.25
16.655:Germany:  1:45.26
19.315:Germany:  1:45.27
16.323:Germany:  1:45.28
1.545:Germany:  1:45.29
19.323:Germany:  1:45.30
17.234:Germany:  1:45.31
22.215:Germany:  1:45.32
;

data want;
merge
  have
  have (firstobs=2 keep=value rename=(value=nvalue))
;
lvalue = lag(value);
if lvalue ne . and nvalue ne .
then do;
  if
    lvalue &amp;lt;= 6 and nvalue &amp;lt;= 6 and value &amp;gt; 6
  then del = 1;
  else if
    lvalue &amp;gt; 6 and nvalue &amp;gt; 6 and
    (value &amp;lt; 6 or value &amp;gt; (nvalue + lvalue))
  then del = 1;
end;
if not del;
drop nvalue lvalue del;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 01 May 2020 10:38:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Selecting-the-data-with-a-specific-trend/m-p/644480#M35952</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-05-01T10:38:11Z</dc:date>
    </item>
    <item>
      <title>Re: Filter only which fits a specific trend</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Selecting-the-data-with-a-specific-trend/m-p/645535#M35978</link>
      <description>The code did exactly what it had to do, thanks for that. But I was just wondering what the code are exactly doing? &lt;BR /&gt;</description>
      <pubDate>Wed, 06 May 2020 08:26:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Selecting-the-data-with-a-specific-trend/m-p/645535#M35978</guid>
      <dc:creator>AK100</dc:creator>
      <dc:date>2020-05-06T08:26:43Z</dc:date>
    </item>
    <item>
      <title>Re: Filter only which fits a specific trend</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Selecting-the-data-with-a-specific-trend/m-p/645537#M35979</link>
      <description>&lt;P&gt;The MERGE of the dataset with itself, but with FIRSTOBS=2, creates a "look-ahead" for value. Combined with using the LAG() function, I now have the preceding and succeeding value present for every observation.&lt;/P&gt;
&lt;P&gt;The first IF prevents the test being made for the first and last observation, as I either miss the lagged or following value. Then I do tests for both types of condition (a "spike up" when the values are low, or a "spike down" when values are high) and set a flag variable. I also test for an unnaturally high value within the second condition.&lt;/P&gt;
&lt;P&gt;After the tests, I use the flag variable to prevent the output of the current observation.&lt;/P&gt;</description>
      <pubDate>Wed, 06 May 2020 08:51:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Selecting-the-data-with-a-specific-trend/m-p/645537#M35979</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-05-06T08:51:55Z</dc:date>
    </item>
    <item>
      <title>Re: Filter only which fits a specific trend</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Selecting-the-data-with-a-specific-trend/m-p/645539#M35980</link>
      <description>&lt;P&gt;Okay, okay that makes sense already. Sound almost clear. Just something about the IF statements. Why do you use a '6' in the if statements?&lt;BR /&gt;&lt;BR /&gt;And, if i'm right. With the last piece of code you are actually saying "If there is a DEL = 1, then drop that whole row"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Something else. I did something as an exercise for myself. I have made negative numbers of the rows 5, 18 and 30. When I execute the code now, it only drops row 5 and 30. The same applies for when I make them all 3 blank fields, it only drops 5 and 30.&lt;/P&gt;</description>
      <pubDate>Wed, 06 May 2020 09:13:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Selecting-the-data-with-a-specific-trend/m-p/645539#M35980</guid>
      <dc:creator>AK100</dc:creator>
      <dc:date>2020-05-06T09:13:27Z</dc:date>
    </item>
    <item>
      <title>Re: Filter only which fits a specific trend</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Selecting-the-data-with-a-specific-trend/m-p/645542#M35981</link>
      <description>&lt;P&gt;Regarding your first question, I refer to your earlier post:&lt;/P&gt;
&lt;P&gt;"&lt;SPAN&gt;No All lows must be below 6 for Germany as wel as the other locations."&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;So I chose 6 as an arbitrary cutoff value between a "low" and "high" segment.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Second question: this is a &lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=lestmtsref&amp;amp;docsetTarget=p1cxl8ifdt8u0gn12wqbji8o5fq1.htm&amp;amp;locale=en" target="_blank" rel="noopener"&gt;Subsetting IF&lt;/A&gt;, and should read "keep the observation if the del flag is not set to true"&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Third question: carefully study the IF that checks the "high" segment; in it you find the condition that checks for an unnaturally high value (larger than the sum of preceding + succeeding). You can expand the IF that checks the "low" segment to check for an unnaturally low value (e. g. &amp;lt;= 0) in a similar fashion.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 06 May 2020 09:21:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Selecting-the-data-with-a-specific-trend/m-p/645542#M35981</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-05-06T09:21:41Z</dc:date>
    </item>
  </channel>
</rss>

