Error in calling crypto prices in Google Sheets - regex

This command:
=VALUE(REGEXEXTRACT(IMPORTDATA("https://min-api.cryptocompare.com/data/price?fsym=ETH&tsyms=USD"), "{.+:(.+)}"))
used to work just fine for ETH and BTC, but it is giving me this error now:
Error
Function REGEXEXTRACT parameter 2 value "{.+:(.+)}" does not match text of Function REGEXEXTRACT parameter 1 value "{"Response":"Error"".
What's the reason?

Consider using =IMPORTDATA("https://cryptoprices.cc/BTC/")
There's no parsing required, no limitations, no authentication.

try it perhaps tomorrow (you probably reached the max limit of free API calls for the day)

Related

Parse Days in Status field from Jira Cloud for Google Sheets

I am using Jira Cloud for Sheets Adds on in order to get Days in Status field from Jira, it seems to have the following syntax, from this post
<STATUS_ID>_*:*_<NUMBER_OF_TIMES_ISSUE_WAS_IN_THIS_STATUS>_*:*_<SECONDS>_*|
Here is an example:
10060_*:*_1_*:*_1121033406_*|*_3_*:*_1_*:*_7409_*|*_10000_*:*_1_*:*_270003163_*|*_10088_*:*_1_*:*_2595005_*|*_10087_*:*_1_*:*_1126144_*|*_10001_*:*_1_*:*_0
I am trying to extract for example how many times the issue was In QA status and the duration on a given status. I am dealing with parsing this pattern for obtaining this information and return it using an ARRAYFORMULA. Days in Status field information will be provided only when the issue was completed (is in Done status), otherwise, no information will be provided. if the issue is in Done status, but it didn't transition for a given status, this information will not be provided in the Days in Status string.
I am trying to use REGEXEXTRACT function to match a pattern for example:
=REGEXEXTRACT(C2, "(10060)_\*:\*_\d+_\*:\*_\d+_\*|")
and it returns an empty value, where I expect 10068. I brought my attention that when I use REGEXMATCH function it returns TRUE:
=REGEXMATCH(C2, "(10060)_\*:\*_\d+_\*:\*_\d+_\*|")
so the syntax is not clear. Google refers as a reference for Regular Expression to the following documentation. It seems to be an issue with the vertical bar |, per this documentation it is a special character that should be represented like this \v, but this doesn't work. The REGEXMATCH returns FALSE. I am trying to use some online RegEx tester, that implements Google Sheets syntax (RE2), I found ReGo, that I don't know if it is a valid one.
I was trying to use SPLITfunction like this:
=query(SPLIT(C2, "_*:*_"), "SELECT Col1")
but it seems to be a more complicated approach for getting all the values I need from Days in Status field string, but it separates well all the values from the previous pattern. In this case, I am getting the first Status ID. The number of columns returned by SPLITwill varies because it depends on the number of statuses the issues transitioned in order to get to DONE status.
It seems to be a complex task given all the issues I have encounter, but maybe some of you were dealing with this before and may advise about some ideas. It requires properly parsing the information and then extracting the information on specific columns using ARRAYFORMULA function when it applies for a given status from Status column.
Here is a google spreadsheet sample with the input information. I would like to populate the information for the following columns for Times In QA (C column) and Duration in QA (D column, the information is provided in seconds I would need in days but this is a minor task) for In QA status, then the same would apply for the rest of the other statuses. I added the tab Settings for mapping the Status ID to my Status, I would need to use a lookup function for matching the Status column in the Jira Issues tab. I would like to have a solution, without adding helper columns maybe it will require some script.
https://docs.google.com/spreadsheets/d/1ys6oiel1aJkQR9nfxWJsmEyd7XiNkVB-omcNL0ohckY/edit?usp=sharing
try:
=INDEX(IFERROR(1/(1/QUERY(1*IFNA(REGEXEXTRACT(C2:C, "10087.{5}(\d+).{5}(\d+)")),
"select Col1,Col2/86400 label Col2/86400''"))))
...so after we do REGEXEXTRACT some rows (which cannot be extracted from) will output as #N/A error so we wrap it into IFNA to remove those errors. then we multiply it by *1 to convert everything into numeric numbers (regex works & outputs always only plain text format). then we use QUERY to convert 2nd column into proper seconds in one go. at this point every row has some value so to get rid of zeros for rows we don't need (like row 2,3,5,8,9,etc) and keep the output numeric, we use IFERROR(1/(1/ wrapping. and finally, we use INDEX or ARRAYFORMULA to process our array.

Google Data Studio RegExp_Match not matching textPayload dimension in log payload

I'm new to Google Data Studio, and currently stuck on the following problem.
I have some log data in BigQuery and I am trying to visualize some info out of my logs using Google Data Studio.
The problem is when I use REGEXP_MATCH on one specific dimension of my data, it cannot match the RegEx. When I use REGEXP_MATCH against any other dimension of my log data, it works without a problem.
I am wondering, whether that could be due to the long strings that I have in that specific dimension, or are there any other thoughts?
By the way, I am able to make changes to that dimension using REGEXP_REPLACE, but cannot even do REGEXP_MATCH against the text that REGEXP_REPLACE replaced in there.
I have been working around this for days now and any advise will be really appreciated.
I finally found out that REGEXP_EXTRACT works against that dimension. Then it's also possible to do REGEXP_MATCH on the output of REGEXP_EXTRACT with no problem.
I still don't know why REGEXP_MATCH does not work directly against that specific dimension, maybe due to long strings or some specific letters that I have in my data in that dimension or some other reason.

