Trace  Hoeger

Trace Hoeger

1622705820

Create an array of dates for looping in Azure Data Factory

In today’s article I am going to share a solution on how to create an array of dates to loop through in an Azure Data Factory pipeline. An array like this can be useful when you need to run a set of activities for a specific date, and you need that period to be dynamic. For instance, in one pipeline run you wanted the last week, but in the next you need the whole month.

Aside from an Azure subscription and a Data Factory resource, the things needed are:

  • Three pipeline parameters: start date, number of days to include in the array and the time direction (past or future);
  • A pipeline array variable to hold the dates;
  • A ForEach activity to populate the array variable with the dates.

startDate is the starting point of the period. The ForEach will start on this date and, depending on the timeDirection parameter, will either add dates before or after this date. daysToGet specifies the number of days to include in the array.

The way the rest of the logic in this demo pipeline is set up, timeDirection can be a hyphen (-) to signify that we want dates before startdate, or any other character to get dates after instead. Note startDate is written in UTC format to simplify the code later on. The array is actually an array of UTC timestamps, but we are only interested in the date portions.

As an example, with the default values I included in the previous screenshot the pipeline would have an array with the week (last seven days) before March 1st 2021.

And here is the array variable, that defaults to an empty array:

This one-activity demo pipeline uses a ForEach to append each day to the array but, in a real pipeline, you would follow this up with a second ForEach to loop through that array and actually use the dates.

_This “Create date range” activity is looping through the values from zero until _daysToGet so the array has the number of dates needed.

Inside the loop there is a single Append variable activity. This activity is enough to process the logic to get a date and append it to the array:

We have a couple of nested function calls to make sure we move as many days forward or backward as needed in each iteration of the loop. This piece of code does three things (starting from the if):

  • Returns -1 if we want to move backwards from the startDate or 1 if we want to move forward, by checking if the timeDirection‘s value is a hyphen;
  • Then it multiplies the current value of the numeric loop by the value returned by if (e.g. in the first iteration with an hyphen for timeDirection, this multiplication would be 0 times -1, the second 1 times -1 and so on);
  • Lastly, it adds as many days to the startdate as the result of the multiplication, thanks to the addDays function. Again, with a timeDirection poiting to the past, the first iteration of the loop would have a multiplication result of 0, so the startDate is appended to the array, the second iteration appends the previous day (startDate minus one day), the third iteration append the day before that, and so on.

#data-science #azure-data-factory #azure

What is GEEK

Buddha Community

Create an array of dates for looping in Azure Data Factory
Siphiwe  Nair

Siphiwe Nair

1620466520

Your Data Architecture: Simple Best Practices for Your Data Strategy

If you accumulate data on which you base your decision-making as an organization, you should probably think about your data architecture and possible best practices.

If you accumulate data on which you base your decision-making as an organization, you most probably need to think about your data architecture and consider possible best practices. Gaining a competitive edge, remaining customer-centric to the greatest extent possible, and streamlining processes to get on-the-button outcomes can all be traced back to an organization’s capacity to build a future-ready data architecture.

In what follows, we offer a short overview of the overarching capabilities of data architecture. These include user-centricity, elasticity, robustness, and the capacity to ensure the seamless flow of data at all times. Added to these are automation enablement, plus security and data governance considerations. These points from our checklist for what we perceive to be an anticipatory analytics ecosystem.

#big data #data science #big data analytics #data analysis #data architecture #data transformation #data platform #data strategy #cloud data platform #data acquisition

Trace  Hoeger

Trace Hoeger

1622705820

Create an array of dates for looping in Azure Data Factory

In today’s article I am going to share a solution on how to create an array of dates to loop through in an Azure Data Factory pipeline. An array like this can be useful when you need to run a set of activities for a specific date, and you need that period to be dynamic. For instance, in one pipeline run you wanted the last week, but in the next you need the whole month.

Aside from an Azure subscription and a Data Factory resource, the things needed are:

  • Three pipeline parameters: start date, number of days to include in the array and the time direction (past or future);
  • A pipeline array variable to hold the dates;
  • A ForEach activity to populate the array variable with the dates.

startDate is the starting point of the period. The ForEach will start on this date and, depending on the timeDirection parameter, will either add dates before or after this date. daysToGet specifies the number of days to include in the array.

