Date: Mon, 19 Oct 2020 21:22:15 +0000 (GMT) Message-ID: <1027287060.14785.1603142535931@df68ed866f50> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_14784_380943026.1603142535931" ------=_Part_14784_380943026.1603142535931 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html Case Transform

# Case Transform

Contents:

=20

=20
=20
=20

=20
=20

NOTE: Transforms are a part of the underlying language,= which is not directly accessible to users. This content is maintained for = reference purposes only. For more information on the user-accessible equiva= lent to transforms, see Tr= ansformation Reference.

Performs conditional transformation of data with a single statement = using if-then-else logic or with multiple statements using case logic. Resu= lts are generated in a new column.

There are function equivalents to this transformation:

## Basic Usage

Example - if/then/else

This example illustrates a single if/then/else construction:

=20

case if: testScore >=3D 60 then: 'yes' else: '= no' as: 'passedTest'

Output: If a value in the ```testScore is greater than or equal to 60, a value of yes is wri= tten into the new passedTest column. Otherwise, a value o= f no is written.```

``` Example - Case (single column) This example shows how to step through a sequence of case tests applied = to a single column. =20 case col: custName colCases: ['Big Co',0.2],['Lit= tle Guy Ltd',0.05] default: 0 as: 'discountRate' Output: Checks names in the custName column and writes discount values based on exact matches of values in = the column: custName value discountRate Big Co 0.2 Little Guy Ltd 0.05 default (if no matches) 0 Example - Case (custom conditions) The following example illustrates how to construct case transforms with = multiple independent conditions. Tests can come from arbitrary columns and = expressions. The first case is tested: If true, then the listed value is written to the new = column. If false, then the next case is tested. If none of the stated cases evaluates to true, then t= he default value is written. =20 case cases: [totalOrdersQ3 < 10, true], [lastO= rderDays > 60, true] default: false as: 'sendCheckinEmail' Output: If the total orders in Q3 < 10 OR the l= ast order was placed more than 60 days ago, then write true in the sendCheckinEmail. Otherwise, write f= alse. Logic Test SendCheckinEmail if totalOrdersQ3 < 10 true if above is false lastOrderDays > 60 true if above is false write default false S= yntax and Parameters =20 case [if: if_expression] [then:'str_if_true'] [el= se:'str_if_false] [col:col1] [colCases: [[Match1,Val1]],[[Match2,Val2]][cases: [[Exp3,Val3]],[[Exp4,Val4]] [default:default_val] as: 'new= _column_name' Token Required? Data Type Description case Y transform Name of the transform if N string (For single if/then/else) Expressi= on that is tested must evaluate to true or false.= then N string (For single if/then/else) Va= lue written to the new column if the if expression is true. else N string (For single if/then/else) Va= lue written to the new column if the if expression is false. col N string (For single-column case) Name of c= olumn whose values are to be tested. colCases N comma-separated arrays (For single-column case) = Matrix of string-value pairs: First entry is the value to match. Second entry is the value written to the new column if a match ap= pears cases N comma-separated arrays (For custom conditions case) Ma= trix of expression-value pairs: First entry is the expression to evaluate. Second entry is the value to write if the expression is true. default N any (For single-column case and custom conditi= on case) If no matches are made, this value is written to the new co= lumn. as Y string Name of the new column where= results are written.   For more information on syntax standards, see Language Documentation Syntax Notes<= /a>. if For if-then-else condition types, this value is an expression to test. E= xpression must evaluate to true or false.  Usage Notes: Required? Data Type Required for if-the-else condition type String (expression) then For if-then-else condition types, this value is a literal value to write= in the output column if the expression evaluates to true= .  Usage Notes: Required? Data Type Required for if-the-else condition type String or other literal type else For if-then-else condition types, this value is a literal value to write= in the output column if the expression evaluates to false.  Usage Notes: Required? Data Type Required for if-the-else condition type String or other literal type col For single-case condition types, this value identifies the = column to test. Usage Notes: Required? Data Type Required for single-case condition type String (column name) colCases For single-case condition types, this parameter contains a = comma-separated set of two-value arrays. Array value 1: A literal value to match i= n the specified column. Array value 2: If the value is matched, t= his value is written into the output column.  You can specify one or more cases as comma-separated two-va= lue arrays. Usage Notes: Required? Data Type Required for single-case condition type Array (comma-separated list) cases For multi-case condition types, this parameter contains a c= omma-separated set of two-value arrays. Array value 1: An expression to test= , which must evaluate to true or false.= Array value 2: If the value is match= ed, this value is written into the output column.  You can specify one or more cases as comma-separated two-va= lue arrays. Usage Notes: Required? Data Type Required for single-case condition type Array (comma-separated list) default For single-case and multi-case condition types, this parame= ter defines the value to write in the new column if none of the cases yield= s a true result. Usage Notes: Required? Data Type Required for single-case condition type Literal of any data type as Name of the new column that is being generated. If the as parameter is not specified, a default name is used. Usage Notes: Required? Data Type Yes String (column name) Examples Tip: For additional examples, see Common Tasks. See above. =20 See Also:=20 =20 =20 =20 Page:= =20 =20 =20 Case Transform= =20 =20 =20 =20 Page:= =20 =20 =20 = Apply Conditional Transformations=20 =20 =20 =20 =20   ```
``` ------=_Part_14784_380943026.1603142535931-- ```
{"ft_lang_label":"__label__en","ft_lang_prob":0.62032855,"math_prob":0.93520254,"size":5316,"snap":"2020-45-2020-50","text_gpt3_token_len":1374,"char_repetition_ratio":0.14118975,"word_repetition_ratio":0.22347066,"special_character_ratio":0.26504892,"punctuation_ratio":0.13461539,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.98555535,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-10-19T21:22:16Z\",\"WARC-Record-ID\":\"<urn:uuid:713b83e4-8354-4473-9122-29227940c579>\",\"Content-Length\":\"24134\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:172e4a89-cc24-4941-82be-8155765b96f3>\",\"WARC-Concurrent-To\":\"<urn:uuid:c70c2a68-c7d6-4689-ad84-2342c54b8801>\",\"WARC-IP-Address\":\"54.214.103.58\",\"WARC-Target-URI\":\"https://docs.trifacta.com/exportword?pageId=109906212\",\"WARC-Payload-Digest\":\"sha1:LJ6Z72ORYUN6MJME7WS6QLH2OO46E75B\",\"WARC-Block-Digest\":\"sha1:55765SZZYWQ5MRAHVO2RLT6NIT7IQOTG\",\"WARC-Identified-Payload-Type\":\"message/rfc822\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-45/CC-MAIN-2020-45_segments_1603107866404.1_warc_CC-MAIN-20201019203523-20201019233523-00429.warc.gz\"}"}