Skip to main content

Functions

Functions are used to anonymize data using a rule. Gigantics offers default functions that can be modified while editing the rule. The function options vary depending on the type of data contained in the table cell.

This is the list of available functions:

Mask

Masks the data into another value by transforming or replacing current data value. The options are:

Text transform (string/char)

Transforms the text value into the selected format.

ValueNew value
Nonefoo bar->foo bar
Uppercasefoo bar->FOO BAR
lowercaseFOO Bar->foo bar
Title casefoo bar->Foo Bar
Snake casefoo bar->foo_bar
Kebab casefoo bar->foo-bar

Replace (any)

Replaces the selected value with a different one

Alphabetical chars / Digits / Symbols

Replaces each alphabetic character with a different character. This replacement can be partial or conditional:

  • With: Select the character with which all alphabetic characters will be replaced:
ValueWithNew value
foo barx->xxx xxx
testing charx->xxxxxxx xxxx
12340->0000
1234753-H0->0000000-H
123.65,->123,65
$99£->£99
  • Field length: Additionally, it allows you to change the length of the new value. It can have 3 configurations:
    • Initial: Keep the length of the current value.
    • Random: Each field of the new value will have a different length than the original value.
    • Fixed: All values will have the same length.
TypeValueWithLengthNew value
Initialfoo barY-->YYY YYY
Initial1234560-->000000
Initial859.939.292,-->859,939,292
Randomtesting charY-->YY YYYYYYY
Random3451-->1111
Fixednew giganticsY2->YY YY
Fixed432192->99
  • Condition: Adds a condition that allows to keep parts of the string or to replace a substring.
    • Keep: Select this option to keep the first or last X characters.
    • Replace: Select this option to replace the first or last X characters.
ValueWithCondition# CharsNew value
foo barzKeep first2->foz zzz
foo barzKeep last4->zoo bar
testing charzReplace first1->zesting char
new giganticszReplace last3->new giganzzz

Word

Replace full word to other new

ValueWithNew value
JohnTest->Test
SarahTest->Test
Sarah CruzTest->Test Test

Regex

Replace chars/numbers/symbols using regex

ValueRegexReplace withNew value
test@email.com.+?(?=@)xxxx->xxxx@email.com
(+34) 603402022(?:00\|\+)\?[0-9]{2}0->(+00) 603402022

Field

Replace all field data to new value

ValueWithNew value
test multiple fieldundefined->undefined
769C Honey Creek St.Unamed Road->Unnamed Road
data:image/png;base64img->img

Shuffle

This function collects the column values and mixes them randomly.

Example:

Input:

  • Shuffle column: city
  • Table:

Input:

#emailstreetcitystate
1debra.burks@yahoo.com9273 Thorne Ave.Orchard ParkNY
2kasha.todd@yahoo.com910 Vine StreetForneyTX
3tameka.fisher@aol.com769C Honey Creek St.Redondo BeachCA

Output:

#emailstreetcitystate
1debra.burks@yahoo.com9273 Thorne Ave.ForneyNY
2kasha.todd@yahoo.com910 Vine StreetRedondo BeachTX
3tameka.fisher@aol.com769C Honey Creek St.Orchard ParkCA

Suffle group

This is a variant of shuffle where the selected fields are grouped together so that the selected fields are mixed in the same way and not each field independently.

Example:

Input:

  • Shuffle group: city and state columns
  • Table:
#emailstreetcitystate
1debra.burks@yahoo.com9273 Thorne Ave.Orchard ParkNY
2kasha.todd@yahoo.com910 Vine StreetForneyTX
3tameka.fisher@aol.com769C Honey Creek St.Redondo BeachCA
4daryl.spence@aol.com988 Pearl LaneUniondaleNY

Output:

#emailstreetcitystate
1debra.burks@yahoo.com9273 Thorne Ave.Redondo BeachCA
2kasha.todd@yahoo.com910 Vine StreetUniondaleNY
3tameka.fisher@aol.com769C Honey Creek St.ForneyTX
4daryl.spence@aol.com988 Pearl LaneOrchard ParkNY

List

Select a random value from a list. The lists available here are created from the Datasets area of the project configuration items. If the number of records is greater than the number of records in the dataset, the values will be repeated.

Example:

Input:

  • Column: fruit
  • Dataset: [Banana, Apple, Pear]
  • Table:
#fruitprice
1Pineapple$0.60
2Strawberry$0.40
3Coconut$2.95

Output:

#fruitprice
1Pear$0.60
2Banana$0.40
3Apple$2.95

Delete

This function will NULL the selected column. This function can’t be used on columns which are specified as NOT NULL.

Example:

Input:

  • Delete column: price
  • Table:
#fruitprice
1Pineapple$0.60
2Strawberry$0.40
3Coconut$2.95

Output:

#fruitprice
1PearNULL
2BananaNULL
3AppleNULL

Blank

Remove the value of the field.

Example:

Input:

  • Delete column: price
  • Table:
#fruitprice
1Pineapple$0.60
2Strawberry$0.40
3Coconut$2.95

Output:

#fruitprice
1Pear
2Banana
3Apple