<?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: Concatenating strings based on previous row values in Machine Learning</title>
    <link>https://community.databricks.com/t5/machine-learning/concatenating-strings-based-on-previous-row-values/m-p/32605#M1734</link>
    <description>&lt;P&gt;&lt;A href="https://speakerdeck.com/mitasingh" target="test_blank"&gt;https://speakerdeck.com/mitasingh&lt;/A&gt; &lt;A href="https://telegra.ph/Free-Printable-cover-letter-template-01-17" target="test_blank"&gt;https://telegra.ph/Free-Printable-cover-letter-template-01-17&lt;/A&gt; &lt;A href="https://www.imdb.com/user/ur148564602/?ref_=nv_usr_prof_2" target="test_blank"&gt;https://www.imdb.com/user/ur148564602/?ref_=nv_usr_prof_2&lt;/A&gt; &lt;A href="https://www.glenewinestate.com.au/profile/coverletter50/profile" target="test_blank"&gt;https://www.glenewinestate.com.au/profile/coverletter50/profile&lt;/A&gt; &lt;A href="https://www.wpanet.org/profile/coverletter50/profile" target="test_blank"&gt;https://www.wpanet.org/profile/coverletter50/profile&lt;/A&gt; &lt;A href="https://www.clarinetu.com/profile/coverletter50/profile" target="test_blank"&gt;https://www.clarinetu.com/profile/coverletter50/profile&lt;/A&gt; &lt;A href="https://www.digital.hms.org.il/profile/coverletter50/profile" target="test_blank"&gt;https://www.digital.hms.org.il/profile/coverletter50/profile&lt;/A&gt; &lt;A href="https://www.gn2.poli.ufrj.br/profile/coverletter50/profile" target="test_blank"&gt;https://www.gn2.poli.ufrj.br/profile/coverletter50/profile&lt;/A&gt; &lt;A href="https://www.figma.com/@mitasingh" target="test_blank"&gt;https://www.figma.com/@mitasingh&lt;/A&gt; &lt;A href="https://kuula.co/profile/mitasingh" target="test_blank"&gt;https://kuula.co/profile/mitasingh&lt;/A&gt; &lt;A href="https://participation.lillemetropole.fr/profiles/mitasingh/activity" target="test_blank"&gt;https://participation.lillemetropole.fr/profiles/mitasingh/activity&lt;/A&gt; &lt;A href="https://coactuemtest.ub.edu/profiles/mitasingh/activity" target="test_blank"&gt;https://coactuemtest.ub.edu/profiles/mitasingh/activity&lt;/A&gt; &lt;A href="https://questions.parlement-ouvert.fr/profiles/mitasingh/activity?locale=en" target="test_blank"&gt;https://questions.parlement-ouvert.fr/profiles/mitasingh/activity?locale=en&lt;/A&gt; &lt;A href="https://otakumode.com/mitasingh" target="test_blank"&gt;https://otakumode.com/mitasingh&lt;/A&gt; &lt;A href="https://linkworld.us/profile/mitasingh" target="test_blank"&gt;https://linkworld.us/profile/mitasingh&lt;/A&gt; &lt;A href="http://82808.homepagemodules.de/u458_mitasingh.html" target="test_blank"&gt;http://82808.homepagemodules.de/u458_mitasingh.html&lt;/A&gt; &lt;A href="http://bcmoney-mobiletv.com/mitasingh" target="test_blank"&gt;http://bcmoney-mobiletv.com/mitasingh&lt;/A&gt; &lt;/P&gt;</description>
    <pubDate>Sat, 12 Feb 2022 09:28:18 GMT</pubDate>
    <dc:creator>sri</dc:creator>
    <dc:date>2022-02-12T09:28:18Z</dc:date>
    <item>
      <title>Concatenating strings based on previous row values</title>
      <link>https://community.databricks.com/t5/machine-learning/concatenating-strings-based-on-previous-row-values/m-p/32600#M1729</link>
      <description>&lt;P&gt;Consider the following input:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;ID          PrevID
