<?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 Dataflux data management studio - data filtering problem in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/Dataflux-data-management-studio-data-filtering-problem/m-p/907516#M20892</link>
    <description>&lt;P&gt;Long-time fluxer, first-time poster&lt;BR /&gt;&lt;BR /&gt;Hi all!&amp;nbsp;&lt;SPAN&gt;I desperately need advice with the following issue:&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I have a problem with DataFlux Data Management Studio related to &lt;STRONG&gt;SAS Base-based tables&lt;/STRONG&gt;. I would like to be able to filter data in the same way as with SQL queries, but I have no idea how to achieve this using the EEL language.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Simply put, my dataset includes data from different reporting months, and I would like to be able to filter the data based on various conditions, for example, according to different report dt.&amp;nbsp;&lt;SPAN&gt;Additionally, the information should be retrieved from each row, not just a single max report dt from the table.&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;Here's an example&amp;nbsp; of dataflux SQL query where we get the max report dt and the next largest report dt (-1) (just to&lt;SPAN&gt;&amp;nbsp;give you an idea of what I'm looking for):&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;example.REPORT_DT = (Select MAX(REPORT_DT) from example)&lt;BR /&gt;example.REPORT_DT &amp;gt;= DATEADD(day, -1, CAST(GETDATE() as date))&lt;BR /&gt;&lt;BR /&gt;All ideas and suggestions are welcome &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Br,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Atte&lt;/P&gt;</description>
    <pubDate>Tue, 12 Dec 2023 13:10:59 GMT</pubDate>
    <dc:creator>Atte51</dc:creator>
    <dc:date>2023-12-12T13:10:59Z</dc:date>
    <item>
      <title>Dataflux data management studio - data filtering problem</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Dataflux-data-management-studio-data-filtering-problem/m-p/907516#M20892</link>
      <description>&lt;P&gt;Long-time fluxer, first-time poster&lt;BR /&gt;&lt;BR /&gt;Hi all!&amp;nbsp;&lt;SPAN&gt;I desperately need advice with the following issue:&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I have a problem with DataFlux Data Management Studio related to &lt;STRONG&gt;SAS Base-based tables&lt;/STRONG&gt;. I would like to be able to filter data in the same way as with SQL queries, but I have no idea how to achieve this using the EEL language.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Simply put, my dataset includes data from different reporting months, and I would like to be able to filter the data based on various conditions, for example, according to different report dt.&amp;nbsp;&lt;SPAN&gt;Additionally, the information should be retrieved from each row, not just a single max report dt from the table.&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;Here's an example&amp;nbsp; of dataflux SQL query where we get the max report dt and the next largest report dt (-1) (just to&lt;SPAN&gt;&amp;nbsp;give you an idea of what I'm looking for):&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;example.REPORT_DT = (Select MAX(REPORT_DT) from example)&lt;BR /&gt;example.REPORT_DT &amp;gt;= DATEADD(day, -1, CAST(GETDATE() as date))&lt;BR /&gt;&lt;BR /&gt;All ideas and suggestions are welcome &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Br,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Atte&lt;/P&gt;</description>
      <pubDate>Tue, 12 Dec 2023 13:10:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Dataflux-data-management-studio-data-filtering-problem/m-p/907516#M20892</guid>
      <dc:creator>Atte51</dc:creator>
      <dc:date>2023-12-12T13:10:59Z</dc:date>
    </item>
    <item>
      <title>Re: Dataflux data management studio - data filter problem</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Dataflux-data-management-studio-data-filtering-problem/m-p/907527#M20893</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am not sure I completely understand what you're trying to achieve. If you can give an example of the data you have in input and the output you expect, I can take a look at what can be done with the Expression node.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Audrey&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Dec 2023 13:18:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Dataflux-data-management-studio-data-filtering-problem/m-p/907527#M20893</guid>
      <dc:creator>audrey</dc:creator>
      <dc:date>2023-12-12T13:18:42Z</dc:date>
    </item>
    <item>
      <title>Re: Dataflux data management studio - data filtering problem</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Dataflux-data-management-studio-data-filtering-problem/m-p/907530#M20894</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;In the SQL Query Node, you can enter&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="highlight"&gt;&lt;SPAN class="SearchHighlight1"&gt;SQL&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;that is specific to the data source that is selected in the&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG class="b_1"&gt;Data Source&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;field above&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If you selected a SAS table that is accessed with a&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="PrimarydfFederation"&gt;SAS Federation Server&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;connection or a SAS Data Set Connection, you can enter&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="PrimarydfFed"&gt;Federation Server&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;FedSQL, which is described in the&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/fedsqlref/titlepage.htm" target="_self"&gt;&lt;I&gt;SAS Federation Server FedSQL Reference Guide&lt;/I&gt;&lt;/A&gt;&lt;SPAN&gt;. If you selected a database table that is accessed with an ODBC connection, you could enter database-specific syntax. For more information, see the ODBC help in&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="PrimarydfUnityMed"&gt;DataFlux Data Management Studio&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;and also the documentation for the database.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I tested successfully these queries&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;select a.* from SAS.ORDERS a where delivery_date = (select max(b.delivery_date) from SAS.ORDERS b)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;select * from SAS.ORDERS&amp;nbsp;where delivery_date &amp;gt;= today() - 1&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Dec 2023 13:32:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Dataflux-data-management-studio-data-filtering-problem/m-p/907530#M20894</guid>
      <dc:creator>VincentRejany</dc:creator>
      <dc:date>2023-12-12T13:32:39Z</dc:date>
    </item>
    <item>
      <title>Re: Dataflux data management studio - data filter problem</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Dataflux-data-management-studio-data-filtering-problem/m-p/907535#M20895</link>
      <description>&lt;P&gt;Hello Audrey!&lt;/P&gt;&lt;P&gt;Certainly! So, as you can see in the picture, I have daily data on a table, and I would like to be able to retrieve the maximum value and possibly the next value from these maximum values.&lt;/P&gt;&lt;P&gt;I am creating data quality rules that require examining only the latest values. In the data on the table, there is no variable that indicates a "valid" value. The only way to retrieve the latest values is the newest row in the table based on the report_dt. I also have a need to occasionally compare the differences between values for different dates, so I would like to be able to retrieve the next highest value (-1) from the data.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Dec 2023 13:46:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Dataflux-data-management-studio-data-filtering-problem/m-p/907535#M20895</guid>
      <dc:creator>Atte51</dc:creator>
      <dc:date>2023-12-12T13:46:34Z</dc:date>
    </item>
    <item>
      <title>Re: Dataflux data management studio - data filtering problem</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Dataflux-data-management-studio-data-filtering-problem/m-p/907536#M20896</link>
      <description>&lt;P&gt;Hi VincentRejany!&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To my knowledge, the SQL node cannot be used with SAS base tables. At least, that has been my understanding. This solution solved the problem immediately, but as far as I know, I have to use the data source node with SAS base tables, where there is no SQL capability.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Dec 2023 13:47:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Dataflux-data-management-studio-data-filtering-problem/m-p/907536#M20896</guid>
      <dc:creator>Atte51</dc:creator>
      <dc:date>2023-12-12T13:47:17Z</dc:date>
    </item>
    <item>
      <title>Re: Dataflux data management studio - data filter problem</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Dataflux-data-management-studio-data-filtering-problem/m-p/907550#M20897</link>
      <description>&lt;P&gt;I don't think there's anything pre-build to calculate the max of a list of records. The max function exists in EEL but will take values as arguments, so not what you need.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can try to use some simple code in the Expression node&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;//Pre-Expression&amp;nbsp;
