What should be changed to allow the IMPORTHTML to retrieve a text value?
I get this error message; "Function MULTIPLY parameter 1 expects number values. But "Distribution Rate" is a text and cannot be coerced to a number."
=if(isblank($A17),"",(substitute(index(importhtml("https://www.cefconnect.com/fund/"&A17,"table",2),2,1),"*",""))*1)
use:
=IF(ISBLANK($A17),,(SUBSTITUTE(INDEX(IMPORTHTML(
"https://www.cefconnect.com/fund/"&A17, "table", 2), 2, 1), "*", )))
Related
The column ('DATA') I want to extract the decimal from is in the following format:
{
"unit": "Miles",
"value": 59290.6
}
I've tried the following code by I get a null...
regexp_substr(DATA, '\{\d+.\d+\}') AS RECORDED_DISTANCE
Do you just mean to access the value element?
select
data:value as record_distance
I'm trying to get a match in a range of text in Google Sheets basically I'm using this formula:
=IF(REGEXMATCH(H2:M2, "Hi"), "Yes", "No")
But I'm getting an error that is:
You are referencing an array in a function that is not designed to take arrays as input so you need to enable them.
Try:
=ArrayFormula(IF(REGEXMATCH(H2:M2, "Hi"), "Yes", "No"))
I'm trying to do this: =IF(("Hi"=H2:L2),"Approve","No qualify") =IF(("Here"= H2:L2),"Approve","No qualify")
Assuming E1:E2 is the list of values to check against A1:C1, you can try:
=ArrayFormula(if(countif(E1:E2,A1:C1),"Approved","Not qualified"))
I would like my SQL query in PBI to be defined by parameter. The Parameter1 is a list of two values Big and Small. If I set up Parameter1 to Small then I want only a sample of data to be loaded. I am doing it this way:
let
ReturnQueryVar = (optional x) =>
if Parameter1 = "Small"
then " and Product in (1, 2, 3)"
else "",
Source = Sql.Database(
"myservername",
"mydatabase",
[
Query = "
select *
from table
where
1=1"
& ReturnQuery()
]
)
in
Source
I get this error:
Expression.Error: The name 'ReturnQuery' wasn't recognized. Make sure it's spelled correctly.
Update.
Facepalm! It was a typo. ReturnQuery should be ReturnQueryVar.
However, I would like to leave the question open for the part:
ReturnQueryVar = (optional x) =>
if Parameter1 = "Small"
then " and Product in (1, 2, 3)"
else ""
Does PowerQuery have a syntax for IF:
TextVar = IF(Parameter1 = 'S', 'This', 'That' )
I haven't seen syntax like that, but if you like you can create a function that does that, basically a "container" for the IF statement of Power Query.
For example, you can create a Blank Query called IF with the following contents.
(cond as logical, if_true as any, if_false as any ) =>
if cond then if_true else if_false
Using that function, anywhere it would have similar results and an IF statement.
I am just sharing here a PowerQuery snippet I ended up with. This code allows you to choose with a parameter between two alternate queries - the first for a sample and the other for the full rowset. It allows to download only a small sample of rows from a large table into Power BI Desktop.
let
QueryCode = if Query_Parameter = "Sample"
then
"select 1"
else
"select 2",
Source = Sql.Database(
"MyServer",
"MyDataBase",
[ Query = QueryCode ]
)
in
Source
Prior to that in Power Query Editor > Manage Parameters > Add New Parameter named Query_Parameter with 2 text values as a list: "Sample" and "Full" and based on this parameter the source of the query changes. Just replace "select 1" with anything narrowing your rows like "select top 1000..." or add WHERE condition. "select 2" is your query with full row set.
I am trying to extract relevant links from a huge list of links based on the text that is present in A:A. I have succeeded in extracting relevant links based on the value in A:A using the following formula:
=ArrayFormula({"Profile";if(len("*"&A2:A&"*"),iferror(vlookup(substitute("*"&C2:C&"*"," ","-")&"-"&"*"&A2:A&"*",{regexextract(D2:D,"^.+/(.+)\..+$"),D2:D},2,)),)})
Here is the URL to the Google Sheet
https://docs.google.com/spreadsheets/d/1Y1emSB2G2h_d1AIHNAqP6pIsG6-tK4sIIVCBGGjVd4g/edit?usp=sharing
The challenge I'm facing is that the formula returns blank results when a row in A:A contains more than one name i.e first and last names. I have tried all means but I can't get it to work when the value in the first column contains more than one name.
Please assist me if you know the solution to this.
try:
={"Profile"; ARRAYFORMULA(IFNA((VLOOKUP(REGEXEXTRACT(LOWER(A2:A), TEXTJOIN("|", 1,
IFNA(REGEXEXTRACT(E2:E, LOWER(TEXTJOIN("|", 1, SUBSTITUTE(A2:A, " ", "|"))))))), {
IFNA(REGEXEXTRACT(E2:E, LOWER(TEXTJOIN("|", 1, SUBSTITUTE(A2:A, " ", "|"))))), E2:E}, 2, 0))))}
Using Google Sheets I'm attempting to perform a match of values in a particular column and then based on that column execute a function(SUM) on matching values in a different column.
I've tried LOOKUP and VLOOKUP but those are throwing errors, presumably because they are expecting to only return a single value in a given range and not perform the SUM that I am requiring.
=LOOKUP("[sometext]*", A2:A25, SUM(H2:H25))
Ideally, what I would like to happen is to search the range A2:A25, find any rows that match "sometext*", e.g. "sometext1", "sometext2", "sometext3" etc. and then move over to second range and sum the values in the matched rows, e.g. "1", "2", "3" and return "6".
=ARRAYFORMULA(SUM(IF(REGEXMATCH(A2:A25, "sometext"),
REGEXREPLACE(A2:A25, "\D+", )*1, )))
=ARRAYFORMULA(SUM(IF(REGEXMATCH(A2:A25, "sometext"), B2:B25, )))