From c8e444acd058fb09b938ff44fb70b9eb2820a2e3 Mon Sep 17 00:00:00 2001 From: Maria Camila Urrego <66705807+murrego7@users.noreply.github.com> Date: Wed, 29 Nov 2023 10:14:35 +0100 Subject: [PATCH] Update Demographic_Splitting.txt --- Demographic_Splitting.txt | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 Demographic_Splitting.txt diff --git a/Demographic_Splitting.txt b/Demographic_Splitting.txt new file mode 100644 index 0000000..f2b9166 --- /dev/null +++ b/Demographic_Splitting.txt @@ -0,0 +1,8 @@ +--Demographic splitting +SELECT + JSON_EXTRACT_SCALAR(data, "$.age") AS age, + JSON_EXTRACT_SCALAR(data, "$.gender") AS gender, + JSON_EXTRACT_SCALAR(data, "$.percentage") AS percentage +FROM + `analytics-tables.META_ADS.GRUNE`, + UNNEST([STRUCT(JSON_EXTRACT(demographic_distribution, '$') AS data)])