azure - Azure 数据工厂中的 DayOfWeek 动态函数

标签 azure azure-functions azure-sql-database azure-data-factory

我有一个像这样的列 abc - 11/04/2020 1:17:40 日期格式 我想创建一个派生列,其中我需要为 abc 列中存在的每一行动态地使用 dayOfWeek

我尝试在 adf 中使用派生列,但它没有显示所有内容都为 NULL 的那一天。

下面是数据流管道的图像,我尝试在其中添加带有表达式的派生列。我尝试将 abc 列传递到那里,但没有用,它没有出现。

如何解决这个问题?

Sample image of table

最佳答案

您可以使用以下表达式,添加日期格式:

dayOfWeek(toDate(abc,'MM/dd/yyyy'))

我测试过,效果很好: enter image description here

更新:

对于您的另一个问题,我们可以使用 case 来实现:

case(dayOfWeek(toDate(abc,'MM/dd/yyyy'))==0,'Sunday',
dayOfWeek(toDate(abc,'MM/dd/yyyy'))==1,'Monday',
dayOfWeek(toDate(abc,'MM/dd/yyyy'))==2,'Tuesday',
dayOfWeek(toDate(abc,'MM/dd/yyyy'))==3,'Wednesday',
dayOfWeek(toDate(abc,'MM/dd/yyyy'))==4,'Thursday',
dayOfWeek(toDate(abc,'MM/dd/yyyy'))==5,'Fraiday',
dayOfWeek(toDate(abc,'MM/dd/yyyy'))==6,'Saturday'
 )

截图:

enter image description here

关于azure - Azure 数据工厂中的 DayOfWeek 动态函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63475491/

相关文章:

asp.net-mvc - Azure 数据库出现错误:参数 'nameOrConnectionString' 不能为 null、为空或仅包含空格

Azure DTU 定价结构

visual-studio-2010 - azure vhd 挂载异常 ERROR_HTTPS_NOT_SUPPORTED

Azure 连接字符串不会覆盖 appsettings.json

reactjs - 如何在 api (asp.net api) 中对通过 spa(react 应用程序)从 azure ad b2c 获取的访问 token 进行身份验证?

多个应用程序的 Azure Functions 定价

azure - Azure 上的 jupyterhub 和 Linux 数据科学虚拟机。

python - 具有多个 Python 文件的 Azure 函数

azure - 无法从 VS Code Azure Function 连接到 CosmosDB

azure - 使用 PowerShell 添加 Azure AD 帐户作为 SQL 登录失败