categorical-compare
  • 27 Jul 2022
  • 1 Minute to read
  • Contributors
  • Dark
    Light
  • PDF

categorical-compare

  • Dark
    Light
  • PDF

Article summary

The categorical-compare parser will evaluate or load data from two columns and compare their values. Depending on the value of the operator attribute, the comparison will evaluate to true, false, or null.

It inherits attributes and behaviors from its parent: abstract parser - boolean.

Note - the columns attribute supersedes the column attribute, which is not used in this parser type.

Attribute - operator

The operator attribute is required.

{
  "parser_type": "categorical-compare", 
  "columns": [
    {...}, // parser one
    {...}  // parser two 
  ],
  
  // The operator attribute defines a comparison function.
  // Options include: 
  // "=" - equals
  // "!=" - not equals
  // "_=" - lowercase equals
  // "_!=" - lowercase not equals
  // "contains" - parser one value contains parser two value
  // "!contains" - parser one value does not contain parser two value
  // "_contains" - lowercase contains
  // "_!contains" - lowercase not contains
  //
  "operator": "="
}

Attribute - columns

The columns attribute is required.

{
  "parser_type": "categorical-compare", 
  "operator": "=",
  
  // The columns attribute specifies two column names
  // to produce values for comparison
  //
  "columns": [
    "ccc1", // column one name - a parser will be auto-generated
    "ccc2"  // column two name - a parser will be auto-generated
  ]
}

Attribute - columns as parsers

The columns attribute is required.

{
  "parser_type": "categorical-compare", 
  "operator": "=",
  
  // The columns attribute specifies two inner parsers to produce
  // values for comparison
  //
  "columns": [
    {...}, // parser one
    {...} // parser two
  ]
}

Was this article helpful?