-------- ---------
33          NULL
272       33
317        272
318        317&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I need to somehow get the following result:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Result
--------
/33
/33/272
/33/272/317
/33/272/317/318&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I need to do this in SQL and if REALLY not possible, then anything else goes, and Databricks does not support recursive CTE's so I am out of ideas, i have an SQL Fiddle here that illustrates the recursivce CTE way that doesn't work on databricks: &lt;A href="http://sqlfiddle.com/#!18/101df/3/0" alt="http://sqlfiddle.com/#!18/101df/3/0" target="_blank"&gt;http://sqlfiddle.com/#!18/101df/3/0&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help is appreciated, thanks&lt;/P&gt;</description>
      <pubDate>Thu, 23 Dec 2021 21:12:31 GMT</pubDate>
      <guid>https://community.databricks.com/t5/machine-learning/concatenating-strings-based-on-previous-row-values/m-p/32600#M1729</guid>
      <dc:creator>shaz</dc:creator>
      <dc:date>2021-12-23T21:12:31Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenating strings based on previous row values</title>
      <link>https://community.databricks.com/t5/machine-learning/concatenating-strings-based-on-previous-row-values/m-p/32602#M1731</link>
      <description>&lt;P&gt;Hi @Kaniz Fatma​&amp;nbsp;, Thanks for following up ! Great to meet you too&lt;/P&gt;</description>
      <pubDate>Fri, 24 Dec 2021 13:03:38 GMT</pubDate>
      <guid>https://community.databricks.com/t5/machine-learning/concatenating-strings-based-on-previous-row-values/m-p/32602#M1731</guid>
      <dc:creator>shaz</dc:creator>
      <dc:date>2021-12-24T13:03:38Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenating strings based on previous row values</title>
      <link>https://community.databricks.com/t5/machine-learning/concatenating-strings-based-on-previous-row-values/m-p/32603#M1732</link>
      <description>&lt;P&gt;Hi @Shazal Gomes​&amp;nbsp;,&lt;/P&gt;&lt;P&gt;I found out using pyspark this solution&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;from pyspark.sql import functions as F
