Forum Discussion

Stinkys's avatar
Stinkys
Advocate II
1 year ago
Solved

Creating Composite Primary Key

Hi all,   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,...
  • FabianSchut's avatar
    1 year ago

    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:

    Table.TransformColumns(#"Changed column type", {{"Column1", each Date.ToText(Date.From(_),"yyyy-MM-dd"), type text}})

    If you want to achieve this with Python use something like

    .strftime('%Y-%m-%d')