How to Query Unique Events & Unique screenviews from Bigquery in Firebase Analytics












0















In Google Analytics, We have two key metrics in respect of events & screens.

Events Metrics - Total Events & Unique Events
Screenview Metrics - Total Screenviews & Unique Screenviews



How to query Unique Events & Unique screenviews from Biquery



Events - Unique Events



Extracted total Total Events by query below in Bigquery... But how to query Unique Events.



select 
app_info.id,app_info.version,
event_date,event_name,
param1.value.string_value as category,
count(1) as totalevents
From `<table>`,
UNNEST(event_params) as param1
where param1.key='category'

group by 1, 2, 3, 4, 5
order by totalevents desc


Requesting your support on how to query Unique events from Bigquery



Screen - Unique screenviews



Extracted total screenviews by query below in Bigquery... But how to query unique screenviews.



select app_info.id,app_info.version,event_date,event_name, param.value.string_value as firebase_screen,count(*) as screen_views
From `<table>`,
UNNEST (event_params) as param
WHERE event_name = 'screen_view' and param.key='firebase_screen'group by 1,2,3,4,5 order by screen_views desc


Requesting your support on how to query Unique Screenviews from Bigquery










share|improve this question

























  • Mikhail Sir: I will try using "distinct" option in the query & get back....I should not bug you without trying... Sorry

    – Ramakrishnan M
    Nov 23 '18 at 6:26













  • Mikhail Sir: Tried few options, i am unsuccessful, Pls. help

    – Ramakrishnan M
    Nov 23 '18 at 10:36











  • Mikhail Sir: Requesting your support for below query. Pls. Help. stackoverflow.com/questions/54956102/…

    – Ramakrishnan M
    Mar 2 at 7:19
















0















In Google Analytics, We have two key metrics in respect of events & screens.

Events Metrics - Total Events & Unique Events
Screenview Metrics - Total Screenviews & Unique Screenviews



How to query Unique Events & Unique screenviews from Biquery



Events - Unique Events



Extracted total Total Events by query below in Bigquery... But how to query Unique Events.



select 
app_info.id,app_info.version,
event_date,event_name,
param1.value.string_value as category,
count(1) as totalevents
From `<table>`,
UNNEST(event_params) as param1
where param1.key='category'

group by 1, 2, 3, 4, 5
order by totalevents desc


Requesting your support on how to query Unique events from Bigquery



Screen - Unique screenviews



Extracted total screenviews by query below in Bigquery... But how to query unique screenviews.



select app_info.id,app_info.version,event_date,event_name, param.value.string_value as firebase_screen,count(*) as screen_views
From `<table>`,
UNNEST (event_params) as param
WHERE event_name = 'screen_view' and param.key='firebase_screen'group by 1,2,3,4,5 order by screen_views desc


Requesting your support on how to query Unique Screenviews from Bigquery










share|improve this question

























  • Mikhail Sir: I will try using "distinct" option in the query & get back....I should not bug you without trying... Sorry

    – Ramakrishnan M
    Nov 23 '18 at 6:26













  • Mikhail Sir: Tried few options, i am unsuccessful, Pls. help

    – Ramakrishnan M
    Nov 23 '18 at 10:36











  • Mikhail Sir: Requesting your support for below query. Pls. Help. stackoverflow.com/questions/54956102/…

    – Ramakrishnan M
    Mar 2 at 7:19














0












0








0








In Google Analytics, We have two key metrics in respect of events & screens.

Events Metrics - Total Events & Unique Events
Screenview Metrics - Total Screenviews & Unique Screenviews



How to query Unique Events & Unique screenviews from Biquery



Events - Unique Events



Extracted total Total Events by query below in Bigquery... But how to query Unique Events.



select 
app_info.id,app_info.version,
event_date,event_name,
param1.value.string_value as category,
count(1) as totalevents
From `<table>`,
UNNEST(event_params) as param1
where param1.key='category'

group by 1, 2, 3, 4, 5
order by totalevents desc


Requesting your support on how to query Unique events from Bigquery



Screen - Unique screenviews



Extracted total screenviews by query below in Bigquery... But how to query unique screenviews.



select app_info.id,app_info.version,event_date,event_name, param.value.string_value as firebase_screen,count(*) as screen_views
From `<table>`,
UNNEST (event_params) as param
WHERE event_name = 'screen_view' and param.key='firebase_screen'group by 1,2,3,4,5 order by screen_views desc


Requesting your support on how to query Unique Screenviews from Bigquery










share|improve this question
















In Google Analytics, We have two key metrics in respect of events & screens.