from pyspark.sql.window import Window
from pyspark.sql import Row
from pyspark.sql.types import *
&amp;nbsp;
&amp;nbsp;
&amp;nbsp;
ids = ["33", "272", "317", "318"]
df_ids = spark.createDataFrame([Row(ID = i) for i in ids])
&amp;nbsp;
display(
  df_ids.withColumn(
    'PREVIOUS_ID', F.concat_ws('/',F.array_sort(F.collect_set(F.col('ID')).over(Window.orderBy(F.col('ID').cast('integer'))).cast('array&amp;lt;integer&amp;gt;')))
  )
)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know if It meets your need.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 08 Jan 2022 16:49:37 GMT</pubDate>
      <guid>https://community.databricks.com/t5/machine-learning/concatenating-strings-based-on-previous-row-values/m-p/32603#M1732</guid>
      <dc:creator>Pholo</dc:creator>
      <dc:date>2022-01-08T16:49:37Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenating strings based on previous row values</title>
      <link>https://community.databricks.com/t5/machine-learning/concatenating-strings-based-on-previous-row-values/m-p/32604#M1733</link>
      <description>&lt;P&gt;Hi, thanks for this code, it works as needed ! really would've liked to have it in SQL but this will do for now! Thank you&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jan 2022 19:18:59 GMT</pubDate>
      <guid>https://community.databricks.com/t5/machine-learning/concatenating-strings-based-on-previous-row-values/m-p/32604#M1733</guid>
      <dc:creator>shaz</dc:creator>
      <dc:date>2022-01-10T19:18:59Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenating strings based on previous row values</title>
      <link>https://community.databricks.com/t5/machine-learning/concatenating-strings-based-on-previous-row-values/m-p/32605#M1734</link>
      <description>&lt;P&gt;&lt;A href="https://speakerdeck.com/mitasingh" target="test_blank"&gt;https://speakerdeck.com/mitasingh&lt;/A&gt; &lt;A href="https://telegra.ph/Free-Printable-cover-letter-template-01-17" target="test_blank"&gt;https://telegra.ph/Free-Printable-cover-letter-template-01-17&lt;/A&gt; &lt;A href="https://www.imdb.com/user/ur148564602/?ref_=nv_usr_prof_2" target="test_blank"&gt;https://www.imdb.com/user/ur148564602/?ref_=nv_usr_prof_2&lt;/A&gt; &lt;A href="https://www.glenewinestate.com.au/profile/coverletter50/profile" target="test_blank"&gt;https://www.glenewinestate.com.au/profile/coverletter50/profile&lt;/A&gt; &lt;A href="https://www.wpanet.org/profile/coverletter50/profile" target="test_blank"&gt;https://www.wpanet.org/profile/coverletter50/profile&lt;/A&gt; &lt;A href="https://www.clarinetu.com/profile/coverletter50/profile" target="test_blank"&gt;https://www.clarinetu.com/profile/coverletter50/profile&lt;/A&gt; &lt;A href="https://www.digital.hms.org.il/profile/coverletter50/profile" target="test_blank"&gt;https://www.digital.hms.org.il/profile/coverletter50/profile&lt;/A&gt; &lt;A href="https://www.gn2.poli.ufrj.br/profile/coverletter50/profile" target="test_blank"&gt;https://www.gn2.poli.ufrj.br/profile/coverletter50/profile&lt;/A&gt; &lt;A href="https://www.figma.com/@mitasingh" target="test_blank"&gt;https://www.figma.com/@mitasingh&lt;/A&gt; &lt;A href="https://kuula.co/profile/mitasingh" target="test_blank"&gt;https://kuula.co/profile/mitasingh&lt;/A&gt; &lt;A href="https://participation.lillemetropole.fr/profiles/mitasingh/activity" target="test_blank"&gt;https://participation.lillemetropole.fr/profiles/mitasingh/activity&lt;/A&gt; &lt;A href="https://coactuemtest.ub.edu/profiles/mitasingh/activity" target="test_blank"&gt;https://coactuemtest.ub.edu/profiles/mitasingh/activity&lt;/A&gt; &lt;A href="https://questions.parlement-ouvert.fr/profiles/mitasingh/activity?locale=en" target="test_blank"&gt;https://questions.parlement-ouvert.fr/profiles/mitasingh/activity?locale=en&lt;/A&gt; &lt;A href="https://otakumode.com/mitasingh" target="test_blank"&gt;https://otakumode.com/mitasingh&lt;/A&gt; &lt;A href="https://linkworld.us/profile/mitasingh" target="test_blank"&gt;https://linkworld.us/profile/mitasingh&lt;/A&gt; &lt;A href="http://82808.homepagemodules.de/u458_mitasingh.html" target="test_blank"&gt;http://82808.homepagemodules.de/u458_mitasingh.html&lt;/A&gt; &lt;A href="http://bcmoney-mobiletv.com/mitasingh" target="test_blank"&gt;http://bcmoney-mobiletv.com/mitasingh&lt;/A&gt; &lt;/P&gt;</description>
      <pubDate>Sat, 12 Feb 2022 09:28:18 GMT</pubDate>
      <guid>https://community.databricks.com/t5/machine-learning/concatenating-strings-based-on-previous-row-values/m-p/32605#M1734</guid>
      <dc:creator>sri</dc:creator>
      <dc:date>2022-02-12T09:28:18Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenating strings based on previous row values</title>
      <link>https://community.databricks.com/t5/machine-learning/concatenating-strings-based-on-previous-row-values/m-p/35691#M1847</link>
      <description>&lt;P&gt;Hi Kaniz:&lt;/P&gt;&lt;P&gt;I am reaching out for assistance using SQL/T-SQL for a string function to use on a concatenated string (i.e., DATABRICKS concatenated functionality is used to create unique identification names in the data table).&amp;nbsp; I have read-only access and need to validate huge data sets.&amp;nbsp; Thank you in advance!&lt;/P&gt;&lt;P&gt;Kind regards - Karen&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jun 2023 14:29:28 GMT</pubDate>
      <guid>https://community.databricks.com/t5/machine-learning/concatenating-strings-based-on-previous-row-values/m-p/35691#M1847</guid>
      <dc:creator>Kari_05152023</dc:creator>
      <dc:date>2023-06-28T14:29:28Z</dc:date>
    </item>
  </channel>
</rss>

