查询:在ARRAY_LITERAL中,Array Literal缺少一行或多行的值

问题描述 投票:0回答:1

我正在使用Google表格查询将2张(input1和input2)混合到第3张表格中。唯一的问题是我需要一些列而不是所有列,并且顺序不同。

sheet:input1

date    serie_1 serie_2 client
1/1/2019    2   6   Client A
1/2/2019    1   6   Client A
1/3/2019    5   8   Client B
1/4/2019    3   8   Client A
1/5/2019    8   2   Client B
1/6/2019    7   5   Client A
1/7/2019    5   5   Client B
1/8/2019    6   6   Client A
1/9/2019    4   3   Client B
1/10/2019   4   10  Client A
1/11/2019   5   8   Client B
1/12/2019   5   8   Client A
1/13/2019   2   5   Client B
1/14/2019   9   8   Client A
1/15/2019   4   1   Client B 

表输入2

date    serie_3 serie_4 client
1/1/2019    6   1   Client A
1/2/2019    6   1   Client A
1/3/2019    8   1   Client A
1/4/2019    8   1   Client A
1/5/2019    2   1   Client A
1/6/2019    5   1   Client A
1/7/2019    5   1   Client B
1/8/2019    6   1   Client B
1/9/2019    3   1   Client A
1/10/2019   10  1   Client A
1/11/2019   8   1   Client B
1/12/2019   8   1   Client B
1/13/2019   5   1   Client A
1/14/2019   8   1   Client B
1/15/2019   1   1   Client A

使用Query的预期输出

date    serie_1 serie_2 serie_3 client

处理以下查询:

={query({input1!A2:D},"select Col1,Col2,Col3,' ',Col4 where Col1 is not null label ' '''");query({input2!A2:D},"select Col1,' ','  ','   ',Col2,Col4 where Col1 is not null label ' ''','  ''','   '''")}

结果

Error
In ARRAY_LITERAL, an Array Literal was missing values for one or more rows.

你能帮我么?

google-sheets google-sheets-query
1个回答
1
投票

试试这样:

={query({input1!A2:D},"select Col1,Col2,Col3,' ',Col4 where Col1 is not null label ' '''");
  query({input2!A2:D},"select Col1,' ','  ',Col2,Col4 where Col1 is not null label ' ''','  '''")}
© www.soinside.com 2019 - 2024. All rights reserved.