The way the rest of the logic in this demo pipeline is set up, timeDirection can be a hyphen (-) to signify that we want dates before startdate, or any other character to get dates after instead. Note startDate is written in UTC format to simplify the code later on. The array is actually an array of UTC timestamps, but we are only interested in the date portions.

As an example, with the default values I included in the previous screenshot the pipeline would have an array with the week (last seven days) before March 1st 2021.

And here is the array variable, that defaults to an empty array:

This one-activity demo pipeline uses a ForEach to append each day to the array but, in a real pipeline, you would follow this up with a second ForEach to loop through that array and actually use the dates.

_This “Create date range” activity is looping through the values from zero until _daysToGet so the array has the number of dates needed.

Inside the loop there is a single Append variable activity. This activity is enough to process the logic to get a date and append it to the array:

We have a couple of nested function calls to make sure we move as many days forward or backward as needed in each iteration of the loop. This piece of code does three things (starting from the if):

  • Returns -1 if we want to move backwards from the startDate or 1 if we want to move forward, by checking if the timeDirection‘s value is a hyphen;
  • Then it multiplies the current value of the numeric loop by the value returned by if (e.g. in the first iteration with an hyphen for timeDirection, this multiplication would be 0 times -1, the second 1 times -1 and so on);
  • Lastly, it adds as many days to the startdate as the result of the multiplication, thanks to the addDays function. Again, with a timeDirection poiting to the past, the first iteration of the loop would have a multiplication result of 0, so the startDate is appended to the array, the second iteration appends the previous day (startDate minus one day), the third iteration append the day before that, and so on.

#data-science #azure-data-factory #azure

Gerhard  Brink

Gerhard Brink

1620629020

Getting Started With Data Lakes

Frameworks for Efficient Enterprise Analytics

The opportunities big data offers also come with very real challenges that many organizations are facing today. Often, it’s finding the most cost-effective, scalable way to store and process boundless volumes of data in multiple formats that come from a growing number of sources. Then organizations need the analytical capabilities and flexibility to turn this data into insights that can meet their specific business objectives.

This Refcard dives into how a data lake helps tackle these challenges at both ends — from its enhanced architecture that’s designed for efficient data ingestion, storage, and management to its advanced analytics functionality and performance flexibility. You’ll also explore key benefits and common use cases.

Introduction

As technology continues to evolve with new data sources, such as IoT sensors and social media churning out large volumes of data, there has never been a better time to discuss the possibilities and challenges of managing such data for varying analytical insights. In this Refcard, we dig deep into how data lakes solve the problem of storing and processing enormous amounts of data. While doing so, we also explore the benefits of data lakes, their use cases, and how they differ from data warehouses (DWHs).


This is a preview of the Getting Started With Data Lakes Refcard. To read the entire Refcard, please download the PDF from the link above.

#big data #data analytics #data analysis #business analytics #data warehouse #data storage #data lake #data lake architecture #data lake governance #data lake management

Sid  Schuppe

Sid Schuppe

1617988080

How To Blend Data in Google Data Studio For Better Data Analysis

Using data to inform decisions is essential to product management, or anything really. And thankfully, we aren’t short of it. Any online application generates an abundance of data and it’s up to us to collect it and then make sense of it.

Google Data Studio helps us understand the meaning behind data, enabling us to build beautiful visualizations and dashboards that transform data into stories. If it wasn’t already, data literacy is as much a fundamental skill as learning to read or write. Or it certainly will be.

Nothing is more powerful than data democracy, where anyone in your organization can regularly make decisions informed with data. As part of enabling this, we need to be able to visualize data in a way that brings it to life and makes it more accessible. I’ve recently been learning how to do this and wanted to share some of the cool ways you can do this in Google Data Studio.

#google-data-studio #blending-data #dashboard #data-visualization #creating-visualizations #how-to-visualize-data #data-analysis #data-visualisation

Cyrus  Kreiger

Cyrus Kreiger

1618039260

How Has COVID-19 Impacted Data Science?

The COVID-19 pandemic disrupted supply chains and brought economies around the world to a standstill. In turn, businesses need access to accurate, timely data more than ever before. As a result, the demand for data analytics is skyrocketing as businesses try to navigate an uncertain future. However, the sudden surge in demand comes with its own set of challenges.

Here is how the COVID-19 pandemic is affecting the data industry and how enterprises can prepare for the data challenges to come in 2021 and beyond.

#big data #data #data analysis #data security #data integration #etl #data warehouse #data breach #elt