<?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 Creating Composite Primary Key in Dataflow</title>
    <link>https://community.fabric.microsoft.com/t5/Dataflow/Creating-Composite-Primary-Key/m-p/4271938#M4548</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to understand the best method for creating a composite primary key where one of the columns is a date. I have several columns that when combined create my unique record - int, text, date. In lakehouse my date is stored in yyyy-mm-dd however when working with Text.Combine in Dataflow Gen2 it outputs as dd/mm/yyyy.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyone have a guide on how to best implement a composite key that will respect the original database date format so that my composite key will be along the lines of "6789-ABC123-2024-11-05"? I feel like PySpark might be the best answer here in generating keys prior to or after the DFG2 process.&lt;/P&gt;</description>
    <pubDate>Wed, 06 Nov 2024 06:21:50 GMT</pubDate>
    <dc:creator>Stinkys</dc:creator>
    <dc:date>2024-11-06T06:21:50Z</dc:date>
    <item>
      <title>Creating Composite Primary Key</title>
      <link>https://community.fabric.microsoft.com/t5/Dataflow/Creating-Composite-Primary-Key/m-p/4271938#M4548</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to understand the best method for creating a composite primary key where one of the columns is a date. I have several columns that when combined create my unique record - int, text, date. In lakehouse my date is stored in yyyy-mm-dd however when working with Text.Combine in Dataflow Gen2 it outputs as dd/mm/yyyy.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyone have a guide on how to best implement a composite key that will respect the original database date format so that my composite key will be along the lines of "6789-ABC123-2024-11-05"? I feel like PySpark might be the best answer here in generating keys prior to or after the DFG2 process.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Nov 2024 06:21:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Dataflow/Creating-Composite-Primary-Key/m-p/4271938#M4548</guid>
      <dc:creator>Stinkys</dc:creator>
      <dc:date>2024-11-06T06:21:50Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Composite Primary Key</title>
      <link>https://community.fabric.microsoft.com/t5/Dataflow/Creating-Composite-Primary-Key/m-p/4271996#M4549</link>
      <description>&lt;P&gt;Hi, in DataFlow Gen2, you first need to convert the date format to a string format where you have defined the string format yourself. An example of a query will look like this:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Table.TransformColumns(#"Changed column type", {{&lt;/SPAN&gt;&lt;SPAN&gt;"Column1"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;each&lt;/SPAN&gt;&lt;SPAN&gt; Date.ToText(Date.From(_),&lt;/SPAN&gt;&lt;SPAN&gt;"yyyy-MM-dd"&lt;/SPAN&gt;&lt;SPAN&gt;), &lt;/SPAN&gt;&lt;SPAN&gt;type&lt;/SPAN&gt; &lt;SPAN&gt;text&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;}})&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;P&gt;If you want to achieve this with Python use something like&lt;/P&gt;&lt;PRE&gt;.strftime(&lt;SPAN class=""&gt;'%Y-%m-%d'&lt;/SPAN&gt;)&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 06 Nov 2024 06:47:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Dataflow/Creating-Composite-Primary-Key/m-p/4271996#M4549</guid>
      <dc:creator>FabianSchut</dc:creator>
      <dc:date>2024-11-06T06:47:17Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Composite Primary Key</title>
      <link>https://community.fabric.microsoft.com/t5/Dataflow/Creating-Composite-Primary-Key/m-p/4273079#M4556</link>
      <description>&lt;P&gt;Thanks for the reply Fabian. I was hoping there was a cleaner method for this, as it seems counter-intuitive to go from db date (db) to formatted date (dfg2 initial load) to db date (for merge) then back to clean formatted date for data warehouse. Would be nice if I could work with that raw db date value in dfg2.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Nov 2024 22:02:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Dataflow/Creating-Composite-Primary-Key/m-p/4273079#M4556</guid>
      <dc:creator>Stinkys</dc:creator>
      <dc:date>2024-11-06T22:02:16Z</dc:date>
    </item>
  </channel>
</rss>

