Early bird tickets for Inspire 2023 are now available! Discounted pricing closes on January 31st. Save your spot!

Alteryx Designer Discussions

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

Data formatting

Abhii2658
8 - Asteroid

I need to change the data formats for the following 

 

a.    123- needs to be changed to -123

b.     All fields for a record with 00000 needs to be blank 

 

Thanks in advance. 

 

 

2 REPLIES 2
MarqueeCrew
20 - Arcturus
20 - Arcturus

@Abhii2658 ,

 

How about:

 

IF [_Current Field_] == "0000"  THEN ''     ELSEIF

RIGHT([_Current Field_] ,1) == "-" THEN "-"+ Trim_right([_current field_],"-")

ELSE [_Current Field_]

ENDIF

 

something like that should work and you can use it in a multi-field formual with a little change here or there.

 

BTW, '' is empty and NULL() is null

 

Cheers,

 

Mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
kelsey_kincaid
11 - Bolide

Hi @Abhii2658 -

This is a great use case for the Formula tool or Multi-Field Formula. Something like this should work for you.

 

IF Right([Field],1)="-" THEN "-"+Left([Field],Length([Field])-1)
ELSEIF [Field]="00000" THEN ""
ELSE [Field]
END

 

Labels