Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

4
How to replace Null values on a subquery select as struct ?
Post Body

Hi, I'm relatively new to bigquery and not that good in sql.

I've a big query with select as struct as subquery. Below i'm sharing a fragment of the query :

(SELECT AS STRUCT CASE WHEN Keywords IS NULL THEN 0 ELSE 0 END AS Keywords_1TO3, totalImpressions AS totalImpressions_1TO3, totalClicks AS totalClicks_1TO3, AVRCTR AS AVRCTR_1TO3, AVRRanking AS AVRRanking_1TO3 FROM POSITION_RANGE_DATA WHERE POSITION_RANGE_DATA.website = Month.website AND positionRange = '1>3'),

I tried too ifnull(Keywords, 0).

I only tried with one column, but in fact I would like to verify all column and put 0 if it's null value.

There is no errors remaining but in the result the column is still greyed out for empty.

Thanks for helping me, guiding me to something working 👋

Author
Account Strength
90%
Account Age
10 years
Verified Email
Yes
Verified Flair
No
Total Karma
1,198
Link Karma
72
Comment Karma
1,126
Profile updated: 1 week ago
Posts updated: 6 months ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
3 years ago