Hi all,
I am trying to introduce another part to my formula (enclosed as New Workflow 1) whereby:
if IsNull(Cat1) and IsNull(Cat2) Then
Check Category against Other1
Check Category against Other2
Check Category against Other3
Check Category against Other4
If Match Then Yes
Else No
For example on screenshot provided(Image): I would expect Row 8, 10, 13 and 14 to come back as Yes. Row 4 seems to be correct as doesnt match.
Any help please. I have been struggling to get the next part of the IF to be added to my existing IF statement.
Thanks
Solved! Go to Solution.
Wonder if you would be able to help on another if statement:
I have enclosed sample data.
By logic: If Column A has value use Column A (I have this bit working). Else If Column A is Null look to Column C. If Column C is True look at Column B and work out depending on Column B which it then falls into ie 3,7,12 would be 1.
My code at the moment is:
If isNull(Column A) Then
If tostring([Column C]) = "True" Then
If ([Column B]) in ('3','7','12') Then 1
If ([Column B]) in ('16','18','19') Then 2
If ([Column B]) in ('24','27','32') Then 3
Hopefully that gives you enough info to work on. Struggling to get something that Alteryx likes as a formula.
Thanks
Hi @B_Y_ID8
Here is a workflow for the task.
Output:
Formula:
IF IsNull([Column A]) and [Column C]=1 THEN
IF ToString([Column B]) in ('3','7','12') THEN 1
ELSEIF ToString([Column B]) in ('16','18','19') Then 2
ELSEIf ToString([Column B]) in ('24','27','32') Then 3
ELSE Null() ENDIF
ELSE Null() ENDIF
Workflow:
Hope this helps 🙂
If this post helps you please mark it as solution. And give a like if you dont mind 😀👍
and just a pointer Bool translates to 1 and 0 even when its converted to string
Hope this helps 🙂
Hi @B_Y_ID8
Try this:
IF IsNull([Column A]) AND ToString([Column C])="True" THEN
IF ToString([Column B]) in ('3','7','12')
THEN 1
ELSEIF ToString([Column B]) in ('16','18','19')
THEN 2
ELSEIF ToString([Column B]) in ('24','27','32')
THEN 3
ELSE Null() ENDIF
ELSE Null() ENDIF
Thanks!
Phil
@atcodedog05 That's really clever to use a Bool for your true/false statement in the formula. I'm gonna have to remember that one. Thanks for the tip!
That was quick atcodedog05.
Sorry - prob wasnt clear but the expecting column would be values that end up in Column A
Thanks
Hi @B_Y_ID8
Is this the expected output
Please revert back quickly i might be going offline in sometime
Change the last Null() to [Column A] and you'll be covered.
IF IsNull([Column A]) and [Column C]=1 THEN
IF ToString([Column B]) in ('3','7','12') THEN 1
ELSEIF ToString([Column B]) in ('16','18','19') Then 2
ELSEIf ToString([Column B]) in ('24','27','32') Then 3
ELSE Null() ENDIF
ELSE [Column A] ENDIF
Thanks!
Phil