Vtiger. Change query limit

In vtiger wiki written:
Query always limits its output to 100 records, client application can use limit operator to get different records.
This query does not work:
doQuery("select * from Leads limit='200';")
How to specify the operator in a query?
The "limit" clause only works if the number given is lower than 100. You can't get more records than 100 using "limit" with 1 request.
To get more than 100 records from vTiger services you need to make various request using the "offset" in the "limit" clause.
If you really read the Wiki documentation, you'd see that you need to use:
select *
from Leads
limit 200;
Stop using unnecessary single quotes ('200') - the limit expects a numerical value, there's absolutely no point in converting that to a string (by using single quotes) .....
and drop the equal sign, too - it's not shown in the docs anywhere .....

Too many arguments in my IF statement

I keep receiving an error message that my IF statement has too many arguments. I have used this formula in other excel workbooks and it has worked. Can anyone see what the problem is? Thank you for your help!
=IF(OR(AD2="22",AD2="23",AD2="39",AD2="540",AD2="541",AD2="836"),"1",IF(OR(AD2="335",AD2="312",AD2="364",AD2="367",AD2="311",AD2="336",AD2="365",AD2="319",AD2="368",AD2="488",AD2="498",AD2="461",AD2="501",AD2="505",AD2="531",AD2="462",AD2="489",AD2="491",AD2="491",AD2="493",AD2="507",AD2="457",AD2="460",AD2="499",AD2="503",AD2="509",AD2="513",AD2="539",AD2="612",AD2="613",AD2="568",AD2="821",AD2="827",AD2="829",AD2="835",AD2="845",AD2="846",AD2="615",AD2="620",AD2="614",AD2="691",AD2="719",AD2="873",AD2="877",AD2="32",AD2="427",AD2="373",AD2="465",AD2="502",AD2="511",AD2="466",AD2="475",AD2="481",AD2="500",AD2="504",AD2="462",AD2="489",AD2="491",AD2="493",AD2="507",AD2="503",AD2="513",AD2="539",AD2="607",AD2="610",AD2="608",AD2="609",AD2="611",AD2="579",AD2="769",AD2="795",AD2="827",AD2="831",AD2="834",AD2="837",AD2="838",AD2="839",AD2="840",AD2="841",AD2="842",AD2="843",AD2="851",AD2="852",AD2="853",AD2="854",AD2="856",AD2="857",AD2="860",AD2="861",AD2="868",AD2="869",AD2="870",AD2="871"),"2",IF(OR(AD2="521",AD2="524",AD2="535",AD2="536",AD2="557",AD2="558",AD2="805"),"3","4")))
It seems that the error probably has to do with the limits of version you are using.
Since the formula contains fixed equivalences, I suggest to create a Define Name range then Vlookup cell AD2 to the table in order to obtain the related value:
=IFERROR(VLOOKUP(AD2,_Table,2,0),"4")
This formula should work fine in Excel 2007 and later (I just tested it in 2010 with no issues). The maximum number of arguments allowed in a function in these versions is 255. For earlier versions of Excel though, the max is 30. Since you did not specify which version of Excel you are using, I cannot be 100% sure if this is the problem though but I suspect this is what is going on. I recommend you upgrade to a more current version of the software, but if that's not an option you could always break out the function among multiple cells (In particular, it's the 2nd nested if statement, with ~90 parameters that is causing this...).

Using VBScript to access C++ COM module

First time question asker - I have searched through the site for questions related to VBSCRIPT, C++, and COM. I have found a couple of threads that I do believe speak to my core question but I was not able to walk away with an absolute.
I have been tasked with writing an automation script for a trucking company that uses PCMIler (which is arguably the most pervasive commercial trip routing tool in the market). The product comes with a tool called PCMiler Connect. PCmiler connect offers various API's to query the database. One of those is COM.
PCMiler is written in C++. I'm trying to accomplish this with VBScript.
The problem I'm having is trying to execute a method that requires 1 argument to be passed by reference. The method takes 4 arguments. It uses 3 of them to calculate the distance in miles from 2 points. The 4th argument is the one passed by reference and the retval is the 'time' in minutes.
Set server = CreateObject("PCMServer.PCMServer")
region = Server.DefaultRegion
Dim dist 'dist is short for Distance
Dim minutes
Dim time
'First Example use standard CalcDistance //THIS FUNCTION WORKS JUST FINE.
dist = server.CalcDistance("63139","62025") 'the passed parameters are Zip Codes
Wscript.Echo "CalcDistance: " & (dist / 10) 'Echo the distance in miles
//THIS EXAMPLE DOES NOT WORK!!!!
'Third Example use CalcDistance3 with a Route Type of 'Practical' (which is the 3rd argument). Pass variable 'minutes' as the return variable.
'Third Example - version 1. Passing the variable 'minutes' by itself - no character to indicate it is being passed by reference.
dist = server.CalcDistance3("63139","37217",1,cLng(time))
I have read in some threads that C++ must return the retval as Variant. This function returns a Long Integer. I can't change this. When I read the log file for PCMiler connect I can see where the retval is being calculated and logged - but VBScript is not picking it up, or it is not being returned correctly?
Ultimately - I'd like to ask someone to tell me If I'm out of look for using VBScript due to the fact I can't alter the C++ method - or if I can find a way to get the value - please help. If not - can someone tell me a better option for what I need to do?
While I have successfully used VBA in Access - this needs to be an automated script running every 30 minutes. I understand Access is not something that can be run reliably as an automated service.
C#?
VB?
Thank you.