Best Of
Re: How to format "or" clause in Query?
Domo's Javascript may not support .or(). Using the following code, you should be able to get the include to return true if either condition is met….creating an or condition.
query
.select([...]) // <- specify select columns here
.where(row => row.errorMessage.includes('Some text') || row.errorMessage.includes('Some other text'))
.limit(1000);
Re: Error with String to Date
@ggenovese never heard of FUZZY_PARSE_DATE(), super helpful function!!!
Re: Error with String to Date
there's a FUZZY_PARSE_DATE() function in Magic ETL, I tested with the string '/3/31/24/' and it converted it to date without an error
Re: Keep data in column as constant regardless of date
In an ETL, isolate your quota data and filter so you only have 1 row per rep, per quota. Then join that back to all data on Rep = Rep. If you provide sample data with Rep, Quota, and sales amount fields I can build it in an ETL and show you.
Re: Count the number of upper case letters in a string
I think you have to do this in an ETL, because REGEXP_REPLACE() doesn't work for me inside of a card.
LENGTH(REGEXP_REPLACE(`sample`,'[^A-Z]',''))
Re: Count the number of upper case letters in a string
LENGTH(Uppercase) - LENGTH(REGEXP_REPLACE(Uppercase, '[A-Z]', ''))
Re: How do I fix a string error with a date?
@kim_barragan0126 Based on your screenshot, it looks like your source data is from Excel. Likely what's happening is that you have a typo in one of your date columns. Since you only have 5 date columns, I'd suggest opening the filters of each date column to look for invalid date values. If a value is invalid, Excel cannot group it under a particular month/year with expandable "+" signs, which makes it easy to filter to bad values and correct them in the sheet before uploading.
Alternatively, you can try converting your datatypes in the ETL using the TRY_CAST function in a formula tile instead of the Alter columns. When using TRY_CAST, if it encounters a value that it cannot convert to a different datatype then the output for that row will be NULL instead of causing the dataflow to fail. Your formulas should look like this:
TRY_CAST(`Best Few Date` as DATE())
Re: Regex formula works in ETL preview but doesn't show up in dataset output?
I agree with Mark, for something like this you're better off without regex. I would note, however, that you're also slightly better off just using two SPLIT_PART invocations, like this:SPLIT_PART(SPLIT_PART(my_string, 'My Prefix', 2), 'My Suffix', 1)
Paired SPLIT_PART invocations like this will give you the part of your string that appears between the two constant strings. So, for our specific case:SPLIT_PART(SPLIT_PART(body, 'Amount: USD ', 2), ' ', 1)
I'd also recommend using SQUASH_WHITESPACE on the body first thing, so that subtle differences in the text don't cause the process to fail, like multiple spaces appearing in between 'Amount:' and 'USD' or 'USD' and the digits, or perhaps a newline appearing after the digits instead of a space. SQUASH_WHITESPACE will take care of all those cases:SPLIT_PART(SPLIT_PART(SQUASH_WHITESPACE(body), 'Amount: USD ', 2), ' ', 1)
In Mark's example, this would replace the "amount" formula and the "StringWithAmount" would be unnecessary. Though you could of course split this formula into another named stage if you desired.
All of that said, I am still curious about what was happening that was causing the preview to produce a result while the execution was not. Unfortunately the screenshot does not include enough of the result row to determine whether the failure was happening for the same input value as had been working in the preview. There would be no difference in the regex behavior between the two, so there must have been a difference in the input data the two were working with. Could it be that the Input DataSet tile is set to load only new rows? Just a curiosity.
rco
Re: Drill from world map to selected country
We do not currently provide multiple paths for a Drill Path in any cards. If you would like to submit this idea to our product team, you can do so here:
https://dojo.domo.com/main/categories/ideas
However, you can use DDX Bricks to do this I believe. If you use the DDX Interactive Phoenix Map App from the appstore, it should have what you need to create a similar card as well as have increased functionality for drilling or interacting as you click on the chart allowing you to change to different countries from your selections.
AKnowles




