I have a data processing stream that does some SQL, compares some datasets, and outputs a small table with the results.
The results look a bit like the following.
---
Metric_Name Count
New Records 9999
Old Records 8888888
Old Records not in New 777
----
I want to send different email messages depending on the outputs. This is pretty easy if I can put an email tool at the end of each branch and then make the workflow pick a branch.
If the first value is 0 then I want to send a message like "No new records" (or an email with that in the subject line) and the entire dataset of three rows and two columns.
If the first value is positive then I want to send a message like "New records" (or an email with that in the subject line) and the entire dataset of three rows and two columns.
I can handle the email part. I don't need help with that.
The part I need help with is how to program the split in Alteryx.
I can't use a Filter tool because that will split the outgoing dataset, and I want to send the whole thing.
The Test tool has no output, so I can't use it to pick a workflow branch.
The Condition tool is only built for use with analytic apps' input, and this is a basic workflow.
Control containers are close, yet they won't quite work. They will execute only if the container's input anchor detects records. And I'm always going to have values in my table. Sometimes the first value (that's in place of "9999") might be zero, but it'll still be there. In that case the control container will run regardless of how big or small that value is.
This would be pretty easy in a scripting language. Something like the following.
If (first value == 0) then send email with table and "No New Records"
elif (first value > 0) then send email with table and "New Records".
else send email with table and "Error".
How do I program that in Alteryx?