Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

Formula Question

bliffick
7 - Meteor

Hello All,  

 

I have searched for this answer but I cannot find a specific one.  I am currnetly writting a failry large formula and want to break it up into smaller easier to read segments.  If I put all the data in one formula it works in my output, but IF I seperate them, none of the Formulas work, except for the first one.  All of the data is going to be written to the same column for each portion.  

 

Is this possible, or do I need everything to go into one big formula?

8 REPLIES 8
ChrisTX
16 - Nebula
16 - Nebula

It is possible to break up a large formula into smaller segments.  For each segment, are you using the correct output data type?

 

Chris

bliffick
7 - Meteor

I am not sure I understand your question, I am new to Alteryx.  

apathetichell
19 - Altair

use text input tool. create a matrix of values.

make sure your formats match.

use a join tool.

Qiu
21 - Polaris
21 - Polaris

@bliffick 
It is my experience, wer are not doing it correctly if we are writting long conditional statement 😁
if you can eloborate your question with sample input and output date, I am sure someone can help.

caltang
17 - Castor
17 - Castor

That's a very long IF statement. Do you mind providing some raw data? Also what do you exptect? A simpler expressio or...?

Calvin Tang
Alteryx ACE
https://www.linkedin.com/in/calvintangkw/
caltang
17 - Castor
17 - Castor

Better still, since you're already using Alteryx - you could export this workflow over here if it's possible.

 

To export a workflow go to: Options > Export Workflow. Kindly do NOT send a "Save As" copy.

Calvin Tang
Alteryx ACE
https://www.linkedin.com/in/calvintangkw/
ChrisTX
16 - Nebula
16 - Nebula

The syntax for your Contains function is not correct:  

  elseif StartsWith([05], "Microsoft windows 10") and Contains([05_Version], "17763" or "18363" or "14393") Then "windows 10"

 

You can't use "or" inside a Contains function.

 

The correct syntax is:

  elseif StartsWith([05], "Microsoft windows 10") and (Contains([05_Version], "17763") or Contains([05_Version], "18363") or Contains([05_Version], "14393")) Then "windows 10"

 

Here's the list of Functions:  https://help.alteryx.com/current/en/designer/functions.html

 

Chris

bliffick
7 - Meteor

The reason for the long if statement is I am sorting a large amount of Operating systems, and trying to have the formula catergorize them, instead of me copy pasting a ton through the next week.  My question boils down to, why when I break out portios of the If statement (into their own container) why does the entire IF statement stop functioning.  I have the formula set to VWString, which is what the incoming data is.  

Labels