Power Query:删除重复项功能

时间:2015-11-04 11:11:18

标签: powerquery

使用"删除重复项时出现问题" Power Query中的函数。

我正在使用PowerQuery和PowerPivot运行Excel 2013。通过创建连接将同一文件夹中的多个txt文件加载到数据模型中。表格如下所示。

CoCd    Doc.Id  Plant   PGroup  Purch.Doc.  Vendor

7200    411647  7200    U36     4800311931  2000031503
7020    421245  7020    D05     4800277051  2000032922
7200    404320  1000    8       4800000000  2000032944
7200    404321  7200    T48     4800293878  2000032944
7010    425013  7010    R21     4800346743  2000036726

总共有440k行。通过运行数据透视表,我确定了144k唯一的Doc.Ids。

然后,我选择了Doc.Id(整数)列并使用"删除重复项"功能在Power Query中删除其他重复的行。但是,最终表只加载了75k行(应该是144k)。我将Doc.Ids的数据类型更改为" text",然后删除重复项,最终表变为163k行,这正是Doc.Ids包含" 603"和" 603&#34 ;.不幸的是,我的决赛桌上确实需要144k行。

为什么删除重复项功能在我的情况下不能用Doc.Ids作为整数?

高级编辑器中的代码如下所示:

#"Changed Type1" = Table.TransformColumnTypes(#"Filtered Rows",{{"CreateTime", type time}, {"   TotalAmoun", Currency.Type}, {"Pst Date", type date}, {"Doc. Date", type date}, {"Due Date", type date}, {"DaysToDue", Int64.Type}, {"CreateDate", type date}, {"Cycle Time", type text}, {"Doc. Id", type text}, {"Purch.Doc.", Int64.Type}, {"Vendor", type text}, {"CoCd", Int64.Type}, {"Plant", type text}}),
#"Removed Duplicates" = Table.Distinct(#"Changed Type1", {"Doc. Id"})
in
#"Removed Duplicates"

经过一些进一步的挖掘,似乎在#34; 398103"之间缺少一大堆Doc.Id。和" 657238"加一些随机的。下面缺少数字的示例列表。无法找到他们失踪的原因。

"245233"
"261404"
...
...
"398103"
...
...
"657238"

0 个答案:

没有答案