gpt4 book ai didi

sql - 如何将值发送到 gsheets 上的数组公式中的自动连续行?

转载 作者:行者123 更新时间:2023-12-04 08:11:59 25 4
gpt4 key购买 nike

这在 1* 数据表上更容易解决,但我试图将每周数量的数据分组为每日 #,以使工作更轻松。

=query({ARRAYFORMULA(if(BinCountData!A3, "Store0",)(BinCountData!B3/7)*Row(1:7)^0), BinCountData!A3:B;
ARRAYFORMULA(if(BinCountData!E3:E,"Store1",)(BinCountData!B3/7)*Row(1:7)^0), BinCountData!E3:F;
ARRAYFORMULA(IF(BinCountData!I3:I,"Store2",)(BinCountData!B3/7)*Row(1:7)^0), BinCountData!I3:J;
ARRAYFORMULA(IF(BinCountData!M3:M,"Store3",)(BinCountData!B3/7)*Row(1:7)^0), BinCountData!M3:N;
ARRAYFORMULA(IF(BinCountData!Q3:Q,"Store4",)(BinCountData!B3/7)*Row(1:7)^0), BinCountData!Q3:R;
ARRAYFORMULA(IF(BinCountData!U3:U,"Store5",)(BinCountData!B3/7)*Row(1:7)^0), BinCountData!U:V;
ARRAYFORMULA(IF(BinCountData!Y3:Y,"Store6",)(BinCountData!B3/7)*Row(1:7)^0), BinCountData!Y3:Z;
ARRAYFORMULA(IF(BinCountData!AC3:AC,"Store7",)(BinCountData!B3/7)*Row(1:7)^0), BinCountData!AC3:AD;
ARRAYFORMULA(IF(BinCountData!AG3:AG,"Store8",)(BinCountData!B3/7)*Row(1:7)^0), BinCountData!AG3:AH;
ARRAYFORMULA(IF(BinCountData!AK3:AK,"Store9",)(BinCountData!B3/7)*Row(1:7)^0), BinCountData!AK3:AL;
ARRAYFORMULA(IF(BinCountData!AO3:AO,"Store10",)(BinCountData!B3/7)*Row(1:7)^0), BinCountData!AO3:AP

}, "
Select *
where Col1 <>''
label Col1 'Date', Col2 'Store'
")
*Row(1:7)^0 的替代品是什么,使它们在同一列中按顺序排列?

最佳答案

如果您想将其分配到列而不是行中,您可以执行以下操作:

*COLUMN(A:G)^0
或者:
*TRANSPOSE(ROW(1:7)^0)
或者:
*SEQUENCE(1, 7, 1, 0)

更新
尝试:
=ARRAYFORMULA(QUERY(SPLIT(FLATTEN(FLATTEN(
FILTER(BinCountData!A3:AR, MOD(COLUMN(BinCountData!A:AR)-1, 4)=0))+SEQUENCE(1, 7, 0)&"×"&FLATTEN(
FILTER(BinCountData!A1:AR1, MOD(COLUMN(BinCountData!A:AR)-1, 4)=0)&"×"&
FILTER(BinCountData!A3:AR, MOD(COLUMN(BinCountData!A:AR)-2, 4)=0)/7)), "×"),
"where Col3 <> 0
order by Col2
label Col1'Date',Col2'Store',Col3'Bin/Day'
format Col1 'yyyy-mm-dd'"))
enter image description here
demo spreadsheet

关于sql - 如何将值发送到 gsheets 上的数组公式中的自动连续行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65908483/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com