I am really new to Alteryx and I want to apply this simple example to new analysis of a large data set:
SetID | SetID | |
1 | 123 | Ana |
2 | 123 | Ana |
3 | 124 | Sorin |
4 | 124 | Soran |
* |
I tried different IF statements to say that if both SetID and SetID are the same then "True" else "False" endif
I know this must be easy and I must not write the statement correctly, but could anybody offer some help? I would really appreciate it, as I am learning....
Solved! Go to Solution.
In The Formula tool, there are coditional statements already written out. you just have to fill in the lower cases
Ex. IF [SetID] = [SetID] THEN "True" ELSE "False" ENDIF
Thanks for the quick reply, AustinRiggs94!
My issue is that I need to compare the SetID and Name together.
I used this:
f [SetID] and [Name]==[SetID] and [Name] then "True" else "False" endif
and I was hoping to get back something like this:
SetID | Name | Result |
123 | Ana | TRUE |
123 | Ana | TRUE |
124 | Sorin | FALSE |
124 | Soran | FALSE |
but all I get back is this:
123 | Ana | [Null] |
123 | Ana | [Null] |
124 | Sorin | [Null] |
124 | Soran | [Null] |
[Null] | [Null] | [Null] |
You could achieve this a few different ways, but the cleanest (in my opinion), would be something like this:
The first Summarize groups the names/IDs together (getting rid of exact duplicates), the second counts how many records for each ID still exist, and Formula checks to see if it's just one, and the Join brings it back to your original data. You could potentially use a Multi-Row Formula, but if you end up with more than two records with the same ID, you run the risk of two of them matching and the third not. The method here has the benefit that it will only produce true if ALL records for a given ID share the same name.
Take a look, hope it helps!
Perfect! This is exactly what I was looking for. Now I understand what I was missing.
Thank you, danrh!