Best Of
Re: Pivot/unpivot help Magic ETL
@Cbrack I just didn’t have anything to group by with the example data I generated to build your desired output. In your case, it could be a constant (Chem Data), or if you wanted to have multiple rows, you could group by something else (for example month or quarter).
Re: Changing data from text to integer
REGEXP_REPLACE(`field`, '^.* ([^ ]+)$', '$1') * 1
this should find the last value in your string after the last space. Multiplying it by 1 will convert it to a number.
Will the numbers be always at the end or anywhere in the string preceded by AUD?
Re: Concatenating amount and number fields WHILE also formatting them?
@AngelaO415 here you go. A few things to keep in mind. This beast mode works for whole rounded numbers, so it won't format decimal places correctly. I went ahead and configured it for up to 10million. If you want to expand it you can do so following the same pattern. If you need help expanding, let me know.
And here is the beast mode
CONCAT('$',
CASE
WHEN LENGTH(ROUND(`request_amount_recommended`)) < 4 then `request_amount_recommended`
WHEN LENGTH(ROUND(`request_amount_recommended`)) = 4 then CONCAT(SUBSTRING(`request_amount_recommended`,1,1),',',SUBSTRING(`request_amount_recommended`,2,3))
WHEN LENGTH(ROUND(`request_amount_recommended`)) = 5 then CONCAT(SUBSTRING(`request_amount_recommended`,1,2),',',SUBSTRING(`request_amount_recommended`,3,3))
WHEN LENGTH(ROUND(`request_amount_recommended`)) = 6 then CONCAT(SUBSTRING(`request_amount_recommended`,1,3),',',SUBSTRING(`request_amount_recommended`,4,3))
WHEN LENGTH(ROUND(`request_amount_recommended`)) = 7 then CONCAT(SUBSTRING(`request_amount_recommended`,1,1),',',SUBSTRING(`request_amount_recommended`,3,3),',',SUBSTRING(`request_amount_recommended`,5,3))
WHEN LENGTH(ROUND(`request_amount_recommended`)) = 8 then CONCAT(SUBSTRING(`request_amount_recommended`,1,2),',',SUBSTRING(`request_amount_recommended`,3,3),',',SUBSTRING(`request_amount_recommended`,5,3))
END
,' | ',
ROUND(`Duration in Years`),' year(s)'
)
Re: Conditionally show tabs in app based on user attributes
Love this idea @ellibot !
Re: Documentation on Activity Log Event/Action Definitions
omg +1 x10.
i love the advancements to DomoStats, hope the documentation improves in parallel.
Google produces really sick documentation on MIME types that might be an interesting format to follow.
Re: Random Number
@Ashleigh in that case, what if you did something with DENSE_RANK()?
DENSE_RANK() over (order by SUM(value) desc)
You could then do something like this
CONCAT('Customer ',DENSE_RANK() over (order by SUM(value) desc))
Re: Is it possible to upload many google sheets at the same time?
@Lu_zhang sure, happy to help. For an example, let's say you have the following 3 sheets, all with the same column headers.
Sheet1, Sheet2, Sheet3
You can use the following formula to combine all 3
=UNIQUE(QUERY({Sheet1!A1:C;Sheet3!A1:C},"WHERE Col1 IS NOT NULL ORDER BY Col1 ASC"))
You would adjust with your sheet names and columns. In this case there are 3 columns, so I go to Column C.
Unique makes sure that there are no duplicate rows, and also allows you to pull in the headers only once. It's important that there is a primary key in your dataset when taking this approach. In this example, I'm assuming that Col1 is the primary key (hence the NOT NULL check).
The formula that you see pulls together all 3 sheets into one.
Hope this is helpful!














