首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在M语言中if else和while

在M语言中if else和while
EN

Stack Overflow用户
提问于 2020-11-24 16:04:06
回答 1查看 59关注 0票数 0

这里有165个值,它们用逗号分隔。此步骤称为CommaSeperated

workItemList是一个函数,它从CommaSeperated中获取值,并在此处调出表格

我想将CommaSeparated中的165个条目分成100个一批,并为每批调用workItemList。有没有关于如何做的想法?

EN

回答 1

Stack Overflow用户

发布于 2020-11-26 15:09:26

我已经设法将逗号分隔的文本字符串转换为包含100个字符的分组表。

第一个100称为" 100“,下一个100称为"200”,从101开始。

enter image description here

以下是我的步骤enter image description here

首先,我使用逗号作为分隔符标记,使用for each选项将文本字符串拆分为多个列。

然后,我将整个内容转换到一个列中。添加索引。加一个模数为100

添加自定义列"100counter":=Table.AddColumn(#“插入的模”,"100counter",每个if Modulus=99 then Indeks+1 else null)

忘记重命名的列步骤:D

首先使用填充,因为to初始0-100的模数将为"null“。使用Fill down second,因为如果最后一条记录不是精确地在99结束,那么它可能是null。

按“100计数器”分组,所有行。

简略代码-我清理了split by delimiter步骤中的1700列:

代码语言:javascript
复制
let
Source = Excel.CurrentWorkbook(){[Name="Tabel2"]}[Content],
#"Split Column by Delimiter" = //Alot of spam code here which is essentially just alll the columns being split. Mark ALL, choose split columns by delimiter, choose comma and all.
#"Transposed Table" = Table.Transpose(#"Split Column by Delimiter"),
#"Added Index" = Table.AddIndexColumn(#"Transposed Table", "Indeks", 0, 1),
#"Inserted Modulo" = Table.AddColumn(#"Added Index", "Modulus", each Number.Mod([Indeks], 100), type number),
#"Added Custom" = Table.AddColumn(#"Inserted Modulo", "100counter", each if [Modulus]=99 then [Indeks]+1 else null),
#"Filled Up" = Table.FillUp(#"Added Custom",{"100counter"}),
#"Filled Down" = Table.FillDown(#"Filled Up",{"100counter"}),
#"Grouped Rows" = Table.Group(#"Filled Down", {"100counter"}, {{"Antal", each _, type table [Column1=number, Indeks=number, Modulus=number, 100counter=number]}})

在#“分组行”中

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/64982397

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档