Events Metrics - Total Events & Unique Events
Screenview Metrics - Total Screenviews & Unique Screenviews



How to query Unique Events & Unique screenviews from Biquery



Events - Unique Events



Extracted total Total Events by query below in Bigquery... But how to query Unique Events.



select 
app_info.id,app_info.version,
event_date,event_name,
param1.value.string_value as category,
count(1) as totalevents
From `<table>`,
UNNEST(event_params) as param1
where param1.key='category'

group by 1, 2, 3, 4, 5
order by totalevents desc


Requesting your support on how to query Unique events from Bigquery



Screen - Unique screenviews



Extracted total screenviews by query below in Bigquery... But how to query unique screenviews.



select app_info.id,app_info.version,event_date,event_name, param.value.string_value as firebase_screen,count(*) as screen_views
From `<table>`,
UNNEST (event_params) as param
WHERE event_name = 'screen_view' and param.key='firebase_screen'group by 1,2,3,4,5 order by screen_views desc


Requesting your support on how to query Unique Screenviews from Bigquery







google-bigquery






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 18 at 11:41







Ramakrishnan M

















asked Nov 23 '18 at 5:58









Ramakrishnan MRamakrishnan M

84




84













  • Mikhail Sir: I will try using "distinct" option in the query & get back....I should not bug you without trying... Sorry

    – Ramakrishnan M
    Nov 23 '18 at 6:26













  • Mikhail Sir: Tried few options, i am unsuccessful, Pls. help

    – Ramakrishnan M
    Nov 23 '18 at 10:36











  • Mikhail Sir: Requesting your support for below query. Pls. Help. stackoverflow.com/questions/54956102/…

    – Ramakrishnan M
    Mar 2 at 7:19



















  • Mikhail Sir: I will try using "distinct" option in the query & get back....I should not bug you without trying... Sorry

    – Ramakrishnan M
    Nov 23 '18 at 6:26













  • Mikhail Sir: Tried few options, i am unsuccessful, Pls. help

    – Ramakrishnan M
    Nov 23 '18 at 10:36











  • Mikhail Sir: Requesting your support for below query. Pls. Help. stackoverflow.com/questions/54956102/…

    – Ramakrishnan M
    Mar 2 at 7:19

















Mikhail Sir: I will try using "distinct" option in the query & get back....I should not bug you without trying... Sorry

– Ramakrishnan M
Nov 23 '18 at 6:26







Mikhail Sir: I will try using "distinct" option in the query & get back....I should not bug you without trying... Sorry

– Ramakrishnan M
Nov 23 '18 at 6:26















Mikhail Sir: Tried few options, i am unsuccessful, Pls. help

– Ramakrishnan M
Nov 23 '18 at 10:36





Mikhail Sir: Tried few options, i am unsuccessful, Pls. help

– Ramakrishnan M
Nov 23 '18 at 10:36













Mikhail Sir: Requesting your support for below query. Pls. Help. stackoverflow.com/questions/54956102/…

– Ramakrishnan M
Mar 2 at 7:19





Mikhail Sir: Requesting your support for below query. Pls. Help. stackoverflow.com/questions/54956102/…

– Ramakrishnan M
Mar 2 at 7:19












1 Answer
1






active

oldest

votes


















1














I don't think your question follows what you're trying to accomplish in the query snippets you've posted.



Following your queries, you're trying to count events with particular parameter values. Here is how I would do that:



select
event_name,
(SELECT value.string_value FROM UNNEST (event_params) WHERE key = "action") AS action,
count(1) as event_count
from `<table>`
where event_name = "BotNav"
group by 1,2
order by event_count desc


In case you are actually just looking for a way to count the number of events, here is how I would do it:



select
event_name,
count(1) as event_count
from `<table>`
group by 1
order by event_count desc


Please be more clear to what you're asking. Maybe you could post how you want the resulting query to look like to give us an idea of what you want to achieve.






share|improve this answer
























  • HI Sir: Thanks for the response. There is a metrics called "Unique Users" in Datastudio. How to query the "Unique Users" metrics through bigquery. Pls. find attached the datastudio dimension & metrics screenshot for your kind reference. Pls. help

    – Ramakrishnan M
    Mar 15 at 11:44











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53441327%2fhow-to-query-unique-events-unique-screenviews-from-bigquery-in-firebase-analyt%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









1














I don't think your question follows what you're trying to accomplish in the query snippets you've posted.



Following your queries, you're trying to count events with particular parameter values. Here is how I would do that:



select
event_name,
(SELECT value.string_value FROM UNNEST (event_params) WHERE key = "action") AS action,
count(1) as event_count
from `<table>`
where event_name = "BotNav"
group by 1,2
order by event_count desc


