How to add an additional custom column with select * all in Google Sheet Query

Viewed 323

How would you do this query in Google Sheet? I have 24 columns in my data so I would not like to enter all column names into the query.

If this is not possible for QUERY, then what is the alternative?

I want something like this:

select *, 'ICS' 
label 'ICS' 'Type'

But I get an error doing so:

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

This is the result I want to display: Expected output

1 Answers
={QUERY(IMPORTRANGE('Static Data'!$B$2,"MASTERFILE!A:AC"),"select * where Col"& 'Static Data'!$B$19 &" is not null",1) ,{"TYPE";TRANSPOSE(SPLIT(REPT("ICS;",COUNT(IMPORTRANGE('Static Data'!$B$2,"MASTERFILE!B:B"))),";"))}}
Related