整理多列中混乱的数据

huangapple go评论66阅读模式
英文:

Flattening messy data across multiple columns

问题

In Column N-R I have SKUs (in some cases just one SKU and in some cases up to 5 SKUs in total). In column S and T are the corresponding EAN and ASIN for each SKU in that row.

例如,在列N-R中,我有SKU(在某些情况下只有一个SKU,而在某些情况下最多有5个SKU)。在列S和T中,每个SKU的对应EAN和ASIN。

For example, row 27 has SKUs 6666 and GB-MA97-3GFI and the associated EAN and ASIN for each these SKUs are in the same row but in column S and T (so 8032947864171 and B071WWK11X).

例如,第27行有SKU 6666和GB-MA97-3GFI,这些SKU的相关EAN和ASIN在同一行中,但在列S和T中(因此8032947864171和B071WWK11X)。

How can I flatten the data so that I end up with three simple columns SKU, EAN, and ASIN?

如何扁平化数据,以便最终得到三个简单的列SKU、EAN和ASIN?

I flattened column N but then got stuck in terms of how to move forward.

我已经扁平化了列N,但在如何继续操作方面遇到了困难。

英文:

整理多列中混乱的数据

In Column N-R I have SKUs (in some cases just one SKU and in some cases up to 5 SKUs in total). In column S and T are the corresponding EAN and ASIN for each SKU in that row.

For example, row 27 has SKUs 6666 and GB-MA97-3GFI and the associated EAN and ASIN for each these SKUs are in the same row but in column S and T (so 8032947864171 and B071WWK11X).

How can I flatten the data so that I end up with three simple columns SKU, EAN and ASIN?

I flattened column N but then got stuck in terms of how to move forward.

答案1

得分: 2

= lambda(z, filter(z, index(z, , 1) <> ""))
({N2:N, S2:T;
O2:O, S2:T;
P2:P, S2:T;
Q2:Q, S2:T;
R2:R, S2:T})

英文:

You can try:

=lambda(z,filter(z,index(z,,1)&lt;&gt;&quot;&quot;))
   ({N2:N,S2:T;
    O2:O,S2:T;
    P2:P,S2:T;
    Q2:Q,S2:T;
    R2:R,S2:T})

huangapple
  • 本文由 发表于 2023年3月4日 00:59:39
  • 转载请务必保留本文链接:https://go.coder-hub.com/75629904.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定