Forum Discussion
Stinkys
Advocate II
1 year agoCreating 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,...
- 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')
Stinkys
Advocate II
1 year agoThanks 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.