Use google sheets to grab some values - google-sheets

Based on some searches I tried some syntaxes, but it didn't work. I want to grab the averagehashrate
https://api.ethermine.org/miner/0x819135fe6fe2c8a3fa1348a9fa70fee3764a966b/worker/10/currentStats
please help me

try:
=REGEXEXTRACT(QUERY(FLATTEN(IMPORTDATA(A25));
"where Col1 contains 'averageHashrate'"); "\d+(?:.\d+)?")

Related

Google Sheets: How can I Flatten and Split Data while including multiple columns?

I would like to pull data from Google Sheets form responses that include checkboxes. The checkboxes are output into single column cells by commas.
Data/Form Responses sheet:
enter image description here
Current and Expected Results
enter image description here
Current Formula
=ARRAYFORMULA(TRIM(QUERY(SPLIT(FLATTEN(IF(IFERROR(SPLIT('Form Responses'!E2:E, ","))="",,
'Form Responses'!B2:B&"×"&SPLIT('Form Responses'!E2:E, ","))), "×"),
"where Col2 is not null")))
If anyone could please help I would appreciate it!
SUGGESTION
Perhaps you can try this tweaked formula:
=ARRAYFORMULA(TRIM(QUERY(SPLIT(FLATTEN(IF(IFERROR(SPLIT('Form Responses'!E2:E, ","))="",,TEXT('Form Responses'!A2:A,"MM/DD/YYYY HH:MM:SS")&"×"&'Form Responses'!B2:B&"×"&'Form Responses'!C2:C&"×"&'Form Responses'!D2:D&"×"&SPLIT('Form Responses'!E2:E, ","))),"×"),"where Col2 is not null")))
Demo
You may try this LAMBDA() formula. You just need to adjust ranges in lambda input parameter.
=LAMBDA(UnpivotCol,AdjucentCols,QUERY(REDUCE(,REDUCE(,UnpivotCol,LAMBDA(a,x,VSTACK(a,TOCOL(INDEX(JOIN("|",INDEX(AdjucentCols,ROW(x)-(INDEX(ROW(UnpivotCol),1)-1))) & "|" & SPLIT(x,",")))))),LAMBDA(t,g,VSTACK(t,SPLIT(g,"|")))),"offset 2 format Col1 'm/d/yyyy'",0))(E2:E4,A2:D4)

Google sheets: filter columns if rows are not blank

I am trying to figure out a formula to show all the projects for which there are hours assigned. From a first query I get the following output, listing projects and assigned hours:
Now I want to filter for projects with assigned hours. Since I want to add this to my existing query, I cannot use A1 notation. Any idea? :)
Try
=unique(query(arrayformula(split(flatten((A1:C1&"~"&A2:C)),"~")),"select Col1 where Col2 is not null"))
transpose({transpose({A1:C1}),query(transpose(query({A2:C},"select "&textjoin(",",1,index("sum(Col"&sequence(1, 3,1)&")"))&"), "select Col1 where Col2 >0")})
I solved the issue with this formula. But yours also worked #Mike Steelson -thanks!
Here's another way you can do that:
=flatten(filter(A1:C1,trim(query(A2:C,,9^9))<>""))

going from wide to long with empty cells in google sheets

I am trying to go from wide to long for two columns with blanks retaining information in the last two columns.
Please see google sheets link for example and intended effect:
use:
=INDEX(QUERY(SPLIT(FLATTEN(
IF(A2:B5="",,A2:B5&"×"&C2:C5&"×"&D2:D5)), "×"),
"where Col2 is not null", ))
This may work:
=IF(ERROR(ARRAYFORMULA(split(FLATTEN(A2:B4&"!"&C2:C4&"!"&D2:D4),"!"))) = "FALSE" ,ARRAYFORMULA(split(FLATTEN(A2:B4&"!"&C2:C4&"!"&D2:D4), "!")))," ")

Is there a possibility to create a query based graph in google docs?

Once more I request assistance.
Please elaborate if it is possible.
What I need to do is to make a graph out of one column, where the second column equals the one of interest. Please refer to the example in the attachment.
Link to imgur
A close pseudo-code of what I want from google sheets:
Select * from table1 where A='John' and create a graph out of it later.
If such was already asked, sorry, I was not able to find such.
In your example, try this in cell C1:
=query({A:B},"select Col2 where Col1 matches 'John' label Col2 'John stats' ",1)
Then the pie chart range would be C1:C10.
Wrapping the range in {} changes the query notation to Col1,Col2 etc rather than A,B etc.

Import Craigslist information

I'm trying to import the data from Craigslist into Google Sheets. I'm using importxml and have made some progress but can further refine the function.
A3: https://norfolk.craigslist.org/ctd/d/2011-volkswagen-jetta-only-82k-miles/6910694177.html
=IMPORTXML(A3,"//div[#class='mapAndAttrs']//p[#class='attrgroup'][2]")
This seems to return all information but I want to trim it to search for fuel in the result and show gas/diesel/whatever may be.
=QUERY(TRANSPOSE(IMPORTXML(A3,
"//div[#class='mapAndAttrs']//p[#class='attrgroup'][2]")),
"where Col1 contains 'fuel'")
=SUBSTITUTE(QUERY(TRANSPOSE(IMPORTXML(A3,
"//div[#class='mapAndAttrs']//p[#class='attrgroup'][2]")),
"where Col1 contains 'fuel'"), "fuel: ", )

Resources