Skip to content
Snippets Groups Projects
Unverified Commit 53bb08d8 authored by flamber's avatar flamber Committed by GitHub
Browse files

Fix expression 'replace' helper text (#12317)


* Fix expression 'replace' helper text

* Prettier

* Kyle correctness :-)

Co-Authored-By: default avatarKyle Doherty <kdoh@users.noreply.github.com>

Co-authored-by: default avatarKyle Doherty <kdoh@users.noreply.github.com>
parent 06f14c01
No related branches found
No related tags found
No related merge requests found
......@@ -76,7 +76,7 @@ This would return rows where `Created At` is between January 1, 2020 and March 3
| Percentile | `percentile(column, percentile-value)` | Returns the value of the column at the percentile value. | `percentile([Score], 0.9)` |
| Power | `power(number, exponent)` | Raises a number to the power of the exponent value. | `power([Length], 2)` |
| Regex extract | `regexextract(text, regular_expression)` | Extracts matching substrings according to a regular expression. | `regexextract( [Address], "[0-9]+" )` |
| Replace | `replace(text, position, length, new_text)` | Replaces a part of the input text with new text. | `replace( [Order ID], 8, 3, [Updated Part of ID] )` |
| Replace | `replace(text, find, replace)` | Replaces a part of the input text with new text. | `replace( [Title], "Enormous", "Gigantic" )` |
| Round | `round(number)` | Rounds a decimal number either up or down to the nearest integer value. | `round([Temperature])` |
| Right trim | `rtrim(text)` | Removes trailing whitespace from a string of text. | `rtrim( [Comment] )` |
| Share | `share(condition)` | Returns the percent of rows in the data that match the condition, as a decimal. | `share( [Source] = "Goolge" )` |
......@@ -94,7 +94,7 @@ This would return rows where `Created At` is between January 1, 2020 and March 3
Certain database types don't support some of the above functions:
MySQL
MySQL and SQL Server
- median
- percentile
......
......@@ -235,35 +235,21 @@ const helperTextStrings = [
},
{
name: "replace",
structure:
"replace(" +
t`text` +
", " +
t`position` +
", " +
t`length` +
", " +
t`new_text` +
")",
structure: "replace(" + t`text` + ", " + t`find` + ", " + t`replace` + ")",
description: t`Replaces a part of the input text with new text.`,
example:
"replace([" + t`Order ID` + "] , 8, 3, [" + t`Updated Part of ID` + "] )",
example: "replace([" + t`Title` + '] , "Enormous", "Gigantic")',
args: [
{
name: t`text`,
description: t`The text that will be modified.`,
},
{
name: t`position`,
description: t`The position where the replacing will start.`,
},
{
name: t`length`,
description: t`The number of characters to replace.`,
name: t`find`,
description: t`The text to find.`,
},
{
name: t`new_text`,
description: t`The text to use in the replacement.`,
name: t`replace`,
description: t`The text to use as the replacement.`,
},
],
},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment