I am using the following expression in the Criteria section of an Access Query
<DateAdd("m", -3, Date() )
I have tried it with quotes and hash characters etc but every time I get
"The expression you entered contains invalid syntax"
I have aslo used the expression builder with the same results.
Any ideas.
Related
I have this Google Sheet file using this formula to split and flatten the input in B2:B3
=ArrayFormula(LAMBDA(sp, FLATTEN(SPLIT(sp, "♥"))))(BYROW(A2:A3, LAMBDA(rp, REPT(B2:B3&"♥",rp))))
I encounterd this error
Error
Invalid call to non-function.
What is it and How to solve it?
The error that you have received will mean that the formula was not able to call the parameter that your function was expecting, checking both of the 2 formulas that you have made:
LAMBDA(sp, FLATTEN(SPLIT(sp, "♥")))
And
LAMBDA(rp, REPT(B2:B3&"♥",rp))
Both of them are calling a range being this part of the formula expression however there is no really a valid value to be passed to the expression so it can "call it" to provide the result.
In a nutshell, the error "Invalid call to a non function" means that in your formula you have put the call parentheses "()" which contains the data that will be called to the function that you have named but this data can't be called.
An example of this error can be made with the following LAMBDA formula:
=LAMBDA(test, test())(A1)
Using this formula will display the same exact error and this is due to the parameter being "called" it's invalid, this is due to the data being called a range and not a valid function.
You can try this formula for lambda approach.
=LAMBDA(Rpt,Rpn,QUERY(INDEX(FLATTEN(SPLIT(REPT(Rpt&"♥",Rpn),"♥"))),"where Col1 is not null"))(B2:B3,A2:A3)
Without lambda-
=QUERY(INDEX(FLATTEN(SPLIT(REPT(B2:B3&"♥",A2:A3),"♥"))),"where Col1 is not null")
I think the issue is that you are calling a vertical range B2:B3 from within the internal LAMBDA that is not defined as part of the range to be passed to it from the BYROW that is calling it. I think a MAP would be more appropriate than the BYROW in this case as you can then feed multiple ranges into the LAMBDA it calls:
=arrayformula(lambda(flt,filter(flt,flt<>""))(lambda(sp,flatten(split(sp,"|")))(map(A2:A3,B2:B3,lambda(a,b,rept(b&"|",a))))))
N.B. - The additional outer lambda is required to filter out the empty cells that will occur when sp is flattened if the numbers of repeats in B2:B3 is not the same (as jagged arrays aren't allowed). This could obviously also be done with a QUERY, but here is one way of doing it with LAMBDAs all the way through.
I'm trying to add a Regex expression to REGEXMATCH, but every time I try Google sheets adds a closing parenthesis and breaks the formula giving me a parse error. I'v tried to escape the single quote, double quote and parenthesis, but with no luck any tips? also tried to add the regex to a cell and reference that, but didn't behave as expected
this is the regex I'm trying to add ['"(]
you will need to double them like:
['""(]
example: https://stackoverflow.com/a/66028064/5632629
I am trying to update range using /workbook/worksheets/{id|name}/range(address='<address>') request from https://learn.microsoft.com/en-us/graph/api/range-update?view=graph-rest-1.0&tabs=http. In my case document contains two sheets with names 'invoice' and 'invoice-lines'. Cell's to update address is 'invoice-lines'!$B$5 in second sheet. Address I get from API using GET /workbook/worksheets/{id|name}/names request.
My request with address example:
https://graph.microsoft.com/v1.0/groups/{group-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address=''invoice-lines'!$B$5')
I expect result the same as I get when updating range in sheet 'invoice' with request https://graph.microsoft.com/v1.0/groups/{group-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='invoice!$B$5'),
but actual result is 400 Error with message "Syntax error at position 18 in 'address=''invoice-lines'!$B$5''."
I tried encode URL and remove quotes. Without quotes in address I get error The argument is invalid or missing or has an incorrect format.
How my request should look like to update this range?
I need to use query in Google Sheet Spreadsheet to return text in Column B of a given length, and various other conditions. To make it easy, below is a simplified version concentrate solely on Len() function. Seems simple enough but unfortunately does not work.
=QUERY(Valuations!B1:B,"select B where LEN(B)>3 ")
I'm aware that SQL uses LEN(), where as LENGTH() for MySQL.
Are my syntax incorrect or it is not possible to check string length in Google Sheet Query?
You can do it using a filter
=filter(B:B,len(B:B)>=3)
And then if you want to combine that with other conditions, you can put it in a query e.g.
=query(filter(A:B,len(B:B)>=3),"select Col1,Col2 where Col1>1")
See this question
A regular expression can be used:
=QUERY(Valuations!B1:B, "select B where B matches '.{3,}'")
The regular expression explained:
. match any character
{3,} match the preceding symbol (the .) 3 or more times
You could also search for a specific length by modifying the expression to ^.{3}$
OR a range ^.{3,10}$
OR a maximum ^.{,10}$
^ the start of the string
$ the end of the sting
regex101.com is a valuable resource for regular expressions.
I am not associated with the site in any way but I use it all the time.
To not use another thread and after trying to get my formula working with multiples examples from the Internet, I have built the following :
=importXML("http://www.sportingcharts.com/nhl/stats/player-blocks-statistics/2015/", "//*[#id="statomatic"]/table")
However, when running it with Sheets, it gives me a parse error.
What have I done wrong ?
Part 1: The parsing error
The parsing error occurs because the double quotes. Replace the inner double quotes by single quote. In other words, instead of
"//*[#id="statomatic"]/table"
something like the following should be used:
"//*[#id='statomatic']/table"
Part 2: The xPath
Once the parsing error be resolved the resulting formula still will not work because the xPath can't be found.
The following xPath will return the stats table in the page:
"//div/table/*/tr"
Note: the quotes are included as they are required by the IMPORTXML formula.