在Alteryx中生成日期
是否有一种方法可以通过使用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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
首先,隔离所需的开始和结束日期,例如使用要生成
Mindate
作为min([YourDateField])
和maxdate
asmax([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
asmin([yourDateField])
andmaxDate
asmax([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, specifyDateTimeAdd([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.