Skip to content

Processing a Subset Example

  • Use Case: A dataset is loaded and processed, and additional processing steps must be performed on only a subset of the full dataset.
  • Example Recipe: In this example, the recipe takes product usage data from various implementations of a software product (online trial, online subscription, on-prem lite, and on-prem enterprise version) and splits it into different dimensions, such as usage and customers. It then runs a series of analyses on each dimension. For specific usage data from the online trial of the software, the company requires additional processing to give the Sales Team an additional indication of user engagement.
  • Conditional Node Role: Following the data mapping and action nodes to load, clean, split, and process the data, a conditional node determines if additional processing is needed based on the row count value stored in a "trial_greaterthan_five" variable for a subset of data that is tagged with the "onlinetrial" group and has more than five active users.

()

A conditional node determines if there is a subset of data that requires additional processing.

Web App Configuration

The following images show how the conditional node is configured using the web app forms.

  • Exporting the variable from a SQL script in an upstream node
  • Writing the condition statement for evaluation of the variable

()

The action node upstream of the conditional node generates the necessary variable.

()

The conditional node evaluates the trial_greaterthan_five variable with a Boolean result.

File Contents

The platform records the condition node configuration shown above in the recipe's variations.json file.

{
    "variation-list": {
        "usage_analysis": {
            "description": "Run the product usage analysis workflow for the specified quarter.",
            "graph-setting": "usage_graph",
            "schedule-setting": "Quarterly"
        }
    },
    "graph-setting-list": {
        "usage_graph": [
            [
                "Extract_Data",
                "Load_Cleanse_Data"
            ],
            [
                "Load_Cleanse_Data",
                "Process_Customer_Data"
            ],
            [
                "Process_Customer_Data",
                "Produce_Product_Results"
            ],
            [
                "Load_Cleanse_Data",
                "Process_ProductUsage_Data"
            ],
            [
                "Process_ProductUsage_Data",
                "Measure_TrialUsage"
            ],
            [
                "Measure_TrialUsage",
                "Process_OnlineTrial_Data",
                {
                    "condition": "condition_1_true"
                }
            ],
            [
                "Measure_TrialUsage",
                "Produce_Product_Results",
                {
                    "condition": "condition_1_false"
                }
            ],
            [
                "Process_OnlineTrial_Data",
                "Produce_Product_Results"
            ]
        ]
    },
    "override-setting-list": {
        "production-overrides": {
            "delete_temp_data": "true"
        }
    },
    "conditions-list": {
        "condition_1_true": {
            "mode": "condition",
            "index": 1,
            "condition": {
                "list": [
                    {
                        "metric": "0",
                        "variable": "trial_greaterthan_five",
                        "compare": "greater-than",
                        "execute": [
                            "Process_OnlineTrial_Data"
                        ],
                        "isTrueExecution": true,
                        "type": "test-contents-as-integer"
                    }
                ]
            },
            "node": "Measure_Trial_Usage"
        },
        "condition_1_false": {
            "mode": "condition",
            "index": 1,
            "condition": {
                "list": [
                    {
                        "metric": "0",
                        "variable": "trial_greaterthan_five",
                        "compare": "less-than-equal-to",
                        "execute": [
                            "Produce_Product_Results"
                        ],
                        "isTrueExecution": false,
                        "type": "test-contents-as-integer"
                    }
                ]
            },
            "node": "Measure_Trial_Usage"
        }
    },
    "schedule-setting-list": {
        "Quarterly": {
            "schedule": "0 0 1 */3 *",
            "scheduleTimeZone": "US/Eastern"
        }
    }
}