Reputation: 21
BUCKET AS bucket,
COUNT(*) AS bucketvolcount,
FROM `client-ssce.NoCTE.Test2`
GROUP BY BUCKET
I get: "list expression references transcription_1 which is neither grouped nor aggregated."
All the other entries for this are crazy complex. I try to do a join for the two (because that worked in one of the successful examples, and I'm assuming that it confers some of the grouped or aggregated features in the thing I'm joining it to 'somehow'), like so,
transcription_1 as transcription_1,
BUCKET AS bucket,
COUNT(*) AS bucketvolcount,
FROM 'client-ssce.NoCTE.Test2'
CROSS JOIN
transcription_1 on BUCKET
GROUP BY BUCKET
But then it says: "missing dataset while no default dataset is set in the request."
So, either, how and where do I declare a default dataset, or how do I FORCE the command it to display another column and have it when I grouped the buckets alphabetically that it applied across all columns?
Edit: I've got two columns, named "Bucket" and "transcription_1." I can get bucket to display. I can even get Bucket to display alphabetically. But what I need is for it to organise by bucket alphabetically, and for the other column, Transcription_1 to adjust its rows to match the changes made in Bucket, and for it to start a count for every replication of a value.
Upvotes: 0
Views: 564
Reputation: 21
I needed to make it aggregate, which I didn't even know was possible despite googling it several times.
STRING_AGG(DISTINCT transcription_1) transcription_1,
I eventually stumbled over an article "Counting distinct values" and it got it.
Upvotes: 1