We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Help adding new fields between every other Value field

Charlieswims
6 - Meteoroid

I have a dataset that looks as follows:

#       Entity        Entity Descr    Scope         TE      CASH      AR        AP

1       1000         Lab                    S             100       120         30        10

2       1001         XYZ LLC           R              50          20         40       70

 

The above is simplified, but there are about 40 fields in the actual dataset that continue after "AP". After each of the account columns (i.e. Cash, AR, AP, etc) I need to add a Scope Calculation column that designates what bucket the account will fall under (either A or T) based on the details in "scope" and "TE" columns.

 

The following are the rules for these new columns:

-Any row where the Scope Field = "R" or "O" would be always be assigned "A"

-Any row where the Scope Field = "F", would always be assigned "T"

-For rows where scope is "S" or "SP", the designation would be "A" if the value of the account is under "TE", and would be "T" if the value of account is above "TE"

 

So the following would be the end result of the simplified example. Could someone please help me figure out the easiest way to do this?

 

#       Entity        Entity Descr    Scope       TE        CASH                AR                AP      

1       1000         Lab                            S          100       120          T           30         A        10       A

2       1001         XYZ LLC                    R          50          20           A           40        A        70      A



2 REPLIES 2
binuacs
21 - Polaris

@Charlieswims One way of doing this with the formula tool

 

Can you explain the last rule? 

 

 if the value of the account is under "TE", and would be "T" if the value of the account is above "TE"

 

binuacs_0-1684341448590.png

 

Charlieswims
6 - Meteoroid

For example, looking at Cash, the value in the first record is 120, so its above the TE threshold for that row of 100, meaning it is designated a "T" rather than an "A". If cash in that row was below 100, it would be given the designation of "A". Does that help? I know I could do this with formula tool but that would probably take a while naming and organizing the fields.

 

This seems to work fine for now, may be too much effort to try and take a shortcut here. I wil just need to duplicate for each of the 30 accounts:

 

IIF([SCOPE TM] IN ('R','O'), 'A', IIF([SCOPE TM] IN ('F'),'T',(IF [CASH] > [TE] THEN "T" ELSE "A" ENDIF)))

Labels
Top Solution Authors