How to create a report in Biquery with param.key value “action” & “label” in two different...
up vote
0
down vote
favorite
Queried param.key “action” with string values via through big query by using below query and fetch the report
select event_name, param.value.string_value as action,count(*) as eventcoun
From <table>
,
UNNEST (event_params) as param
where event_name = 'BotNav' and param.key='action' group by 1,2 order by eventcount desc
Output received through bigquery
event_name action eventount
BotNav Home 3575
BotNav App 1468
Queried param.key “label” with string values via through big query by using below query and fetch the report
select event_name, param.value.string_value as action,count(*) as eventcoun
From <table>
,
UNNEST (event_params) as param
where event_name = 'BotNav' and param.key='label' group by 1,2 order by eventcount desc
output received through bigquery
event_name label eventount
BotNav click 2341
BotNav submit 1234
BotNav click 1234
BotNav submit 234
How to create a report with event.param .key “action” & “label” in two different columns. I need to out in Bigquery like this. Pls. find below the expected output in bigquery
Expected Output
event_name action label eventount
BotNav Home click 2341
BotNav Home submit 1234
BotNav App click 1234
BotNav App submit 234
Pls Help to get the action & label string value in two different columns.
google-bigquery
add a comment |
up vote
0
down vote
favorite
Queried param.key “action” with string values via through big query by using below query and fetch the report
select event_name, param.value.string_value as action,count(*) as eventcoun
From <table>
,
UNNEST (event_params) as param
where event_name = 'BotNav' and param.key='action' group by 1,2 order by eventcount desc
Output received through bigquery
event_name action eventount
BotNav Home 3575
BotNav App 1468
Queried param.key “label” with string values via through big query by using below query and fetch the report
select event_name, param.value.string_value as action,count(*) as eventcoun
From <table>
,
UNNEST (event_params) as param
where event_name = 'BotNav' and param.key='label' group by 1,2 order by eventcount desc
output received through bigquery
event_name label eventount
BotNav click 2341
BotNav submit 1234
BotNav click 1234
BotNav submit 234
How to create a report with event.param .key “action” & “label” in two different columns. I need to out in Bigquery like this. Pls. find below the expected output in bigquery
Expected Output
event_name action label eventount
BotNav Home click 2341
BotNav Home submit 1234
BotNav App click 1234
BotNav App submit 234
Pls Help to get the action & label string value in two different columns.
google-bigquery
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
Queried param.key “action” with string values via through big query by using below query and fetch the report
select event_name, param.value.string_value as action,count(*) as eventcoun
From <table>
,
UNNEST (event_params) as param
where event_name = 'BotNav' and param.key='action' group by 1,2 order by eventcount desc
Output received through bigquery
event_name action eventount
BotNav Home 3575
BotNav App 1468
Queried param.key “label” with string values via through big query by using below query and fetch the report
select event_name, param.value.string_value as action,count(*) as eventcoun
From <table>
,
UNNEST (event_params) as param
where event_name = 'BotNav' and param.key='label' group by 1,2 order by eventcount desc
output received through bigquery
event_name label eventount
BotNav click 2341
BotNav submit 1234
BotNav click 1234
BotNav submit 234
How to create a report with event.param .key “action” & “label” in two different columns. I need to out in Bigquery like this. Pls. find below the expected output in bigquery
Expected Output
event_name action label eventount
BotNav Home click 2341
BotNav Home submit 1234
BotNav App click 1234
BotNav App submit 234
Pls Help to get the action & label string value in two different columns.
google-bigquery
Queried param.key “action” with string values via through big query by using below query and fetch the report
select event_name, param.value.string_value as action,count(*) as eventcoun
From <table>
,
UNNEST (event_params) as param
where event_name = 'BotNav' and param.key='action' group by 1,2 order by eventcount desc
Output received through bigquery
event_name action eventount
BotNav Home 3575
BotNav App 1468
Queried param.key “label” with string values via through big query by using below query and fetch the report
select event_name, param.value.string_value as action,count(*) as eventcoun
From <table>
,
UNNEST (event_params) as param
where event_name = 'BotNav' and param.key='label' group by 1,2 order by eventcount desc
output received through bigquery
event_name label eventount
BotNav click 2341
BotNav submit 1234
BotNav click 1234
BotNav submit 234
How to create a report with event.param .key “action” & “label” in two different columns. I need to out in Bigquery like this. Pls. find below the expected output in bigquery
Expected Output
event_name action label eventount
BotNav Home click 2341
BotNav Home submit 1234
BotNav App click 1234
BotNav App submit 234
Pls Help to get the action & label string value in two different columns.
google-bigquery
google-bigquery
asked Nov 22 at 5:44
Ramakrishnan M
104
104
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
accepted
try below
#standardSQL
select
event_name,
param1.value.string_value as action,
param2.value.string_value as label,
count(1) as eventcount
From `<table>`,
UNNEST(event_params) as param1,
UNNEST(event_params) as param2
where event_name = 'BotNav'
and param1.key='action'
and param2.key='label'
group by 1, 2, 3
order by eventcount desc
obviously assuming the only one 'action' and 'label' keys in event_params per event_name row - which should be true based on count numbers from examples in question
Another option would be
#standardSQL
select
event_name,
(select value.string_value from UNNEST(event_params) where key='action') as action,
(select value.string_value from UNNEST(event_params) where key='label') as label,
count(1) as eventcount
From `<table>`
where event_name = 'BotNav'
group by 1, 2, 3
order by eventcount desc
with same assumption
Mikhail, thanks for the response, but bigquery showing red error dot before line No. 4 param2.value.string_value as label, for the First option provided by you sir. Pls. help
– Ramakrishnan M
Nov 22 at 6:21
I was writing on-go so it is possible - give me sec - i will check
– Mikhail Berlyant
Nov 22 at 6:24
Thanks Mikhail for your quick response. Very kind of you Sir
– Ramakrishnan M
Nov 22 at 6:26
it works for me - what error message it shows?
– Mikhail Berlyant
Nov 22 at 6:32
I just checked second query and it also works for me - so give me the exact error you see!
– Mikhail Berlyant
Nov 22 at 6:34
|
show 16 more comments
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
accepted
try below
#standardSQL
select
event_name,
param1.value.string_value as action,
param2.value.string_value as label,
count(1) as eventcount
From `<table>`,
UNNEST(event_params) as param1,
UNNEST(event_params) as param2
where event_name = 'BotNav'
and param1.key='action'
and param2.key='label'
group by 1, 2, 3
order by eventcount desc
obviously assuming the only one 'action' and 'label' keys in event_params per event_name row - which should be true based on count numbers from examples in question
Another option would be
#standardSQL
select
event_name,
(select value.string_value from UNNEST(event_params) where key='action') as action,
(select value.string_value from UNNEST(event_params) where key='label') as label,
count(1) as eventcount
From `<table>`
where event_name = 'BotNav'
group by 1, 2, 3
order by eventcount desc
with same assumption
Mikhail, thanks for the response, but bigquery showing red error dot before line No. 4 param2.value.string_value as label, for the First option provided by you sir. Pls. help
– Ramakrishnan M
Nov 22 at 6:21
I was writing on-go so it is possible - give me sec - i will check
– Mikhail Berlyant
Nov 22 at 6:24
Thanks Mikhail for your quick response. Very kind of you Sir
– Ramakrishnan M
Nov 22 at 6:26
it works for me - what error message it shows?
– Mikhail Berlyant
Nov 22 at 6:32
I just checked second query and it also works for me - so give me the exact error you see!
– Mikhail Berlyant
Nov 22 at 6:34
|
show 16 more comments
up vote
0
down vote
accepted
try below
#standardSQL
select
event_name,
param1.value.string_value as action,
param2.value.string_value as label,
count(1) as eventcount
From `<table>`,
UNNEST(event_params) as param1,
UNNEST(event_params) as param2
where event_name = 'BotNav'
and param1.key='action'
and param2.key='label'
group by 1, 2, 3
order by eventcount desc
obviously assuming the only one 'action' and 'label' keys in event_params per event_name row - which should be true based on count numbers from examples in question
Another option would be
#standardSQL
select
event_name,
(select value.string_value from UNNEST(event_params) where key='action') as action,
(select value.string_value from UNNEST(event_params) where key='label') as label,
count(1) as eventcount
From `<table>`
where event_name = 'BotNav'
group by 1, 2, 3
order by eventcount desc
with same assumption
Mikhail, thanks for the response, but bigquery showing red error dot before line No. 4 param2.value.string_value as label, for the First option provided by you sir. Pls. help
– Ramakrishnan M
Nov 22 at 6:21
I was writing on-go so it is possible - give me sec - i will check
– Mikhail Berlyant
Nov 22 at 6:24
Thanks Mikhail for your quick response. Very kind of you Sir
– Ramakrishnan M
Nov 22 at 6:26
it works for me - what error message it shows?
– Mikhail Berlyant
Nov 22 at 6:32
I just checked second query and it also works for me - so give me the exact error you see!
– Mikhail Berlyant
Nov 22 at 6:34
|
show 16 more comments
up vote
0
down vote
accepted
up vote
0
down vote
accepted
try below
#standardSQL
select
event_name,
param1.value.string_value as action,
param2.value.string_value as label,
count(1) as eventcount
From `<table>`,
UNNEST(event_params) as param1,
UNNEST(event_params) as param2
where event_name = 'BotNav'
and param1.key='action'
and param2.key='label'
group by 1, 2, 3
order by eventcount desc
obviously assuming the only one 'action' and 'label' keys in event_params per event_name row - which should be true based on count numbers from examples in question
Another option would be
#standardSQL
select
event_name,
(select value.string_value from UNNEST(event_params) where key='action') as action,
(select value.string_value from UNNEST(event_params) where key='label') as label,
count(1) as eventcount
From `<table>`
where event_name = 'BotNav'
group by 1, 2, 3
order by eventcount desc
with same assumption
try below
#standardSQL
select
event_name,
param1.value.string_value as action,
param2.value.string_value as label,
count(1) as eventcount
From `<table>`,
UNNEST(event_params) as param1,
UNNEST(event_params) as param2
where event_name = 'BotNav'
and param1.key='action'
and param2.key='label'
group by 1, 2, 3
order by eventcount desc
obviously assuming the only one 'action' and 'label' keys in event_params per event_name row - which should be true based on count numbers from examples in question
Another option would be
#standardSQL
select
event_name,
(select value.string_value from UNNEST(event_params) where key='action') as action,
(select value.string_value from UNNEST(event_params) where key='label') as label,
count(1) as eventcount
From `<table>`
where event_name = 'BotNav'
group by 1, 2, 3
order by eventcount desc
with same assumption
edited Nov 22 at 6:10
answered Nov 22 at 6:00
Mikhail Berlyant
54k43064
54k43064
Mikhail, thanks for the response, but bigquery showing red error dot before line No. 4 param2.value.string_value as label, for the First option provided by you sir. Pls. help
– Ramakrishnan M
Nov 22 at 6:21
I was writing on-go so it is possible - give me sec - i will check
– Mikhail Berlyant
Nov 22 at 6:24
Thanks Mikhail for your quick response. Very kind of you Sir
– Ramakrishnan M
Nov 22 at 6:26
it works for me - what error message it shows?
– Mikhail Berlyant
Nov 22 at 6:32
I just checked second query and it also works for me - so give me the exact error you see!
– Mikhail Berlyant
Nov 22 at 6:34
|
show 16 more comments
Mikhail, thanks for the response, but bigquery showing red error dot before line No. 4 param2.value.string_value as label, for the First option provided by you sir. Pls. help
– Ramakrishnan M
Nov 22 at 6:21
I was writing on-go so it is possible - give me sec - i will check
– Mikhail Berlyant
Nov 22 at 6:24
Thanks Mikhail for your quick response. Very kind of you Sir
– Ramakrishnan M
Nov 22 at 6:26
it works for me - what error message it shows?
– Mikhail Berlyant
Nov 22 at 6:32
I just checked second query and it also works for me - so give me the exact error you see!
– Mikhail Berlyant
Nov 22 at 6:34
Mikhail, thanks for the response, but bigquery showing red error dot before line No. 4 param2.value.string_value as label, for the First option provided by you sir. Pls. help
– Ramakrishnan M
Nov 22 at 6:21
Mikhail, thanks for the response, but bigquery showing red error dot before line No. 4 param2.value.string_value as label, for the First option provided by you sir. Pls. help
– Ramakrishnan M
Nov 22 at 6:21
I was writing on-go so it is possible - give me sec - i will check
– Mikhail Berlyant
Nov 22 at 6:24
I was writing on-go so it is possible - give me sec - i will check
– Mikhail Berlyant
Nov 22 at 6:24
Thanks Mikhail for your quick response. Very kind of you Sir
– Ramakrishnan M
Nov 22 at 6:26
Thanks Mikhail for your quick response. Very kind of you Sir
– Ramakrishnan M
Nov 22 at 6:26
it works for me - what error message it shows?
– Mikhail Berlyant
Nov 22 at 6:32
it works for me - what error message it shows?
– Mikhail Berlyant
Nov 22 at 6:32
I just checked second query and it also works for me - so give me the exact error you see!
– Mikhail Berlyant
Nov 22 at 6:34
I just checked second query and it also works for me - so give me the exact error you see!
– Mikhail Berlyant
Nov 22 at 6:34
|
show 16 more comments
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.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- 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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53424565%2fhow-to-create-a-report-in-biquery-with-param-key-value-action-label-in-two%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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