shystar246
shystar246

Reputation: 11

FILTER has mismatched range sizes. Expected row count:

I have been using these 2 queries to fetch data in 2 different sheets

=query('Raw Data'!A3:P62481,"select B, D, E, F, G, H, I, J, K, L, M, N, O, P where B = date '"&text($B$1,"yyyy-mm-dd")&"'",1)

=sort(unique(FILTER('Raw Data'!$A:$P,'Raw Data'!$G:$G=$C$1,'Raw Data'!$B:$B=$F$1)))

Looking for a way to combine both. And get output in one single sheet, get data for specific DATE and C1.

Please help!

Already tried this:

=sort(unique(FILTER('Raw Data'!$A:$P,'Raw Data'!$G:$G=$C$1, QUERY(query('Raw Data'!A3:P62481,"select B, D, E, F, G, H, I, J, K, L, M, N, O, P where B = date '"&text($B$1,"yyyy-mm-dd")&"'",1)))))

=sort(unique(FILTER(QUERY('Raw Data'!$A:$P,"select B, D, E, F, G, H, I, J, K, L, M, N, O, P where B = date '"&text($F$1,"yyyy-mm-dd")&"'",1,'Raw Data'!$G:$G=$C$1))))

Error FILTER has mismatched range sizes. Expected row count: 2745. column count: 1. Actual row count: 62481, column count: 1.

Link to the sheet: https://drive.google.com/file/d/1ymFGf9eNzCoWHLwLjolQliOMBwswgaPP/view?usp=sharing

Upvotes: 1

Views: 4022

Answers (1)

player0
player0

Reputation: 1

in your first formula, the output is 14 columns while in your 2nd formula the output is 16 columns. there is no way how to combine it unless you have equal column count in the matrix. one of the ways would be adding two fake columns in the query like:

={QUERY('Raw Data'!A3:P62481, 
 "select B,D,E,F,G,H,I,J,K,L,M,N,O,P,' ','  ' 
  where B = date '"&TEXT($B$1, "yyyy-mm-dd")&"'
  label '  ''','  '''", 1);
  SORT(UNIQUE(FILTER('Raw Data'!$A:$P, 'Raw Data'!$G:$G=$C$1, 'Raw Data'!$B:$B=$F$1)))}

Upvotes: 2

Related Questions