In case you are actually just looking for a way to count the number of events, here is how I would do it:



select
event_name,
count(1) as event_count
from `<table>`
group by 1
order by event_count desc


Please be more clear to what you're asking. Maybe you could post how you want the resulting query to look like to give us an idea of what you want to achieve.






share|improve this answer
























  • HI Sir: Thanks for the response. There is a metrics called "Unique Users" in Datastudio. How to query the "Unique Users" metrics through bigquery. Pls. find attached the datastudio dimension & metrics screenshot for your kind reference. Pls. help

    – Ramakrishnan M
    Mar 15 at 11:44
















1














I don't think your question follows what you're trying to accomplish in the query snippets you've posted.



Following your queries, you're trying to count events with particular parameter values. Here is how I would do that:



select
event_name,
(SELECT value.string_value FROM UNNEST (event_params) WHERE key = "action") AS action,
count(1) as event_count
from `<table>`
where event_name = "BotNav"
group by 1,2
order by event_count desc


In case you are actually just looking for a way to count the number of events, here is how I would do it:



select
event_name,
count(1) as event_count
from `<table>`
group by 1
order by event_count desc


Please be more clear to what you're asking. Maybe you could post how you want the resulting query to look like to give us an idea of what you want to achieve.






share|improve this answer
























  • HI Sir: Thanks for the response. There is a metrics called "Unique Users" in Datastudio. How to query the "Unique Users" metrics through bigquery. Pls. find attached the datastudio dimension & metrics screenshot for your kind reference. Pls. help

    – Ramakrishnan M
    Mar 15 at 11:44














1












1








1







I don't think your question follows what you're trying to accomplish in the query snippets you've posted.



Following your queries, you're trying to count events with particular parameter values. Here is how I would do that:



select
event_name,
(SELECT value.string_value FROM UNNEST (event_params) WHERE key = "action") AS action,
count(1) as event_count
from `<table>`
where event_name = "BotNav"
group by 1,2
order by event_count desc


In case you are actually just looking for a way to count the number of events, here is how I would do it:



select
event_name,
count(1) as event_count
from `<table>`
group by 1
order by event_count desc


Please be more clear to what you're asking. Maybe you could post how you want the resulting query to look like to give us an idea of what you want to achieve.






share|improve this answer













I don't think your question follows what you're trying to accomplish in the query snippets you've posted.



Following your queries, you're trying to count events with particular parameter values. Here is how I would do that:



select
event_name,
(SELECT value.string_value FROM UNNEST (event_params) WHERE key = "action") AS action,
count(1) as event_count
from `<table>`
where event_name = "BotNav"
group by 1,2
order by event_count desc


In case you are actually just looking for a way to count the number of events, here is how I would do it:



select
event_name,
count(1) as event_count
from `<table>`
group by 1
order by event_count desc


Please be more clear to what you're asking. Maybe you could post how you want the resulting query to look like to give us an idea of what you want to achieve.







share|improve this answer












share|improve this answer



share|improve this answer










answered Jan 31 at 8:36









BoggeBogge

468




468













  • HI Sir: Thanks for the response. There is a metrics called "Unique Users" in Datastudio. How to query the "Unique Users" metrics through bigquery. Pls. find attached the datastudio dimension & metrics screenshot for your kind reference. Pls. help

    – Ramakrishnan M
    Mar 15 at 11:44



















  • HI Sir: Thanks for the response. There is a metrics called "Unique Users" in Datastudio. How to query the "Unique Users" metrics through bigquery. Pls. find attached the datastudio dimension & metrics screenshot for your kind reference. Pls. help

    – Ramakrishnan M
    Mar 15 at 11:44

















HI Sir: Thanks for the response. There is a metrics called "Unique Users" in Datastudio. How to query the "Unique Users" metrics through bigquery. Pls. find attached the datastudio dimension & metrics screenshot for your kind reference. Pls. help

– Ramakrishnan M
Mar 15 at 11:44





HI Sir: Thanks for the response. There is a metrics called "Unique Users" in Datastudio. How to query the "Unique Users" metrics through bigquery. Pls. find attached the datastudio dimension & metrics screenshot for your kind reference. Pls. help

– Ramakrishnan M
Mar 15 at 11:44




















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53441327%2fhow-to-query-unique-events-unique-screenviews-from-bigquery-in-firebase-analyt%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

"Incorrect syntax near the keyword 'ON'. (on update cascade, on delete cascade,)

Alcedinidae

Origin of the phrase “under your belt”?