Waterfall
  • 3 Minutes to read
  • Dark
    Light
  • PDF

Waterfall

  • Dark
    Light
  • PDF

Article summary

Processes a group of segments in sequence in order to assign each record in the owner table to a mutually exclusive segment.

The dialog has two modes of operation

  • basic - creates a field indicating which of a set of segments a record first appears in.  This is useful where a record is present in multiple datasets but needs to be assigned exclusively to just one of those datasets.
  • hits - creates a field indicating the number of segments that a record appeared in. 


Tip!
Drag Datasets, or DataSet collections from the Project Explorer into the Dataset list.



Basic Mode

Depending on the order in which segments are processed, counts in the waterfall field may be equal to or less than the counts of the input segments.  In the example below, segments 1 and 2 have the same counts in input and output segments, whereas segments 3 and 4 are reduced.  This is because some of the records in segments 3 and 4 are also present in segment 1 or 2

Here we can see that 2,021 records from segment C (DerivedBrandOrder 3) are also in segment B (Product 2).   As a result, the waterfall output for segment 3 (DerivedBrandOrder 3) is 11,636, compared to an input of 13,657.

Tips!
  • Watch out for unexpected counts if using segments from different tables - see resolution levels for more details.
  • Add ordinals to input segment names to help determine the order in which the waterfall was processed
  • Use Venn and DataSet Scratch to clarify how output segment counts were produced

Hits Mode

When working in hits mode, the waterfall will count the number of input segments containing each record in the input universe.

In the example below, dataset fields have been created from the input segments, and then added together using LMATH A+B+C+D to create the field W_Hits.

W_Hits corresponds to the waterfall hits field wtest_hits:


JSON method

Waterfall uses the datasetdecode method:

Note!
It is not recommended to use the datasetmethod without using the Engineering | Waterfall dialog.



Basic

{
  "method": "BuildBakedField",
  "project": "SalesData1",
  "targetTable": "Sales",
  "overwrite": true,
  "name": "wtest1",
  "function": "datasetdecode",
  "hits": false,
  "values": [
    "1 Product Product 2",
    "2 Brand Brand 2",
    "3 DerivedBrandOrder 3",
    "4 Fiscal Quarter FY18-Q3"
  ],
  "datasets": [
    {
      "logic": "or",
      "name": "Product Product 2",
      "strict": true,
      "set": [
        {
          "logic": "or",
          "stype": "FIELD",
          "entity": {
            "type": "field",
            "name": "Sales.Product",
            "table": "Sales",
            "valueFilter": []
          },
          "op": "=",
          "values": [
            "Product 2"
          ]
        }
      ]
    },
    {
      "logic": "or",
      "name": "Brand Brand 2",
      "strict": true,
      "set": [
        {
          "logic": "or",
          "stype": "FIELD",
          "entity": {
            "type": "field",
            "name": "Sales.Brand",
            "table": "Sales",
            "valueFilter": []
          },
          "op": "=",
          "values": [
            "Brand 2"
          ]
        }
      ]
    },
    {
      "logic": "or",
      "name": "DerivedBrandOrder 3",
      "strict": true,
      "set": [
        {
          "logic": "or",
          "stype": "FIELD",
          "entity": {
            "type": "field",
            "name": "Sales.DerivedBrandOrder",
            "table": "Sales",
            "valueFilter": []
          },
          "op": "=",
          "values": [
            "3"
          ]
        }
      ]
    },
    {
      "logic": "or",
      "name": "Fiscal Quarter FY18-Q3",
      "strict": true,
      "set": [
        {
          "logic": "or",
          "stype": "FIELD",
          "entity": {
            "type": "field",
            "name": "Sales.Fiscal Quarter",
            "table": "Sales",
            "valueFilter": []
          },
          "op": "=",
          "values": [
            "FY18-Q3"
          ]
        }
      ]
    }
  ]
}

Hits

{
  "method": "BuildBakedField",
  "project": "SalesData1",
  "targetTable": "Sales",
  "overwrite": true,
  "name": "wtest1_hits",
  "function": "datasetdecode",
  "hits": true,
  "values": [
    "1 Product Product 2",
    "2 Brand Brand 2",
    "3 DerivedBrandOrder 3",
    "4 Fiscal Quarter FY18-Q3"
  ],
  "datasets": [
    {
      "logic": "or",
      "name": "Product Product 2",
      "strict": true,
      "set": [
        {
          "logic": "or",
          "stype": "FIELD",
          "entity": {
            "type": "field",
            "name": "Sales.Product",
            "table": "Sales",
            "valueFilter": []
          },
          "op": "=",
          "values": [
            "Product 2"
          ]
        }
      ]
    },
    {
      "logic": "or",
      "name": "Brand Brand 2",
      "strict": true,
      "set": [
        {
          "logic": "or",
          "stype": "FIELD",
          "entity": {
            "type": "field",
            "name": "Sales.Brand",
            "table": "Sales",
            "valueFilter": []
          },
          "op": "=",
          "values": [
            "Brand 2"
          ]
        }
      ]
    },
    {
      "logic": "or",
      "name": "DerivedBrandOrder 3",
      "strict": true,
      "set": [
        {
          "logic": "or",
          "stype": "FIELD",
          "entity": {
            "type": "field",
            "name": "Sales.DerivedBrandOrder",
            "table": "Sales",
            "valueFilter": []
          },
          "op": "=",
          "values": [
            "3"
          ]
        }
      ]
    },
    {
      "logic": "or",
      "name": "Fiscal Quarter FY18-Q3",
      "strict": true,
      "set": [
        {
          "logic": "or",
          "stype": "FIELD",
          "entity": {
            "type": "field",
            "name": "Sales.Fiscal Quarter",
            "table": "Sales",
            "valueFilter": []
          },
          "op": "=",
          "values": [
            "FY18-Q3"
          ]
        }
      ]
    }
  ]
}



Was this article helpful?