Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

rename the content

ll1100000
8 - Asteroid

I have a column called "Metrics" , how can I rename the contents in this column?

 

Metrics
Adjusted Sales $
Adjusted Sales %

 

Adjusted Sales $ = Sales $

Adjusted Sales % = Sales %

 

I think use formula function is ok, but I keep getting error messages...

Also, somehow when I try to filter the columns for "adjusted Sales $" by using formula function, it doesn't work at all.

I believe it is some space between $ and % as I have this message in the data "This cell has trailing spaces"....

So I decided to use Contains([Metrics],"Adjusted Sales") and it works perfectly. 

 

So I can I make the formula to say 

if metrics contains "Adjusted Sales $", then Sales$", else "Sales%"

 

Thank you. 

2 REPLIES 2
MarqueeCrew
20 - Arcturus
20 - Arcturus

@ll1100000

 

I used the formula of:

 

IF 
	[Metrics] = 'Adjusted Sales $'	THEN	'Sales $'	ELSEIF
	[Metrics] = 'Adjusted Sales %'	THEN	'Sales %'
ELSE
	[Metrics]
ENDIF

I chose this formula because it is fairly straight-forward and easy to explain.  With space concerns, you might include: Trim([Metrics]) to the formula to get rid of all leading/trailing spaces.

 

Cheers,

Mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
jdunkerley79
ACE Emeritus
ACE Emeritus

@MarqueeCrew posted the simple answer.

 

If you are happy with RegEx, I would probably use:

REGEX_Replace([Metrics], "\s*Adjusted (Sales [%|$])\s*", "$1")

which will cope with leading trailing spaces

Labels