<?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 Is there a way in Azure to compare data in one field? in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/is-there-a-way-in-azure-to-compare-data-in-one-field/m-p/25492#M17732</link>
    <description>&lt;P&gt;Is there a way to compare a time stamp within on field/column for an individual ID?&amp;nbsp;For example, if I have two records for an ID and the time stamps are within 5 min of each other....I just want to keep the latest.&amp;nbsp;But, for example, if they were an hour apart I would keep both records.&lt;/P&gt;</description>
    <pubDate>Tue, 15 Mar 2022 21:31:48 GMT</pubDate>
    <dc:creator>CBull</dc:creator>
    <dc:date>2022-03-15T21:31:48Z</dc:date>
    <item>
      <title>Is there a way in Azure to compare data in one field?</title>
      <link>https://community.databricks.com/t5/data-engineering/is-there-a-way-in-azure-to-compare-data-in-one-field/m-p/25492#M17732</link>
      <description>&lt;P&gt;Is there a way to compare a time stamp within on field/column for an individual ID?&amp;nbsp;For example, if I have two records for an ID and the time stamps are within 5 min of each other....I just want to keep the latest.&amp;nbsp;But, for example, if they were an hour apart I would keep both records.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Mar 2022 21:31:48 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/is-there-a-way-in-azure-to-compare-data-in-one-field/m-p/25492#M17732</guid>
      <dc:creator>CBull</dc:creator>
      <dc:date>2022-03-15T21:31:48Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way in Azure to compare data in one field?</title>
      <link>https://community.databricks.com/t5/data-engineering/is-there-a-way-in-azure-to-compare-data-in-one-field/m-p/25493#M17733</link>
      <description>&lt;P&gt;Windowing function can be what you need. &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;from pyspark.sql import functions as F
df.groupBy(F.window("event_time","5 minutes"))&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Mar 2022 19:51:59 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/is-there-a-way-in-azure-to-compare-data-in-one-field/m-p/25493#M17733</guid>
      <dc:creator>merca</dc:creator>
      <dc:date>2022-03-23T19:51:59Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way in Azure to compare data in one field?</title>
      <link>https://community.databricks.com/t5/data-engineering/is-there-a-way-in-azure-to-compare-data-in-one-field/m-p/25494#M17734</link>
      <description>&lt;P&gt;So, is this done something like this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;r.patientmedicalrecordnumber,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;r.callreceiveddatetime as date&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;FROM&amp;nbsp;&amp;nbsp;table r&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;LEFT OUTER JOIN table p&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ON r.pageid = p.pageid&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;WHERE  p.pagetype  = 6&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;and cast(r.callreceiveddatetime as date) = current_date() - 1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;df.groupBy (r.window("event_time","5 minutes"))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ORDER&amp;nbsp;BY r.callreceiveddatetime&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Mar 2022 20:12:43 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/is-there-a-way-in-azure-to-compare-data-in-one-field/m-p/25494#M17734</guid>
      <dc:creator>CBull</dc:creator>
      <dc:date>2022-03-23T20:12:43Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way in Azure to compare data in one field?</title>
      <link>https://community.databricks.com/t5/data-engineering/is-there-a-way-in-azure-to-compare-data-in-one-field/m-p/25495#M17735</link>
      <description>&lt;P&gt;Since you are trying to do this in SQL, I hope someone else can write you the correct answer. The above example is for pyspark. You can check the SQL synax from &lt;A href="https://docs.databricks.com/sql/language-manual/sql-ref-window-functions.html" alt="https://docs.databricks.com/sql/language-manual/sql-ref-window-functions.html" target="_blank"&gt;Databricks documents&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Mar 2022 03:00:45 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/is-there-a-way-in-azure-to-compare-data-in-one-field/m-p/25495#M17735</guid>
      <dc:creator>merca</dc:creator>
      <dc:date>2022-03-24T03:00:45Z</dc:date>
    </item>
  </channel>
</rss>

