-1

I want to create a date spread from 01-01-2005 till 23-01-2015, is it possible to populate such a dates range in the Azure data factory (specifically in mapping data flows). If yes then which function should one use to apply the same.

Thank you!

  • The best way to do this is use a date dimension in your database and then do a simple Lookup activity or Mapping Data Flows equivalent. – wBob Mar 11 '22 at 14:30
  • Please be sure to show your work and where, specifically, you're stuck. Unfortunately, this question is too broad as written (there's no specific problem). – David Makogon Mar 12 '22 at 01:23
  • you can create a list in the pipeline and pass it as a parameter to the flow. No need for a database. https://medium.com/geekculture/create-an-array-of-dates-for-looping-in-azure-data-factory-da148e01bc10 – adrien May 15 '23 at 11:50

1 Answers1

1

You can use Until activity to loop through start and end dates and add append variable activity to append the dates to get the range of dates.

  1. Create a bunch of variables for start date, end date, number of days to be appended.

enter image description here

  1. Until activity:

enter image description here

increment day by 1 : @string(add(int(variables('add_count')),1))

days to add : @variables('count')

Append date to list : @formatdatetime(adddays(formatdatetime(variables('start'),'MM-dd-yyyy'),int(variables('count'))),'MM-dd-yyyy')

max date from list : @adddays(formatdatetime(variables('start')),int(variables('count')))

enter image description here

output list of dates:

enter image description here

NiharikaMoola-MT
  • 4,700
  • 1
  • 3
  • 15
  • Please note that the OP hasn't asked a specific question, and just asked a broad "how to do it" question, without showing any work of their own. Best to just provide guidance on asking a better question, rather than writing a detailed answer – David Makogon Mar 12 '22 at 01:24