在Alteryx中生成日期

发布于 2025-02-05 22:31:09 字数 167 浏览 4 评论 0原文

是否有一种方法可以通过使用RecordID作为初始化表达式来生成开始日期和结束日期之间的日期?原因是因为我的某些数据是重复的,无论是数据的日期还是不同的部分,我仍然想生成日期以填充它们是否重复。如果我使用每个记录的起始日期,则由于重复的信息而生成后的一些记录。但是,如果我可以使用每个记录的记录ID,而不是包含所有记录。

Is there a way that I can generate dates between a Start and an End Date by using a RecordID as the Initialization Expression? The reason is because some of my data has duplicates whether that be the date or a different part of the data and I want to still generate dates to fill in between them whether part of it is duplicate or not. If I use the starting date for each record than it leaves some of the records out after generating because of duplicate information. But if I could use the recordID which is unique to each one than it would include all of the records.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

故事未完 2025-02-12 22:31:09

首先,隔离所需的开始和结束日期,例如使用要生成Mindate作为min([YourDateField])maxdate as max([yourdatefield])

然后将它们发送到a 生成行工具。在该工具中,指定您要创建一个新变量,让我们称其为[newdate]。对于初始化表达式,只需指定[Mindate],对于条件表达式,指定[newdate。 < = [maxdate],对于循环表达式,指定dateTimeadd([[newdate],1,'days') ...该工具的输出将是所有天数(作为行)从Mindate到Maxdate。

然后 join 将其回到您的主要数据newdate = yourdate = yourdatefield ...最后, inmoun工具一起用空排和新的日期与原始数据的填充行相结合。

First, isolate your desired start and end dates, for instance use the Summarize Tool to generate minDate as min([yourDateField]) and maxDate as max([yourDateField]).

Then send those into a Generate Rows tool. In that tool, specify that you're creating a new variable, let's call it [newDate]. For Initialization Expression, simply specify [minDate], for Condition Expression, specify [newDate. <= [maxDate], and for Loop Expression, specify DateTimeAdd([newDate],1,'days') ... the output from that tool will be all the days (as rows) from minDate to maxDate.

Then Join that back to your main data on the newDate = yourDateField ... and finally, Union the outputs of the Join tool together to end up with empty rows with the new dates intermixed with populated rows of your original data.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文