//Setting variables
boolean isMaxVal;
hidden integer prevMaxVal;
isMaxVal= false;
prevMaxVal=0;

//Expression
if `Frequency` &amp;gt;= prevMaxVal
begin
   isMaxVal = true;
   prevMaxVal=`Frequency`;
end
else &lt;BR /&gt;   isMaxVal=false;&lt;/CODE&gt;&lt;/PRE&gt;
This might require your data to be sorted though.&lt;/DIV&gt;
&lt;DIV&gt;The same logic could apply to the latest value.&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Does this help?&lt;/DIV&gt;</description>
      <pubDate>Tue, 12 Dec 2023 14:20:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Dataflux-data-management-studio-data-filtering-problem/m-p/907550#M20897</guid>
      <dc:creator>audrey</dc:creator>
      <dc:date>2023-12-12T14:20:52Z</dc:date>
    </item>
    <item>
      <title>Re: Dataflux data management studio - data filter problem</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Dataflux-data-management-studio-data-filtering-problem/m-p/907736#M20898</link>
      <description>&lt;P&gt;Hi Audrey,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This worked really nicely, thanks very much!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-Atte&lt;/P&gt;</description>
      <pubDate>Wed, 13 Dec 2023 12:39:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Dataflux-data-management-studio-data-filtering-problem/m-p/907736#M20898</guid>
      <dc:creator>Atte51</dc:creator>
      <dc:date>2023-12-13T12:39:15Z</dc:date>
    </item>
  </channel>
</rss>

