英文:
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)<>""))
({N2:N,S2:T;
O2:O,S2:T;
P2:P,S2:T;
Q2:Q,S2:T;
R2:R,S2:T})
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论