Vlookup unnested values using Bigquery











up vote
-2
down vote

favorite
1












I have two tables where table 1 contains two columns: a column with a list of URLs embedded in string values (each cell contains more than one URL), and a date column. I managed to extract all unnested URLs to Table 2. I need to vlookup the two tables to get the date for each scraped URL (as in Tabel 3)



  Table 1    string | Date
______________
STRING 1 Date 1
STRING 2 Date 2
STRING 3 Date 3

Table 2 Scraped URL | string
______________________
scraped URL 1 STRING 1
scraped URL 2 STRING 2
scraped URL 3 STRING 3

Table 3 scraped URL | Date
_________________________
scraped URL 1 Date 1
scraped URL 2 Date 2
scraped URL 3 Date 3









share|improve this question




















  • 2




    So what's the relation between url and date?
    – dwir182
    Nov 10 at 22:39










  • url are scraped from the string column in Table 1
    – J.Doe
    Nov 10 at 22:49












  • Yes, but where does the date come from?
    – Alex
    Nov 11 at 2:44















up vote
-2
down vote

favorite
1












I have two tables where table 1 contains two columns: a column with a list of URLs embedded in string values (each cell contains more than one URL), and a date column. I managed to extract all unnested URLs to Table 2. I need to vlookup the two tables to get the date for each scraped URL (as in Tabel 3)



  Table 1    string | Date
______________
STRING 1 Date 1
STRING 2 Date 2
STRING 3 Date 3

Table 2 Scraped URL | string
______________________
scraped URL 1 STRING 1
scraped URL 2 STRING 2
scraped URL 3 STRING 3

Table 3 scraped URL | Date
_________________________
scraped URL 1 Date 1
scraped URL 2 Date 2
scraped URL 3 Date 3









share|improve this question




















  • 2




    So what's the relation between url and date?
    – dwir182
    Nov 10 at 22:39










  • url are scraped from the string column in Table 1
    – J.Doe
    Nov 10 at 22:49












  • Yes, but where does the date come from?
    – Alex
    Nov 11 at 2:44













up vote
-2
down vote

favorite
1









up vote
-2
down vote

favorite
1






1





I have two tables where table 1 contains two columns: a column with a list of URLs embedded in string values (each cell contains more than one URL), and a date column. I managed to extract all unnested URLs to Table 2. I need to vlookup the two tables to get the date for each scraped URL (as in Tabel 3)



  Table 1    string | Date
______________
STRING 1 Date 1
STRING 2 Date 2
STRING 3 Date 3

Table 2 Scraped URL | string
______________________
scraped URL 1 STRING 1
scraped URL 2 STRING 2
scraped URL 3 STRING 3

Table 3 scraped URL | Date
_________________________
scraped URL 1 Date 1
scraped URL 2 Date 2
scraped URL 3 Date 3









share|improve this question















I have two tables where table 1 contains two columns: a column with a list of URLs embedded in string values (each cell contains more than one URL), and a date column. I managed to extract all unnested URLs to Table 2. I need to vlookup the two tables to get the date for each scraped URL (as in Tabel 3)



  Table 1    string | Date
______________
STRING 1 Date 1
STRING 2 Date 2
STRING 3 Date 3

Table 2 Scraped URL | string
______________________
scraped URL 1 STRING 1
scraped URL 2 STRING 2
scraped URL 3 STRING 3

Table 3 scraped URL | Date
_________________________
scraped URL 1 Date 1
scraped URL 2 Date 2
scraped URL 3 Date 3






sql google-bigquery






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 10 at 22:53

























asked Nov 10 at 22:36









J.Doe

11




11








  • 2




    So what's the relation between url and date?
    – dwir182
    Nov 10 at 22:39










  • url are scraped from the string column in Table 1
    – J.Doe
    Nov 10 at 22:49












  • Yes, but where does the date come from?
    – Alex
    Nov 11 at 2:44














  • 2




    So what's the relation between url and date?
    – dwir182
    Nov 10 at 22:39










  • url are scraped from the string column in Table 1
    – J.Doe
    Nov 10 at 22:49












  • Yes, but where does the date come from?
    – Alex
    Nov 11 at 2:44








2




2




So what's the relation between url and date?
– dwir182
Nov 10 at 22:39




So what's the relation between url and date?
– dwir182
Nov 10 at 22:39












url are scraped from the string column in Table 1
– J.Doe
Nov 10 at 22:49






url are scraped from the string column in Table 1
– J.Doe
Nov 10 at 22:49














Yes, but where does the date come from?
– Alex
Nov 11 at 2:44




Yes, but where does the date come from?
– Alex
Nov 11 at 2:44












1 Answer
1






active

oldest

votes

















up vote
1
down vote













Are you looking for a join?



select t2.scraped_url, t1.date
from table1 t1 join
table2 t2
on t2.scraped_url = t1.url





share|improve this answer





















  • I've tried this query and for some reason it is giving me this error 'Cannot access field scraped_url on a value with type STRING at [1:13]'
    – J.Doe
    Nov 17 at 12:15











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',
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%2f53244110%2fvlookup-unnested-values-using-bigquery%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








up vote
1
down vote













Are you looking for a join?



select t2.scraped_url, t1.date
from table1 t1 join
table2 t2
on t2.scraped_url = t1.url





share|improve this answer





















  • I've tried this query and for some reason it is giving me this error 'Cannot access field scraped_url on a value with type STRING at [1:13]'
    – J.Doe
    Nov 17 at 12:15















up vote
1
down vote













Are you looking for a join?



select t2.scraped_url, t1.date
from table1 t1 join
table2 t2
on t2.scraped_url = t1.url





share|improve this answer





















  • I've tried this query and for some reason it is giving me this error 'Cannot access field scraped_url on a value with type STRING at [1:13]'
    – J.Doe
    Nov 17 at 12:15













up vote
1
down vote










up vote
1
down vote









Are you looking for a join?



select t2.scraped_url, t1.date
from table1 t1 join
table2 t2
on t2.scraped_url = t1.url





share|improve this answer












Are you looking for a join?



select t2.scraped_url, t1.date
from table1 t1 join
table2 t2
on t2.scraped_url = t1.url






share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 10 at 22:58









Gordon Linoff

744k32285390




744k32285390












  • I've tried this query and for some reason it is giving me this error 'Cannot access field scraped_url on a value with type STRING at [1:13]'
    – J.Doe
    Nov 17 at 12:15


















  • I've tried this query and for some reason it is giving me this error 'Cannot access field scraped_url on a value with type STRING at [1:13]'
    – J.Doe
    Nov 17 at 12:15
















I've tried this query and for some reason it is giving me this error 'Cannot access field scraped_url on a value with type STRING at [1:13]'
– J.Doe
Nov 17 at 12:15




I've tried this query and for some reason it is giving me this error 'Cannot access field scraped_url on a value with type STRING at [1:13]'
– J.Doe
Nov 17 at 12:15


















 

draft saved


draft discarded



















































 


draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53244110%2fvlookup-unnested-values-using-bigquery%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

Xamarin.iOS Cant Deploy on Iphone

Glorious Revolution

Dulmage-Mendelsohn matrix decomposition in Python