我有一个电话数据集。看起来像这样
如果有关某个成员的呼叫在“原始呼叫”后的30天内出现,则该呼叫被认为是回调。我需要一些逻辑或电源查询魔法来使用此逻辑来处理此数据集。因此,最终结果应该看起来像这样
我以为我可以做些什么,但是事实证明这很困难,当我有超过200万个独特的案例钥匙时,重复项会杀死运行时间和超载内存。有什么建议吗?我更喜欢在Power查询编辑器中进行操作,但可以在SQL中进行操作。 plz,谢谢你。
I have a call dataset. Looks like this

If a call about a certain member comes in within 30 days of an "original call", that call is considered a callback. I need some logic or Power Query magic to handle this dataset using this logic. So the end result should look like this

Right now, I have the table left joined to itself which gives me every possible combination. I thought I could do something with that but it's proven difficult and when I have over 2 million unique case keys, the duplicates kill run time and overload memory. Any suggestions? I'd prefer to do the manipulation in Power Query editor but can do it in SQL. Plz and thank you.
发布评论
评论(2)
我认为您可以在电源查询中执行此操作,但是我不知道它会以200万张记录运行。
可以通过明智地使用
table.buffer
函数来加速它。但是,先尝试一下。进行合理的自我文献
请尝试此M代码。 (更改源线以与您自己的数据源一致)。
编辑:
编辑的代码允许从初始调用
I think you can do this in Power Query, but I have no idea how it will run with two million records.
It may be able to be sped up with judicious use of the
Table.Buffer
function. But give it a try as written first.The code should be reasonably self-documenting
Try this M code. (Change the Source line to be congruent with your own data source).
Edit:
Code edited to allow for multiple call backs from an initial call
Example with multiple callbacks

认为您可以使用铅功能来执行此操作。
这是小提琴
Think you can do this with Lead function.
here is the fiddle https://dbfiddle.uk/?rdbms=oracle_11.2&fiddle=f7cabdbe4d1193e5f0da6bd6a4571b96