Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Expression - If column has text adjust value column to the right

jalizmaldonado
8 - Asteroid

Hi, I'm trying to move my value column to mirror the text column.

 

For instance, if there's text in the G/L CATEGORIES (DR) column keep G/L CATEGORIES (DR) value data in the G/L CATEGORIES (DR) data column but if there's text in the G/L CATEGORIES (CR) column then value from G/L CATEGORIES (DR) value column to the G/L CATEGORIES (CR) value column.

 

Tried using the multirow tool with the following formula but it did not work out for me:

 

if !isnull([G/L Categories (DR)]) And isnull([G/L Categories (CR)]) then
[[Row+1:Value]+1]]
else
[[Row-1:Value]]
endif

3 REPLIES 3
pedrodrfaria
13 - Pulsar

Hi @jalizmaldonado 

 

I'm not 100% sure I follow why you are using a multirow based on your explanation. Are we trying to look at different rows and bring those values? or are we trying to create new columns based on the same row information?

 

Based on what you described, this would be the set up creating new columns:

 

pedrodrfaria_0-1614252914160.png

DR

if !IsNull([G/L CATEGORIES (DR)]) and IsNull([G/L CATEGORIES (CR)]) then [G/L CATEGORIES (DR)] else Null() endif

CR

if !IsNull([G/L CATEGORIES (CR)]) and !IsNull([G/L CATEGORIES (DR)]) then [G/L CATEGORIES (DR)] else [G/L CATEGORIES (CR)] endif

 

Let me know if this was not what you were looking for.

 

I attached the workflow.

 

 

 

jalizmaldonado
8 - Asteroid

Hi @pedrodrfaria

 

I'm trying to move the numerical value in the place of the debit/credit text so that it creates a balance sheet. 

echuong1
Alteryx Alumni (Retired)

If I understand your requirements, this should work:

 

I first used a formula to fill in the CR values - if the category for CR is not null, then I took the value from the DR column.

 

I then used another formula to clean up the DR values - if the category for DR is not null, I kept the value as is. Otherwise, I replaced it with a null.

 

echuong1_0-1614360119310.png

 

Labels
Top Solution Authors