Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

Take different processing paths based on value in one cell in the output

TH
8 - Asteroid

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?

3 REPLIES 3
OTrieger
12 - Quasar

@TH 
If I understand you correctly the only thing that will change will be the email body and or the email subject. As you will always will send email with all the data.

Just create IF Formula for the Subject and based on it the email subject will change accordingly. 

EMAIL tool can be set with variables for each of the elements. So you only need to select for the Subject a field name and it will handle you problem

TH
8 - Asteroid

How to do that is exactly my question.

If I use the formula tool then it will apply the formula to EACH row in order to change a column or create the new one. At that point my table will be 3x3, and the third column could, depending on the data, be either of the subject/body strings that I want in the email.

How do I tell the formula to get one value based ONLY on the value in the Count column on the first row?

I guess maybe I have to use a sample tool and pick the first row of data...

OTrieger
12 - Quasar

@TH 
You can use sample tool and select the first row do the test, with select tool remove all the other data and then append the result to the rest of the data. That will be one way to do it

Polls
We’re dying to get your help in determining what the new profile picture frame should be this Halloween. Cast your vote and help us haunt the Community with the best spooky character.
Don’t ghost us—pick your favorite now!
Labels